Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local reactor = component.bc_reactor
- local thread = require("thread")
- local event = require("event")
- local cleanup_thread = thread.create(function()
- event.pull("interrupted")
- print("cleaning up resources")
- end)
- local main_thread = thread.create(function()
- print("Reacteur en control CTRL C pour eteindre")
- while true do
- if reactor.getEnergyStored() < 2500000 then
- reactor.setActive(true)
- end
- if reactor.getEnergyStored > 7500000 then
- reactor.setActive(false)
- end
- end
- end)
- thread.waitForAny({cleanup_thread, main_thread})
- os.exit(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement