#--------------------------------------------------------------------- # bignicknotalk.tcl # TCL script for IRC bot eggdrop # # Allow long nicks of more than "maxnicklen" characters on a channel. # But kick when such nick talk. (Maximum 1 kick per 10 seconds). # Exempt: users with one of the global/channel flags (n m o f). # # v0: 27-Mar-2002 #--------------------------------------------------------------------- set maxnicklen 15 #--------------------------------------------------------------------- # On pubm check the nick length #--------------------------------------------------------------------- package require eggdrop 1.6 package require Tcl 8.0 bind pubm - * bignicknotalk set bignicknotalkstamp 0 proc bignicknotalk { nick uhost hand chan text } { global botnick global maxnicklen global bignicknotalkstamp # check the nick length if { [string length $nick] <= $maxnicklen } { return } # stop if bot is not op on channel if { ![botisop $chan] } { return } set currenttime [unixtime] # limit to one kick per 10 seconds if { [info exists bignicknotalkstamp] } { if { $currenttime - $bignicknotalkstamp < 10 } { return } } # known user with one of the exempt flags (n/m/o/f) if { [validuser $hand] } { foreach flag "n m o f" { if {[matchattr $hand $flag]} { return } if {[matchchanattr $hand $flag $chan]} { return } } } # just in case (does it ever happen?) if { [string compare $nick $botnick] == 0 } { return } putserv "KICK $chan $nick :Shrink your nick to\ $maxnicklen characters or less." # reset the time stamp set bignicknotalkstamp $currenttime } putlog "Bignicknotalk version 0 loaded"