Added 15 minute auto ranking

This commit is contained in:
Cooldude2606
2017-12-24 22:12:31 +00:00
parent fc73cf0d96
commit 572af853c9

View File

@@ -312,4 +312,23 @@ Event.register(-1,function(event)
end
end)
Event.register(defines.events.on_tick,function(event)
if ((event.tick/(3600*game.speed))+(15/2))% 15 == 0 then
-- this is the system to auto rank players
if not Server or not Server._thread then
for _,player in pairs(game.connected_players) do
Ranking.find_preset(player,tick)
end
else
Server.new_thread{
data={players=game.connected_players}
}:on_event('tick',function(thread)
if #thread.data.players == 0 then thread:close() return end
local player = table.remove(thread.data.players,1)
Ranking.find_preset(player,tick)
end):open()
end
end
end
return Ranking