mIRC Home    About    Download    Register    News    Help

Print Thread
#242083 16/06/13 01:03 PM
Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
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.

GamingTom #242090 16/06/13 02:24 PM
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
In regex "." matches any character, if you want to match a literal "." you need to escape like "\."

Loki12583 #242091 16/06/13 02:36 PM
Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
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.
}

GamingTom #242092 16/06/13 03:15 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
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.
}


Link Copied to Clipboard