| View previous topic :: View next topic |
| Author |
Message |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Tue Mar 07, 2006 2:23 pm Post subject: wow.tcl timer |
|
|
Can anyone show me what I can add to kill timer when bot jumps server? like on disconnect..
Because when I use this script and the bot jumps server it adds another 30min timer without killing the old timer..
and
| Code: |
proc timer:wow {} {
global botnick wowchan wowtime wowtxt
if { [onchan $botnick $wowchan] } {
set wowfile [open $wowtxt r]
set wowread [split [read $wowfile] \n]
close $wowfile
putserv "PRIVMSG $wowchan :[lindex $wowread [rand [llength $wowread]]] "
timer $wowtime "timer:wow"
}
}
|
|
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Tue Mar 07, 2006 2:26 pm Post subject: |
|
|
Just browsing over Tcl docs, you'll likely need to store the ID of the timer.
| Code: | set timerID [timer $wowtime "timer:wow"]
killtimer $timerID
set timerID [timer $wowtime "timer:wow"] |
Good luck. _________________ ; Answer a few unanswered posts! |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Tue Mar 07, 2006 4:20 pm Post subject: |
|
|
Thanks, I got it working...  |
|
| Back to top |
|
 |
|