How to Remove Miliseconds on Gettimerinfo While Reporting

Posted by Darkwingduck on Fri 30 Dec 2022 01:56 AM — 2 posts, 8,722 views.

#0
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?
Amended on Fri 30 Dec 2022 01:59 AM by Darkwingduck
Australia Forum Administrator #1
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.