mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-18 03:21:47 +02:00
commit
2517dea439
@ -6,6 +6,28 @@ function bot_command_players(filename)
|
||||
end
|
||||
end
|
||||
|
||||
function bot_command_time()
|
||||
game.print(math.floor(game.tick / 60))
|
||||
function bot_command_time(filename)
|
||||
local s = math.floor(game.tick/60)
|
||||
local m = math.floor(s/60)
|
||||
local h = math.floor(m/60)
|
||||
local d = math.floor(h/24)
|
||||
|
||||
s = s % 60
|
||||
m = m % 60
|
||||
h = h % 24
|
||||
if d == 0 then
|
||||
d = ""
|
||||
if h == 0 then
|
||||
h = ""
|
||||
if m == 0 then
|
||||
m = ""
|
||||
end
|
||||
end
|
||||
else
|
||||
d = string.format("%s days ", d)
|
||||
end
|
||||
|
||||
if m ~= "" then m = string.format("%s minutes ", m) end
|
||||
if h ~= "" then h = string.format("%s hours ", h) end
|
||||
game.write_file(filename,string.format("%s%s%s%s seconds", d, h, m, s), false,0)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user