Elapsed time from Rocket Rush

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
XaLpHa89
Fast Inserter
Fast Inserter
Posts: 119
Joined: Wed Jan 24, 2018 6:59 am
Contact:

Elapsed time from Rocket Rush

Post by XaLpHa89 »

The scenario is about time, only it is annoying to have to enter the command /time all the time, so it would be nice if the following function is shown in the header.
20200305122230_1.jpg
20200305122230_1.jpg (2.54 KiB) Viewed 666 times

Code: Select all

function seconds_to_clock( seconds )
    local seconds = tonumber( seconds )
    if seconds <= 0 then
        return '00:00:00'
    else
        local hours = string.format( '%02.f', math.floor( seconds / 3600 ) )
        local minutes = string.format( '%02.f', math.floor( seconds / 60 - ( hours * 60 ) ) )
        seconds = string.format( '%02.f', math.floor( seconds - hours * 3600 - minutes * 60 ) )
        return hours .. ':' .. minutes .. ':' .. seconds
    end
end

conn11
Filter Inserter
Filter Inserter
Posts: 385
Joined: Wed Sep 14, 2016 5:02 pm
Contact:

Re: Elapsed time from Rocket Rush

Post by conn11 »

agreed +1

Post Reply

Return to “Ideas and Suggestions”