Meta ChatMessageCapture Condition
ChatMessageCapture is a type of Meta condition added in Virindi Tank 0.3.1.172. It allows you to perform a Regular Expression match on incoming chatbox text and save matched substrings to Meta variables for later use. Additionally, you can filter incoming chat messages by message color.
A match string is a Regular Expression which may optionally contain named capture groups. When named capture groups are present and a match on incoming chat succeeds, the value of the capture is saved to a Meta expression variable named "capturegroup_yourcapturegroupname".
For color matching, the color string can either be blank or a semicolon-separated list of color ID numbers. If the color string is blank, chat of any color is matched. If the color string contains color ID numbers, the color of incoming chat must be one of the listed numbers to be matched.
The color ID of the last matched line is saved to the Meta expression variable "capturecolor".
For more information about colors, see AC Chatbox Colors.
The following example match string will match incoming tells to the player from another player:
- ^\<Tell\:IIDString\:[^\:]*\:[^\>]*>(?<tellchar>[^\<]*)\<\\Tell\> tells you\, \"(?<telltext>.*)\"$
When you receive the following tell,
- Somechar tells you, "HI!!"
the following Meta expression variables will be set:
- capturegroup_tellchar = Somechar (string value)
- capturegroup_telltext = HI!! (string value)
- capturecolor = 3 (number value)
An example profile that echoes incoming tells using a chat expression is available here: File:Tellechoexample.zip.
- Each meta tick, your condition is evaluated against all chatbox messages that have arrived since the previous meta tick. If multiple lines match the same condition, only the first matching line is used.
- Prior to 0.3.1.172, chat message strings for chat conditions often had a newline at the end. Newlines are now removed from incoming chat for both the Chat Message and the Chat Message Capture conditions.