(In the Party Line) Type .chanset #ChannelName +antislap
namespace eval antislap {
variable author "iRoc <sazid_mohakhali@yahoo.com> (c)"
variable version "1.0.0"
variable date "10-April-2011"
set time_up [clock clicks -milliseconds]
set ::antislap::check(delay) 20
variable chflag antislap
setudef flag $chflag
bind ctcp - "ACTION" ::antislap::actn
proc actn {nick uhost hand chan key text} {
variable texts; variable chflag
if {![channel get $chan $chflag]} {return}
set nick [split $nick]
if {[info exists ::antislap::check(lasttime,$uhost)] && [expr $::antislap::check(lasttime,$uhost) + $::antislap::check(delay)] > [clock seconds] && ![matchattr $hand n]} {return}
if {[string match "*$::botnick*" $text]} {
set ::antislap::check(lasttime,$uhost) [clock seconds]
putserv "PRIVMSG $chan :\001ACTION [regsub -- %nick% [lindex $::antislap::texts [rand [llength $::antislap::texts]]] $nick]\001"
}
}
variable texts {
"slaps %nick% around a bit with a large trout"
"slaps %nick% back with a large trout!"
}
set time_down [clock clicks -milliseconds]
putlog "AntiSlap v$version \[$date\] by $author loaded in [expr ($time_down-$time_up)/1000.0] s"
}