bind nick - * nickchange
set debug_channel "#debugs_tcl"
set Djs_channel #Djs_channel"
proc nickchange { oldnick uhost hand chan newnick } {
global debug_channel Djs_channel
if {[string tolower $chan] != [string tolower $Djs_channel]} {return 0}
#DJs data base
if {[file exists dj]} {
set temp [open "dj" r]
set djs [gets $temp]
set dj [lindex $djs 0]
close $temp
}
#putmsg $debug_channel "variable previous nick = $oldnick"
#dj database waiting timer
utimer 5 [list vDJ oldnick uhost hand chan newnick Djs_channel dj]
proc vDJ {$oldnick $uhost $hand $chan $newnick $Djs_channel $dj} {
if {([info exist dj]) && ([info exist oldnick]) && ($oldnick == "$dj")} { putmsg $Djs_channel "$newnick does not change its nickname while is on air. Thanks"
return
}
#DJs and Staff check flags
set hand [nick2hand $oldnick $chan]
if {[djs:check:flags $chan $hand]} { return
} else {
putmsg $Djs_channel "$newnick remember back to your nick..."
}
}
}
ERROR:
[10:39:38] Tcl error in script for 'timer45':
[10:39:38] can't read "oldnick": no such variable
..................................................
#putmsg $debug_channel "variable previous nick = $oldnick" HERE $oldnick is set perfectly..
#dj database waiting timer
utimer 5
proc vDJ {$oldnick $uhost $hand $chan $newnick $Djs_channel $dj} { HERE can't read "oldnick": no such variable
I do not understand that the variable has value on the previous line and NOT in the next line.
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks
If so, I saw that too.
However, wouldn't that itself assign a value to the variable in the proc when called? Thus perhaps causing some other error, but not the one described?
I started to answer this post earlier, then after I re-thought it as just stated, I convinced myself that I was not awake yet, and to wait awhile.
I must be overlooking something ....
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !