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.
 Entire forum ➜ MUSHclient ➜ General ➜ How to Remove Miliseconds on Gettimerinfo While Reporting

How to Remove Miliseconds on Gettimerinfo While Reporting

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


Posted by Darkwingduck   (1 post)  Bio
Date Fri 30 Dec 2022 01:56 AM (UTC)

Amended on Fri 30 Dec 2022 01:59 AM (UTC) by Darkwingduck

Message
Hello,

I am a bit new to coding in Mushclient. I wanted to create a countdown timer for respawning of the creatures. I used the Gettimerinfo function as below.

<triggers>
<trigger
enabled="y"
expand_variables="y"
group="Respawn Timer"
match="(Guild): *, &quot;Time Left.&quot;"
send_to="12"
sequence="100"
>
<send>foo=GetTimerInfo ("my_respawn", 13)

if foo

then

Send ("GT Remaining Time: " .. (GetTimerInfo ("my_respawn", 13)))

end -- if</send>
</trigger>
</triggers>

When the request triggered it gives a result like: Remaining Time: 117.10484535433

Is it possible to report this in only seconds?
Top

Posted by Nick Gammon   Australia  (23,098 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 30 Dec 2022 08:28 AM (UTC)

Amended on Fri 30 Dec 2022 08:30 AM (UTC) by Nick Gammon

Message
http://www.gammon.com.au/scripts/doc.php?lua=math.floor

You could round the results, but for one second resolution taking math.floor would be the simple answer.

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


4,091 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.