egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

wow.tcl timer

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Tue Mar 07, 2006 2:23 pm    Post subject: wow.tcl timer Reply with quote

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..

Code:

set wowtime "30"

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
View user's profile Send private message
incith
Master


Joined: 23 Apr 2005
Posts: 275
Location: Canada

PostPosted: Tue Mar 07, 2006 2:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Tue Mar 07, 2006 4:20 pm    Post subject: Reply with quote

Thanks, I got it working... Cool
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber