Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --the total size of the buffer
- local TOTAL_MAX = 10000000
- --Buffer zone size
- local BUFFER_SIZE = 4000000
- --connect to reactor
- local reactor = peripheral.wrap("back")
- --confirm connection
- if(not reactor.getConnected) then
- print("Not connected to Reactor")
- end
- --turn the reactor on
- if(not reactor.getActive()) then
- reactor.setActive(true)
- print("Starting Reactor")
- end
- --move control rod to defaul level
- reactor.setAllControlRodLevels(0)
- while(true) do
- local currentEnergy = reactor.getEnergyStored()
- if (currentEnergy < BUFFER_SIZE) then
- reactor.setActive(true)
- elseif (currentEnergy > (TOTAL_MAX - BUFFER_SIZE) ) then
- reactor.setActive(false)
- end
- sleep(2)
- end
Add Comment
Please, Sign In to add comment