Example:
Code: Select all
bind cron - {*/5 * * * *} warns
proc warns {nick uhost hand chan text} {
global canal_admin
if {(![file exist notices]) || (![file exist dj])} {return}
set temp [open "notices" r]
set data [read -nonewline $temp]
close $temp
set lines [split $data "\n"]
set djnickname [lindex $lines 0]
set nchan [lindex $lines 1]
if {[file exist dj]} {
set temp [open "dj" r]
set dj [gets $temp]
set dj [lindex $dj 0]
close $temp
if {$djnickname != $dj} {return}
}
if {$djnickname == "AutoCHz"} {return}
set entra ""
set ic ""
set x 0
set y [llength $nchan]
while {$x < $y} {
set ic [lindex [split $nchan] $x end]
set x [expr {$x + 1}]
if { $ic == "" } { continue }
if {[onchan $djnickname $ic]} { continue
} else {
append entra [encoding convertfrom utf-8 " $ic"]
}}
set entra [encoding convertfrom utf-8 "$entra"]
putquick "NOTICE $djnickname :For to emit is neccesary join into $entra"
return
}
I have noticed that this TCL, together with others, lag to much bot.
For that reason desire which in x time or x number of warnings, the warning no longer continue, and that the command will disabled.
I can put a counter and reached a x number put a return command.
But what I really want is to see how to make a unbind this command.
You can perform unbind this commands?