My questions are:
- Does the below code snippet actually work (correctly)?
- Is there a better way (or is it "good enough")?
Code: Select all
local update_interval = 61
script.on_event(defines.events.on_tick, function(event)
local offset = event.tick % update_interval
-- code were "table" is defined; basically a table of entities this mod added that all players have built, so can range from empty to positive x 10s, 100s, 1000s, etc of elements.
for i=#table - offset, 1, -1 * update_interval do
-- code working with table
end
-- other code
end)