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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  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] Refresh page


Posted by Darkwingduck   (1 post)  [Biography] 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?
[Go to top] top

Posted by Nick Gammon   Australia  (23,003 posts)  [Biography] 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
[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.


3,312 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 HostDash]