[23:39:42] Tcl error [ctcp_repeat]: invalid command name "ctcp_repeat"
Code: Select all
set repeat_msg {
"Kick message 1"
"Kick message 2"
}
set repeat_time 0
set repeat_chans "#"
bind pubm - * pubm_repeat
bind ctcp - ACTION ctcp_repeat
proc pubm_repeat {nick uhost hand chan arg} {
global repeat_msg repeat_time repeat_chans repeat_data botnick
if {(([lsearch -exact [string tolower $repeat_chans] [string tolower $chan]] != -1) && ($repeat_chans == "*")) && (![isop $nick $chan]) && (![isvoice $nick $chan]) && ($nick != $botnick)} {
if {([info exists repeat_data($nick-$chan)]) && ($repeat_data($nick-$chan) == $arg)} {
set banmask "*!*@[lindex [split $uhost @] 1]"
set kickmsg [lindex $repeat_msg [rand [llength $repeat_msg]]]
newchanban $chan $banmask $nick $kickmsg
unset repeat_data($nick-$chan)
} else {
set repeat_data($nick-$chan) $arg
utimer $repeat_time "catch {unset repeat_data([xsplit $nick-$chan])} 180"
}
}
}
proc ctcp_repeat {nick uhost hand chan keyword arg} {
pubm_repeat $nick $uhost $hand $chan $arg
}
proc xsplit {arg} {
regsub -all "\\\[" $arg "\\\[" arg
regsub -all "\\\]" $arg "\\\]" arg
return $arg
}