Open Yakov-Chernogor opened 6 years ago
You're missing a closing bracket.
Sorry, forgot it when I was trying to reproduce the bug. I've edited first post
Okay, so why use the if statement for the regex detection? I'm sure the parentheses of regex is messing with the if statement formatting. Try this.
automacro spampm {
PrivMsg /(w.*|W.*|v.*|V.*).*(c[o0]m|C[0O]M)/
call {
do ignore 1 $.PrivMsgLastName
log Ignoring $.PrivMsgLastName
}
}
It will only activate when a private message contains your desired regex. No need for a check for a private message first, then check what the message contains.
regex on eventMacro doesn't support you use (
and )
inside regex on an if condition
however, in a automacro condition, it works normally
there is a Pull Request to solve this issue (i did it) but only the creator of eventMacro can approve, and he is VERY busy with college
and this regex is wrong
you could do it like this :
if ( $.PrivMsgLastMsg =~ /www\..*\.com/i )
I highly recommend you all using the strict regex.
In this case, I suggest www\.[\w\d-_]*\.co(m|\.\w+)
to catch the URL.
If you want to examine or test out regex, please try it on online regex tester sites. i.e. https://regexr.com/
I'm doing macro for spam blocking and I'm faced that if statement is bugged, it does not work with some phrases that contains <<<<<<< or >>>>>> symbols My macro:
Console error message:
The private message from spamer: