Used same compression on tick to hour/minute

This commit is contained in:
Cooldude2606
2017-03-25 11:04:18 +00:00
parent de5213d601
commit f732e9382d
2 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@@ -41,12 +41,12 @@ end)
---------------------------Common use functions--------------------------------------- ---------------------------Common use functions---------------------------------------
---------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------
function ticktohour (tick) function ticktohour (tick)
local hour = tostring(math.floor(tick * (1 /(60*game.speed)) / 3600)) local hour = tostring(math.floor(tick/(216000*game.speed)))
return hour return hour
end end
function ticktominutes (tick) function ticktominutes (tick)
local minutes = math.floor((tick * (1 /(60*game.speed))) / 60) local minutes = math.floor(tick/(3600*game.speed))
return minutes return minutes
end end
@@ -281,7 +281,7 @@ script.on_event(defines.events.on_rocket_launched, function(event)
end end
end) end)
script.on_event(defines.events.on_tick, function(event) if (game.tick/(3600*game.speed)) % 30 == 0 then autoMessage() end end) script.on_event(defines.events.on_tick, function(event) if (game.tick/(3600*game.speed)) % 2 == 0 then autoMessage() end end)
---------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------
---------------------------IDK What There Do Functions---------------------------------- ---------------------------IDK What There Do Functions----------------------------------
---------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------