From f387500d505fb5da4916bbcd5035263c690cea69 Mon Sep 17 00:00:00 2001 From: Nicholas Gower Date: Sun, 5 Jul 2026 22:30:48 -0700 Subject: [PATCH] perf: Replaced on_tick event with on_nth_tick(60) event, improving performance by factor of 30 on idle and by factor of 10 when gui is open. --- control.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/control.lua b/control.lua index 14a094a..0c54736 100644 --- a/control.lua +++ b/control.lua @@ -692,11 +692,11 @@ script.on_event(defines.events.on_gui_click, function(event) end end) -script.on_event(defines.events.on_tick, function(event) +script.on_nth_tick(60, function(event) for _, player in pairs(game.players) do local player_global = get_player_global(player.index) if player_global then - update_ui(player_global, event.tick % 60 == 0) + update_ui(player_global, true) end end end)