mIRC Homepage
Posted By: GamingTom Need Help. - 16/06/13 01:03 PM
I wrote this script and I want it to block all links posted by people who have a user level of 1. This all seems to be working except if somebody says 'intercom' or any word with 'com' in it. I thought it would only timeout the people who say something with '.com' but that doesn't seems to be the case.

Code:
on $+1:TEXT:/http|https|www.|.com/:#:{
  timerlink1 1 2 msg $chan .timeout $nick 1
  timerlink2 1 2 msg $chan $nick $+ : Please ask before posting links, thank you.
}


Any help would be appreciated.
Posted By: Loki12583 Re: Need Help. - 16/06/13 02:24 PM
In regex "." matches any character, if you want to match a literal "." you need to escape like "\."
Posted By: GamingTom Re: Need Help. - 16/06/13 02:36 PM
I edited it to this but it still doesn't seem to ban people when they type '.com'. Am I doing something wrong?

Code:
on $+1:TEXT:/http|https|www.|\.com/:#:{
  timerlink1 1 2 msg $chan .timeout $nick 1
  timerlink2 1 2 msg $chan $nick $+ : Please ask before posting links, thank you.
}
Posted By: 5618 Re: Need Help. - 16/06/13 03:15 PM
You should probably use ( ) and add Si to strip control-codes and make the match case-insensitive.
Code:
on $+1:TEXT:/(http|https|www\.|\.com)/Si:#:{
  .timerlink1 1 2 msg $chan .timeout $nick 1
  .timerlink2 1 2 msg $chan $nick $+ : Please ask before posting links, thank you.
}
© mIRC Discussion Forums