egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Add exceptions for Anti-Spam script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Fill
Halfop


Joined: 18 Jan 2009
Posts: 80

PostPosted: Tue Mar 17, 2009 4:33 pm    Post subject: Add exceptions for Anti-Spam script Reply with quote

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
View user's profile Send private message
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Tue Mar 17, 2009 10:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
Fill
Halfop


Joined: 18 Jan 2009
Posts: 80

PostPosted: Wed Mar 18, 2009 3:12 am    Post subject: Reply with quote

ahm yeah, you're right, forgot the flags Rolling Eyes

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

See ya
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber