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 ➜ values from timers to variables

values from timers to variables

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


Posted by Silencher   (55 posts)  Bio
Date Sat 12 Apr 2014 11:15 PM (UTC)
Message
I have a trigger set to try to monitor my cooldowns, it works fine and lets me know as soon as an ability is ready to use, but for the really long cooldown abilities, like 2-3 hours, it would be nice to know how much longer it is until the ability is ready.

Is there a way to pull the 'current' time of a timer and apply parts of it to a variable?

Say I have timer: "my_timer" and it's set to 1 hour, 30 minutes, 0 seconds. when it starts.

15 minutes and 23 seconds have passed.

Is there a way to pull that the time remaining on that trigger is 1 hour, 14 minutes and 37 seconds?
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 12 Apr 2014 11:30 PM (UTC)
Message
Template:function=GetTimerInfo GetTimerInfo

The documentation for the GetTimerInfo script function is available online. It is also in the MUSHclient help file.



Selector 12 tells you when the timer will fire. Thus you can work out from that (compared to the current time) how far in the future that is.

Or Selector 13: Number of seconds until timer will fire next ...

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


10,427 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.