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.

weird timer

Old posts that have not been replied to for several years.
Locked
S
Snapple
Voice
Posts: 38
Joined: Fri Jul 18, 2003 4:41 pm
Location: Israel
Contact:

weird timer

Post by Snapple »

Well, I put timer on 10 for 10 minutes
yesterday for the whole day it worked fine
now it started to be every minute
timer 10 [list starta $chan]
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Re: weird timer

Post by strikelight »

Snapple wrote:Well, I put timer on 10 for 10 minutes
yesterday for the whole day it worked fine
now it started to be every minute
timer 10 [list starta $chan]
Sounds like someone has been .rehash'ing quite a bit then...
when rehashing and dealing with timers, it's always prudent to have code similar to the following:

Code: Select all

if {![info exists mytimercall]} {
  timer 10 [list starta $chan]
  set mytimercall 1
}
(Note: You could alternatively use the command lsearch with command timers, but imo that's more work than is needed)

This check is needed, because remember when you rehash, the bot loads all the scripts ontop of what has already been loaded, as opposed to restart which unloads (so to speak) the scripts first, and loads them up fresh.
Locked