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.

Add exceptions for Anti-Spam script

Help for those learning Tcl or writing their own scripts.
Post Reply
F
Fill
Halfop
Posts: 80
Joined: Sun Jan 18, 2009 6:08 pm

Add exceptions for Anti-Spam script

Post by Fill »

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
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

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
F
Fill
Halfop
Posts: 80
Joined: Sun Jan 18, 2009 6:08 pm

Post by Fill »

ahm yeah, you're right, forgot the flags :roll:

I'll be testing it in some hours, now I can't access the bot. Thanks for the help.

See ya
Post Reply