mIRC Homepage
Posted By: bwttruman Timing out a message containing two words - 14/11/15 06:01 AM
Quote:
on $*:text:/(bad word|word bad)/Si:#:{
msg # /timeout $nick 600


So let's say "bad word" is banned in a channel, and "word bad" is banned. On their own "bad" and "word" they are fine until combined in a message. If someone were to say "Banned is the word" how would I have that also be timed for containing both of the words?
I read in a list of bad words from a text file. In the txt file i put on a new line: "*bad word*" and "*word bad*"

That's how i handle it. For just those two words, add the wild cards and it should work just fine.
Meant to say "bad is the word" or "the word is bad"
Just so i understand, you want to timeout "bad*word" and "word*bad" but not either of them by themselves?

If i understood correctly, you can put them in just like that in a file or in your on text event or do regex pattern matching.
Correct, so the message is only timed out if it contains both words.
So yes, to accomplish this you could easily do:

Code:
on *:text:bad*word:#: {
  do something
}


and

Code:
on *text:word*bad:#: {
  do something
}


However this isn't really scalable. Back to my original comment, i would make a text file to read in bad words, then you can easily put them in this file in the future. Either manually or add a command to do it through chat.
© mIRC Discussion Forums