Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ timer questions

timer questions

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Tsunami   USA  (204 posts)  Bio
Date Tue 07 Feb 2006 07:10 PM (UTC)
Message
I have some questions on timers. Specifically I want to use a timer to execute a script function five seconds after some event. As far as I know world.DoAfterSpecial could potentially create thousands of one shot timers (I'll be doing this a lot) so I wanted to use a timer. However, as far as I can tell a timer simply fires every 5 seconds after created, regardless of whether it is enabled or not. This leaves no guarentee that the timer will fire exactly 5 seconds after it is enabled. It could potentially fire at any time within those five seconds.

Is there anyway to ensure that it will fire only 5 seconds after being enabled? I tried using world.ResetTimer, but this did not seem to have any effect.
Top

Posted by Essidus   (16 posts)  Bio
Date Reply #1 on Tue 07 Feb 2006 07:51 PM (UTC)
Message
resettimer is your best bet. Make sure you use it after you've enabled the timer though, or else it won't reset properly.
Top

Posted by Tsunami   USA  (204 posts)  Bio
Date Reply #2 on Tue 07 Feb 2006 08:43 PM (UTC)
Message
Oh I see, I was reseting it before enabling it. I'll try that now, thanks a lot.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #3 on Tue 07 Feb 2006 09:23 PM (UTC)
Message
I have amended the documentation for ResetTimer to make it clear they must be enabled first.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,327 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.