# Ban word.
set spamwords {
 #
 http://
 www.
 .com
 .net
 .org
 .nu
 .ca
 .uk
 .edu
 {web page}
 site
}

# Time, in minutes that the ban will last:
# (43200 = 1 month)
set spambantime 43200

bind notc - *#* msg:banspam
#bind msg - * msg:banspam
#bind msgm - * msg:banspam

proc msg:banspam {nick host hand msg dest} {
global spambantime
#global spamwords  
   if {![validuser $hand]} {
#     foreach s $spamwords {
#        if {[lsearch -glob "$msg" "*$s*"] != -1} {
#    	  set ident [string range $uhost [expr [string first ! $uhost]+1]
#[expr [string last @ $uhost]-1]]
#	  set ban "*!*[string trimleft $ident "~"][string range [maskhost
#$uhost] [string first @ [maskhost $uhost]] e]"
	  newban $nick!*@* Ban-Spam "$msg" $spambantime
	  foreach chan [string tolower [channels]] {
	      putserv "KICK $chan $nick :You're being banned for $spambantime minutes, for spamming."
	    }
 #        }
  #    }
   }
}
Published in: TCL
Download

Related snippets