This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
Fill
Halfop
Posts: 80 Joined: Sun Jan 18, 2009 6:08 pm
Post
by Fill » Tue Mar 17, 2009 4:33 pm
Hi folks,
I have a simple anti-spam script like this:
Code: Select all
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
arfer
Master
Posts: 436 Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK
Post
by arfer » Tue Mar 17, 2009 10:20 pm
You missed out the flags argument in the pubm bind btw
bind pubm <flags> <mask> <procname>
Code: Select all
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
Fill
Halfop
Posts: 80 Joined: Sun Jan 18, 2009 6:08 pm
Post
by Fill » Wed Mar 18, 2009 3:12 am
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