Wed, 02 Jul 2025 14:28:57 +0300
Add fusion lab (currently v1.2.3)
require("__fusion-lab__.control") local sim_planet = game.surfaces.fulgora local tick = 0 local heat_interfaces = {} for _, ent in pairs(sim_planet.find_entities_filtered{name = 'fusion-lab-heat-interface'}) do table.insert(heat_interfaces, ent) ent.set_heat_setting{temperature=705, mode="exactly"} end -- compatibility for mods that add extra science packs (like nuclear science), -- we just cheat those into the labs to get them running for _, ent in pairs(sim_planet.find_entities_filtered{name = 'fusion-lab'}) do for _, science_pack in pairs(ent.prototype.lab_inputs) do if ent.get_item_count(science_pack) == 0 then ent.insert{name = science_pack, count = prototypes.item[science_pack].stack_size} end end end script.on_nth_tick(1, function() tick = tick + 1 if tick >= 240 then for _, ent in pairs(heat_interfaces) do if math.random() > 0.95 then ent.set_heat_setting{temperature=715, mode="exactly"} end end end end)