| View previous topic :: View next topic |
| Author |
Message |
Fill Halfop
Joined: 18 Jan 2009 Posts: 80
|
Posted: Tue Mar 17, 2009 4:33 pm Post subject: Add exceptions for Anti-Spam script |
|
|
Hi folks,
I have a simple anti-spam script like this:
| Code: |
bind pubm "#cyber-world *.net*" spamfilter
proc spamfilter { nick uhost hand chan text } {
putserv "KICK $chan $nick :Go spam your own chan!"
}
|
But I'd like to add some exceptions to this, e.g., if the user says www.therostrum.net, the bot doesn't kick him, but kicks with any other website.
I tried using string first and string match but didn't get any successful result. Could you help me out with this?
Thanks in advance,
Fill |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Tue Mar 17, 2009 10:20 pm Post subject: |
|
|
You missed out the flags argument in the pubm bind btw
bind pubm <flags> <mask> <procname>
| Code: |
set varExceptions {
"www.therostrum.net"
"www.anothersite.net"
}
bind pubm - "#cyber-world *.net*" spamfilter
proc spamfilter { nick uhost hand chan text } {
global varExceptions
foreach site $varExceptions {
if {[string match -nocase "*$site*" $text]} {return 0}
}
putserv "KICK $chan $nick :Go spam your own chan!"
}
|
_________________ I must have had nothing to do |
|
| Back to top |
|
 |
Fill Halfop
Joined: 18 Jan 2009 Posts: 80
|
Posted: Wed Mar 18, 2009 3:12 am Post subject: |
|
|
ahm yeah, you're right, forgot the flags
I'll be testing it in some hours, now I can't access the bot. Thanks for the help.
See ya |
|
| Back to top |
|
 |
|