| View previous topic :: View next topic |
| Author |
Message |
Fill Halfop
Joined: 18 Jan 2009 Posts: 80
|
Posted: Mon Mar 23, 2009 6:26 pm Post subject: Spam protection |
|
|
Hey there,
I'm building an anti-spam script which is now something like this:
| Code: |
set varExceptions {
"exception 1"
"exception 2"
}
bind pubm - "$spamchan *.net*" spamfilter
bind pubm - "$spamchan *http://*" spamfilter
bind pubm - "$spamchan *www.*" spamfilter
bind pubm - "$spamchan *hotmail*" spamfilter
bind pubm - "$spamchan *mail*" spamfilter
bind pubm - "$spamchan *youtube*" spamfilter
bind pubm - "$spamchan *myspace*" spamfilter
bind pubm - "$spamchan *blog*" spamfilter
bind pubm - "$spamchan *flog*" spamfilter
bind pubm - "$spamchan *fotolog*" spamfilter
bind pubm - "$spamchan *#*" spamfilter
bind pubm - "$spamchan *.pt*" spamfilter
bind pubm - "$spamchan *.com.pt*" spamfilter
bind pubm - "$spamchan *.biz*" spamfilter
bind pubm - "$spamchan *.info*" spamfilter
bind pubm - "$spamchan *.com*" spamfilter
bind pubm - "$spamchan *.net*" spamfilter
bind pubm - "$spamchan *.org*" spamfilter
bind pubm - "$spamchan *.co.uk*" spamfilter
bind pubm - "$spamchan *.eu*" spamfilter
bind pubm - "$spamchan *.au*" spamfilter
bind pubm - "$spamchan *.com.br*" spamfilter
bind pubm - "$spamchan *.tv*" spamfilter
bind pubm - "$spamchan *.org.pt*" spamfilter
bind pubm - "$spamchan *.me*" spamfilter
proc spamfilter { nick uhost hand chan text } {
global varExceptions spammer
foreach site $varExceptions {
if {[string match -nocase "*$site*" $text]} {return 0}
}
if {(![isop $nick $chan]) && (![ishalfop $nick $chan]) && (![isvoice $nick $chan]) } {
set host *!*@[lindex [split $uhost @] 1]
newchanban $chan ~q:$host RoBotX(nospam.tcl) spammer($chan) 60 sticky
putserv "PRIVMSG $chan $nick: You're not allowed to spam on $chan. Adding temporary ~q: ban on your host. All your messages will be ignored from now on."
}
}
|
The problem is that when someone says "Visit my website --> www.testsomething.net", the bot sends double message, 'cos it binds the *www.* and *.net* -.-"
However I want to bind all these wildcards because sometimes they just say "site.net", etc... and I also have to mantain my exceptions.
What's your suggestion to solve my problem? |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Tue Mar 24, 2009 6:45 am Post subject: |
|
|
It is a sort of byproduct of your method of dealing with spam. Specifically, seperate PUBM binds.
The norm would be to create a list of *spam* masks and, using a single PUBM bind, test each in a foreach loop. You could then output and break from the loop upon finding the first incidence of spam.
Remember also that the bot must test each PUBM bind against each IRC channel chat line. In a fast moving channel with many PUBM binds, that puts a significant strain on the bots resources.
Check out the scripts on offer on this site's Tcl achive. It's a good way to learn.
To be fair I suppose testing each chat line against many spam masks is perhaps also something of a strain too. _________________ I must have had nothing to do |
|
| Back to top |
|
 |
Kein Voice
Joined: 09 Apr 2008 Posts: 21
|
Posted: Tue Mar 24, 2009 12:42 pm Post subject: |
|
|
OMG
That is the first time when I see such big amounts of pubms >_>
As arfer already said: use general '*' pubm :P _________________ I'm too lazy for all of this |
|
| Back to top |
|
 |
Fill Halfop
Joined: 18 Jan 2009 Posts: 80
|
Posted: Wed Mar 25, 2009 8:13 am Post subject: |
|
|
| arfer wrote: | It is a sort of byproduct of your method of dealing with spam. Specifically, seperate PUBM binds.
The norm would be to create a list of *spam* masks and, using a single PUBM bind, test each in a foreach loop. You could then output and break from the loop upon finding the first incidence of spam.
Remember also that the bot must test each PUBM bind against each IRC channel chat line. In a fast moving channel with many PUBM binds, that puts a significant strain on the bots resources.
Check out the scripts on offer on this site's Tcl achive. It's a good way to learn.
To be fair I suppose testing each chat line against many spam masks is perhaps also something of a strain too. |
yeah I see. someone told me to use regular expressions for URL matching. But maybe your method is better, I'll try and download some sample script @ the TCL archive. anyway, how would I stop a loop upon the first matching? |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Wed Mar 25, 2009 12:45 pm Post subject: |
|
|
After executing whatever kick/ban/warning code simply use the Tcl command break to exit the foreach loop.
I have to say, I have a particular loathing of these scripts. They lack inbuilt intelligence (masks are generally too vague). For example, all it takes is for one user to say to another user on the channel "Are you on myspace?" and they get an immediate sticky ban. _________________ I must have had nothing to do |
|
| Back to top |
|
 |
zerodtk Voice
Joined: 25 Mar 2009 Posts: 20
|
Posted: Wed Mar 25, 2009 8:52 pm Post subject: |
|
|
or just try to add it with *www*biz*
just a quick thought |
|
| Back to top |
|
 |
Fill Halfop
Joined: 18 Jan 2009 Posts: 80
|
Posted: Thu Mar 26, 2009 3:30 pm Post subject: |
|
|
| arfer wrote: | After executing whatever kick/ban/warning code simply use the Tcl command break to exit the foreach loop.
I have to say, I have a particular loathing of these scripts. They lack inbuilt intelligence (masks are generally too vague). For example, all it takes is for one user to say to another user on the channel "Are you on myspace?" and they get an immediate sticky ban. |
Well I didn't decide the binds, someone asked me to do it with these wildcards ^^ |
|
| Back to top |
|
 |
|