Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reactor = peripheral.wrap("back")
- local storeMin = .6
- local storeMax = .9
- local max = 10000000
- local cooldown = false
- while true do
- os.sleep(1)
- local stored = reactor.getEnergyStored()
- local test = stored/max
- --if reactor has gone over 90% capacity
- if test >= storeMax then
- --check if in cooldown state
- if not cooldown then
- --set to cooldown and turn off
- cooldown = true
- reactor.setActive(false)
- end
- --if reactor is depleated from cooldown
- else
- if test <= storeMin then
- --check if in cooldown
- if cooldown then
- --take out of cooldown
- cooldown = false
- reactor.setActive(true)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement