this tcl generates me the following error in partyline:
[20:03] <(Deborilla> [01:04:00] -Anti-Lag- Comprobando si hay un retraso en mi servidor.
[20:04] <(Deborilla> [01:04:00] -Anti-Lag- El retraso corriente actual es 1.552 segundos.
[20:04] <(Deborilla> [01:04:00] Tcl error [raw:check:lag]: can't unset "::chan": no such variable
# Set here the user flag for using the commands.
set lagflag "m"
# Set here the channels that the bot will notify that the lag is too high. Set to "" to disable.
set lagchans "#lapaz #cremacamba"
# This is the lag limit, if the lag exceeds this time (in seconds), the bot will jump servers.
set antilagtime 5
# This is the script timer, this is the number of minutes the bot will check the lag.
set lagtimer 20
# Set this to 1 if you want the bot to notify the partyline when checking the lag. Set to 0 to disable.
set lagnotify 1
### Do not edit below this line! ###
### ---------------------------- ###
set antilagv 1.03
bind raw - 391 raw:check:lag
bind pub ${lagflag} !lagcheck pub:antilag
bind dcc ${lagflag} lagcheck dcc:antilag
if {![info exists antilagloaded]} {
timer $lagtimer proc:antilag
set antilagloaded 1
}
proc proc:antilag {} {
global lagtimer lagnotify
set ::lag "[clock clicks]"
set ::type 0
if {$lagnotify == 1} { putlog "\002-Anti-Lag-\002 Now checking server lag." }
putquick "TIME"
timer $lagtimer proc:antilag
}
proc pub:antilag {nick uhost hand chan text} {
global lagchans
foreach msgchan $lagchans {
if {$chan == $msgchan} {
set ::lag "[clock clicks]"
set ::type 1
set ::chan $msgchan
putquick "PRIVMSG $::chan :\002-Anti-Lag-\002 Now checking server lag."
putquick "TIME"
}
}
}
proc dcc:antilag {hand idx text} {
set ::lag "[clock clicks]"
putlog "\002-Anti-Lag-\002 Now checking server lag."
set ::type 2
putquick "TIME"
}
proc raw:check:lag {from key text} {
global antilagtime lagchans lagnotify
set lag [expr ((([clock clicks] - $::lag)/2)/60)/1000.]
if {$lagnotify == 1} { putlog "\002-Anti-Lag-\002 Current lag is \002$lag\002 seconds." }
if {$::type == 1} { putquick "PRIVMSG $::chan :\002-Anti-Lag-\002 Current lag is \002$lag\002 seconds." }
if {($lagnotify == 0) && ($::type == 2)} { putlog "\002-Anti-Lag-\002 Current lag is \002$lag\002 seconds." }
if {$lag > $antilagtime} {
if {($lagchans != "") && ($::type != 2)} {
foreach msgchan $lagchans {
putquick "PRIVMSG $msgchan :\002Attention\002: My lag has exceeded the limit of $antilagtime seconds (currently at $lag seconds). I am now jumping servers."
}
}
putlog "\002-Anti-Lag-\002 Lag exceeded $antilagtime seconds. Trying another server..."
jump
}
unset ::lag
unset ::chan
if {[info exists ::type]} { unset ::type }
}
putlog "\002-Anti-Lag-\002 $antilagv by FrostByte: Loaded"
# Set here the user flag for using the commands.
set lagflag "m"
# Set here the channels that the bot will notify that the lag is too high. Set to "" to disable.
set lagchans "#lapaz #cremacamba"
# This is the lag limit, if the lag exceeds this time (in seconds), the bot will jump servers.
set antilagtime 5
# This is the script timer, this is the number of minutes the bot will check the lag.
set lagtimer 20
# Set this to 1 if you want the bot to notify the partyline when checking the lag. Set to 0 to disable.
set lagnotify 1
### Do not edit below this line! ###
### ---------------------------- ###
set antilagv 1.03
bind raw - 391 raw:check:lag
bind pub ${lagflag} !lagcheck pub:antilag
bind dcc ${lagflag} lagcheck dcc:antilag
if {![info exists antilagloaded]} {
timer $lagtimer proc:antilag
set antilagloaded 1
}
proc proc:antilag {} {
global lagtimer lagnotify
set ::lag "[clock clicks]"
set ::type 0
if {$lagnotify == 1} { putlog "\002-Anti-Lag-\002 Now checking server lag." }
putquick "TIME"
timer $lagtimer proc:antilag
}
proc pub:antilag {nick uhost hand chan text} {
global lagchans
foreach msgchan $lagchans {
if {$chan == $msgchan} {
set ::lag "[clock clicks]"
set ::type 1
set ::chan $msgchan
putquick "PRIVMSG $::chan :\002-Anti-Lag-\002 Now checking server lag."
putquick "TIME"
}
}
}
proc dcc:antilag {hand idx text} {
set ::lag "[clock clicks]"
putlog "\002-Anti-Lag-\002 Now checking server lag."
set ::type 2
putquick "TIME"
}
proc raw:check:lag {from key text} {
global antilagtime lagchans lagnotify
set lag [expr ((([clock clicks] - $::lag)/2)/60)/1000.]
if {$lagnotify == 1} { putlog "\002-Anti-Lag-\002 Current lag is \002$lag\002 seconds." }
if {$::type == 1} { putquick "PRIVMSG $::chan :\002-Anti-Lag-\002 Current lag is \002$lag\002 seconds." }
if {($lagnotify == 0) && ($::type == 2)} { putlog "\002-Anti-Lag-\002 Current lag is \002$lag\002 seconds." }
if {$lag > $antilagtime} {
if {($lagchans != "") && ($::type != 2)} {
foreach msgchan $lagchans {
putquick "PRIVMSG $msgchan :\002Attention\002: My lag has exceeded the limit of $antilagtime seconds (currently at $lag seconds). I am now jumping servers."
}
}
putlog "\002-Anti-Lag-\002 Lag exceeded $antilagtime seconds. Trying another server..."
jump
}
unset -nocomplain ::lag
unset -nocomplain ::chan
if {[info exists ::type]} { unset -nocomplain ::type }
}
putlog "\002-Anti-Lag-\002 $antilagv by FrostByte: Loaded"