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, 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.
Entire forum
MUSHclient
General
Cron for MUSHclient
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Shaun Biggs
USA (644 posts) bio
|
Date
| Thu 14 Jun 2007 07:46 PM (UTC) |
Message
| I'd like to have a few timers fire at specific points in time. Like at midnight, or every hour on the hour. I've started making a scheduler plugin which will allow me to do this by making triggers offset by the difference between the current time and the target time, then proceeding as normal. Is there a simpler way to do this already in MUSHclient? Some sort of "do this at this specific time" function, perhaps.
Either way I'll probably keep making the plugin, because it would be nice to have some sort of scheduler where all of this can be dealt with in one place. |
It is much easier to fight for one's ideals than to live up to them. | top |
|
Posted by
| Nick Gammon
Australia (23,042 posts) bio
Forum Administrator |
Date
| Reply #1 on Thu 14 Jun 2007 08:41 PM (UTC) |
Message
| Timers already have an option to fire at a specific time. Check out the GUI interface, it has always been there. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Shaun Biggs
USA (644 posts) bio
|
Date
| Reply #2 on Thu 14 Jun 2007 10:58 PM (UTC) Amended on Thu 14 Jun 2007 11:00 PM (UTC) by Shaun Biggs
|
Message
| That will fire on one specific time, but not every half hour, for example, correct? You would have to set it up to fire once, and then another one to fire every half hour after that, as far as I can tell. Sorry for being a bit unclear. I knew about the once per day part, but I couldn't figure out a way to just have it fire on *:30 or anything like that. Or similar to cron "0,15,30,45 * * * *" |
It is much easier to fight for one's ideals than to live up to them. | top |
|
Posted by
| Nick Gammon
Australia (23,042 posts) bio
Forum Administrator |
Date
| Reply #3 on Thu 14 Jun 2007 11:10 PM (UTC) |
Message
| Yes, one specific time, per day. You initially said "at midnight", so that would do that. You also said 'some sort of "do this at this specific time" function, perhaps.' - I was addressing that request.
For every hour on the hour, you could simply script adding 24 timers, one for each hour, each of which calls the same script function.
This could messy for every 30 minutes, so in that case I would make one that fires every minute (say), and checks against a table (probably like Cron does), to see if it is really time to do something. The overhead would be minimal, and then you could make quite a fancy table that controls its behaviour. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Shaun Biggs
USA (644 posts) bio
|
Date
| Reply #4 on Fri 15 Jun 2007 03:56 AM (UTC) |
Message
| As I said, I am mostly using a Lua script to set up an offset for each timer, then timing for every 30 min. after that.
For the "at this specific time," my apologies again for being unclear. I meant as in every 30 minutes on the half hour and whole hour, ex: 1:30, 2:00, 2:30, etc. Even if I start up MUSHclient at 1:15. The overhead is a bit less if I just set everything up at connection off of a quick table than checking every minute, but I've used the every minute one and didn't notice any slowdown at all like that, even on my old p233 laptop. I just needed to condense everything into something I could mentally keep track of a bit easier.
Thank you again for all your help. Things got clarified quite a bit for me in just a few quick posts. |
It is much easier to fight for one's ideals than to live up to them. | top |
|
Posted by
| Poromenos
Greece (1,037 posts) bio
|
Date
| Reply #5 on Fri 22 Jun 2007 01:23 PM (UTC) Amended on Fri 22 Jun 2007 01:24 PM (UTC) by Poromenos
|
Message
| Actually, if you wanted to make this plugin (assuming you don't mind all the timers being in one place and not in their world files, but since you're making it you probably don't), I think it wouldn't be very hard to make one timer that fires every minute to check a sort of crontab file for the functions to call... |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | top |
|
Posted by
| Shaun Biggs
USA (644 posts) bio
|
Date
| Reply #6 on Fri 22 Jun 2007 08:23 PM (UTC) |
Message
| It's actually quite convenient with Lua tables, since you can just have functions reference whatever spot of the table that relates to now. If nothing exists, the hash file runs nothing, and if something does exist, it's dynamically linked to whatever command you have listed. |
It is much easier to fight for one's ideals than to live up to them. | 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.
19,655 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.