This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

help with utimer and killutimer

Help for those learning Tcl or writing their own scripts.
Post Reply
t
tekster
Voice
Posts: 8
Joined: Sun Jul 09, 2006 2:44 am

help with utimer and killutimer

Post by tekster »

i need some help with killing the utimer that i start in the start:timer proc, im still pretty new at coding this, so i need some help in getting it to stop, thx

Code: Select all

bind pub - .timer start:timer
bind pub - .stop stop:timer

proc start:timer {nick host hand chan text} {
global channel msg interval id
 if {[string equal -nocase #chan $chan]} {
  if {[isop $nick $chan]} {
   set name $nick
   set interval [lindex $text 0]
   set channel [lindex $text 1]
   set msg [lrange $text 2 end]
   utimer $interval timer
   putserv "NOTICE $nick :Starting timer Message: \"$msg \" Every $interval seconds"
  }
 }
}

proc timer {} {
global channel msg interval timerID
  putserv "PRIVMSG $channel :$msg "
  utimer $interval timer
}

proc stop:timer {nick host hand chan text} {
putserv "NOTICE $nick :Timer stopped"
  foreach t [utimers] { 
  if [string match *stop:timer* [lindex $t 1]] { 
  killutimer [lindex $t end] 
  } 
 } 
return 1 
}
 
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Post Reply