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 ➜ Lua ➜ Lua timer not firing.

Lua timer not firing.

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


Posted by Zeno   USA  (2,871 posts)  Bio
Date Sat 28 Jul 2007 07:34 PM (UTC)
Message
I have this timer:
  <timer enabled="y"    send_to="12"
at_time="y" >
  <send>Note ("Starting new log file.")
CloseLog()
OpenLog ('BIYG-'..os.date("%m")..'-'..os.date("%d")..'-'..os.date("%Y")..'.txt', false)</send>

  </timer>


It is meant to fire at midnight to rotate my logs. The timer seems to never fire though, I tried setting my clock to 11:59PM and watching it hit the time.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #1 on Sat 28 Jul 2007 07:49 PM (UTC)
Message
I may be blind, but where is the time you are triggering on in the <timer> tag?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #2 on Sat 28 Jul 2007 07:50 PM (UTC)
Message
I dunno. It's set to time at 0 hours, 0 min, 0 sec (which I assume is midnight) in the GUI.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #3 on Sat 28 Jul 2007 07:57 PM (UTC)
Message
And is that absolute setting or a relative setting? I can't really test atm.

Otherwise, amuse me and try setting it to 00:01:30 (hh:mm:ss).
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #4 on Sat 28 Jul 2007 07:59 PM (UTC)

Amended on Sat 28 Jul 2007 08:00 PM (UTC) by Zeno

Message
It's set "At the time: 0 0 0".

Here is what I get for 00:01:30
<timer enabled="y" minute="1" second="30.00"    send_to="12"
at_time="y" >
  <send>Note ("Starting new log file.")
CloseLog()
OpenLog ('BIYG-'..os.date("%m")..'-'..os.date("%d")..'-'..os.date("%Y")..'.txt', false)</send>

  </timer>

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #5 on Sat 28 Jul 2007 08:07 PM (UTC)
Message
And does that work now?

Otherwise, a far-fetched idea of why it might not be working... I recall Nick changing the way <timer> was parsed for ImportXML due to some bug or unintended behaviour. Maybe this is some kind of regression with normal timers?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #6 on Sat 28 Jul 2007 08:14 PM (UTC)
Message
Didn't seem to work. I set the clock to 11:59PM and let it go to 12:03AM. Nothing happened.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #7 on Sat 28 Jul 2007 08:33 PM (UTC)
Message
Weird. I don't think I can help you anymore then. Sorry. :(
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #8 on Sat 28 Jul 2007 09:28 PM (UTC)
Message
Quote:

The timer seems to never fire though, I tried setting my clock to 11:59PM and watching it hit the time.


Are you connected to the world at the time? You need to check "Active when Disconnected".

- Nick Gammon

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #9 on Sat 28 Jul 2007 09:30 PM (UTC)
Message
I'm always connected to the world.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #10 on Sat 28 Jul 2007 09:52 PM (UTC)
Message
I set up your timer, and set the time to 11:59 pm, and it fired at midnight. However to test it I did a:


ResetTimer ("test") -- after renaming the timer "test"


The reason is that if you fiddle with the time it may get confused. Especially if you set the clock back to 11:59 pm it may think it has a day to go (not a minute). So by doing a ResetTimer you are making sure the day/date it is set to fire is the correct one.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #11 on Sat 28 Jul 2007 09:54 PM (UTC)
Message
The other thing I would do is print (or note somewhere) the return code from OpenLog. If it fails for some reason, the logs won't open. For example, if the path is not right.

- 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.


26,822 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.