Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reactor = peripheral.wrap('right')
- local minTreshold = 20
- local maxTreshold = 90
- local bufferSize = 10000000
- while(true) do
- local percentage = ((reactor.getEnergyStored() / bufferSize) * 100)
- if(percentage <= minTreshold) then
- reactor.setActive(true)
- print('The reactor started !')
- elseif(percentage >= maxTreshold) then
- reactor.setActive(false)
- print('The reactor stopped !')
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement