Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reactor = component.ns_fusion_reactor
- local hit_threshold = false
- local function check()
- local efficiency = reactor.getEfficiency()
- print("Efficiency: " .. tostring(efficiency))
- if reactor.isProcessing() then
- if efficiency > 0.95 then
- print("Deactivating")
- reactor.deactivate()
- hit_threshold = true
- end
- else
- if hit_threshold then
- if efficiency < 0.9 then
- print("Activating")
- reactor.activate()
- hit_threshold = false
- end
- end
- end
- end
- local function start()
- while true do
- if reactor.isHotEnough() then
- print("Starting")
- reactor.activate()
- return
- end
- os.sleep(1)
- end
- end
- start()
- while true do
- os.sleep(1)
- check()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement