# ban-spammers.tcl v1.0 by FireEgl@EFNet <FireEgl@LinuxFan.com> - 4-19-00
# Description:
# Bans anyone not known to the bot if they join a channel
# and the first thing they say contains a web link.
#
# It could be done better I guess..
# Words that it checks for:
set spamwords {
http://
www.
.com
.net
.org
.nu
.ca
.uk
.edu
.it
{web page}
site
}
# Time, in minutes that the ban will last:
# (43200 = 1 month)
set spambantime 43200
# Set Global ban (1), or Channel ban (2), or just a kick (3)?
set spambantype 1
bind join - * join:banspam
proc join:banspam {nick host hand chan} { global banspam
if {![validuser $hand]} { set banspam($nick) 0 }
}
bind pubm - * pubm:banspam
proc pubm:banspam {nick host hand chan msg} { global banspam spamwords spambantime spambantype
if {[info exists banspam($nick)]} {
if {(([getchanidle $nick $chan] == 0) && ($banspam($nick) == 0))} {
foreach s $spamwords {
if {[lsearch -glob "$msg" "*$s*"] != -1} {
set host [getchanhost $nick $chan]
switch $spambantype {
"1" { putserv "KICK $chan $nick :No Spam!"
newban *!*@[lrange [split $host @] 1 end] Ban-Spam "$msg" $spambantime
}
"2" { putserv "KICK $chan $nick :No Spam!"
newchanban $chan *!*@[lrange [split $host @] 1 end] Ban-Spam "$msg" $spambantime
}
"3" { puthelp "KICK $chan $nick :No Spam!" }
"default" { putlog "$nick@$chan Just spammed the channel with: $msg" }
}
break
}
}
}
unset banspam($nick)
}
}
at join and pubm processes, then '.chanset #channel +spamwords' from party-line should do the trick.
PS: You can replace 'spamwords' with whatever you wish, as long as isn't already used. But if you do want to use an existing channel flag then don't add the 'setudef' part.
Once the game is over, the king and the pawn go back in the same box.