ex: (IRChat) Called you on ( #IRChat ) MSG:(Stoner Welcome Back)
on *:TEXT:*:#:{
if ($chan == $active) {
halt
}
else {
if ($me isin $1-) {
haltdef
echo -a ( $+ $nick $+ ) Called you on ( $chan ) MSG:( $+ $1- $+ )
halt }
}
}
If you're going to use regex, at least fucking use it right.. And by the way kid, you can't bash someone if you don't know regex yourself. For one, $me won't evaluate. Two, $strip is unneccessary. Using /Si would do the same. And you didn't even open it, so here's what your failure of a regex should look like, and it wouldn't even work still!
on *:TEXT:*:#: {
if ($regex($1-,/$me|Word|Word2|Word3/Si)) { blah }
}
I ain't gonna argue with your name-calling, because that's the way you are. Before you call yourself a pro, can you at least have the decency to ensure that your example works before posting? You missed an "on" and the way you constructed your regex will not work. Let me give you two examples in return that work:
on *:TEXT:*:#: {
if ($regex($1-,/( $+ $me $+ |2nd|3rd|4th)/iS)) { ... }
}
Or
on $*:TEXT:$(/( $+ $me $+ |2nd|3rd|4th)/iS):#: { ... }
Actually Ghost-writer's altered version will make it only work when you're not looking at the active window. Furthermore, the dollar sign ($) next to the text event is not needed, since this is not a regex match.
And as sunslayer's stated, and I wish Ghost-writer's mentality can be more like yours, that using $iif is pointless when you are making one comparison. Now, that is a helpful tip right there.
My intention was to strip out the control codes if called by someone using them to trigger the script. Although it may seem the tokenize part is sorta excessive for a small script like this one, with only one $1- in it, it'll be another story if you have more than one $1- used in a script. That means you'll have to use $strip() everywhere to cover them. I'm not too big in using the $strip() identifier, but I always thought that'd affect a script's workability if someone's font is made out of control codes, which needs to be stripped to successfully initiate it. I may be mistaken, but please do correct me so I can steer myself in the right direction.