[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Cron for MUSHclient
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Cron for MUSHclient

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


Posted by Shaun Biggs   USA  (644 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,391 posts)  [Biography] 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
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,391 posts)  [Biography] 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
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] 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.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] 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!
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] 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.
[Go to top] 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.


5,038 views.

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

Go to topic:           Search the forum


[Go to top] 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.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]