09-24-2018, 01:43 PM
(This post was last modified: 09-27-2018, 01:30 PM by MegaNo0body.)
I loved this request! I don't have BBot here, but I believe the final macro will be similar to this:
Outdated, new version below!
[macro]1 {Anti Bot Responder} Str.Set(AntiBotMessagePattern, ^\\[Sistema Anti-Bot\\].*: \(.*?\)$) When.SystemMessage(WhenReceivedAntiBotMessage, !AntiBotMessagePattern) Exit() {WhenReceivedAntiBotMessage} Self.Say(\!r !Str.Match.1)[/macro]
This regex can be seen here: https://regex101.com/r/45XrhL/1
As you can see, this regex will match a system message similar to the one you describe, it uses a (matching group) to capture anything after the : symbol. Then, it will simply Self.Say(...) that match.
Note: the Macro Engine requires several escaping of the regex (adding \ before some characters), because the regex contains some special symbols that BBot also recognizes. Escaping them makes them normal characters
Outdated, new version below!
[macro]1 {Anti Bot Responder} Str.Set(AntiBotMessagePattern, ^\\[Sistema Anti-Bot\\].*: \(.*?\)$) When.SystemMessage(WhenReceivedAntiBotMessage, !AntiBotMessagePattern) Exit() {WhenReceivedAntiBotMessage} Self.Say(\!r !Str.Match.1)[/macro]
This regex can be seen here: https://regex101.com/r/45XrhL/1
As you can see, this regex will match a system message similar to the one you describe, it uses a (matching group) to capture anything after the : symbol. Then, it will simply Self.Say(...) that match.
Note: the Macro Engine requires several escaping of the regex (adding \ before some characters), because the regex contains some special symbols that BBot also recognizes. Escaping them makes them normal characters
