mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Rank control clean
This commit is contained in:
19
control.lua
19
control.lua
@@ -5,25 +5,14 @@ This file can be used with permission but this and the credit below must remain
|
||||
Contact a member of management on our discord to seek permission to use our code.
|
||||
Any changes that you may make to the code are yours but that does not make the script yours.
|
||||
Discord: https://discord.gg/XSsBV6b
|
||||
|
||||
The credit below may be used by another script - do not remove.
|
||||
]]
|
||||
local credits = {{
|
||||
name='Control',
|
||||
owner='Explosive Gaming',
|
||||
dev='Cooldude2606',
|
||||
description='Core Factorio File',
|
||||
factorio_version='0.15.23',
|
||||
show=false
|
||||
}}
|
||||
local function credit_loop(reg) for _,cred in pairs(reg) do table.insert(credits,cred) end end
|
||||
--Please Only Edit Below This Line-----------------------------------------------------------
|
||||
--set up to run other code and events
|
||||
require("mod-gui")
|
||||
credit_loop(require("locale/StdLib/event"))
|
||||
require("locale/StdLib/event")
|
||||
--this is the main code that starts the softmod
|
||||
Event.soft_init = script.generate_event_name()
|
||||
local function init() if not global.soft_init then script.raise_event(Event.soft_init,{tick=game.tick}) global.soft_init = true global.credits = credits end end
|
||||
local function init() if not global.soft_init then script.raise_event(Event.soft_init,{tick=game.tick}) global.soft_init = true end end
|
||||
Event.register(defines.events.on_player_joined_game,init)
|
||||
Event.register(defines.events.on_tick,init)
|
||||
--below 'game.tick/(3600*game.speed)) % 15 == 0' raises the gui_update event every 15 minutes - feel free to change the update time
|
||||
@@ -38,9 +27,9 @@ Event.register(defines.events.on_tick, function(event)
|
||||
elseif ((event.tick/(3600*game.speed))+(15/2))% 15 == 0 then
|
||||
-- this is the system to auto rank players
|
||||
for i,player in pairs(game.connected_players) do
|
||||
sudo(find_new_rank,{player,event.tick})
|
||||
sudo(ranking.find_new_rank,{player,event.tick})
|
||||
end
|
||||
end
|
||||
end)
|
||||
--loads all the other scripts
|
||||
credit_loop(require("locale/file-header"))
|
||||
require("locale/file-header")
|
||||
Reference in New Issue
Block a user