ChatMessageCapture syntax
Posted: September 14th, 2016, 2:05 am
I'm trying to use ChatMessageCapture on Fellowship messages for a potential meta replacement for the old Make It! plugin.
I've found examples for tells and /vcg but nothing actually documents why there are parts that are so different from generic chat command matches. The wiki doesn't mention it at all. It just goes straight to examples.
Example ChatMessageCapture:
^\<Tell\:IIDString\:[^\:]*\:[^\>]*>(?<tellchar>[^\<]*)\<\\Tell\> tells you\, \"(?<telltext>.*)\"$
Example ChatMessage:
^\[Fellowship\] (|).* (say), \"!command"$
I hate hate hate regex. I searched around but the only references to IIDString are people writing AC plugins but nothing useful to me. I'm figuring it's something under the hood that I can't see?
Let's say I want:
[Fellowship] You say, "!make 10 Chorizite Potion"
...to save "10" as an int in capturegroup_amount and "Chorizite Potion" as a string in capturegroup_item.
How do I construct the ChatMessageCapture for that? I've tried tinkering around with various regexes similar to the example but nothing I've tried is setting the variables.
I've found examples for tells and /vcg but nothing actually documents why there are parts that are so different from generic chat command matches. The wiki doesn't mention it at all. It just goes straight to examples.
Example ChatMessageCapture:
^\<Tell\:IIDString\:[^\:]*\:[^\>]*>(?<tellchar>[^\<]*)\<\\Tell\> tells you\, \"(?<telltext>.*)\"$
Example ChatMessage:
^\[Fellowship\] (|).* (say), \"!command"$
I hate hate hate regex. I searched around but the only references to IIDString are people writing AC plugins but nothing useful to me. I'm figuring it's something under the hood that I can't see?
Let's say I want:
[Fellowship] You say, "!make 10 Chorizite Potion"
...to save "10" as an int in capturegroup_amount and "Chorizite Potion" as a string in capturegroup_item.
How do I construct the ChatMessageCapture for that? I've tried tinkering around with various regexes similar to the example but nothing I've tried is setting the variables.