Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- r = peripheral.wrap("back")
- while true do
- if r.getActive() == false then
- if r.getFuelAmount() > 189000 and redstone.getInput("left") == false then
- r.setActive(true)
- print("Setting reactor to active.")
- else
- print("Reactor not active, skipping.")
- sleep(10)
- end
- elseif r.getActive() == true then
- print("Reactor is active.")
- insertion = 100 - (math.floor((7000000 - r.getEnergyStored()) / 70000))
- if insertion > 100 then
- insertion = 100
- end
- print("Setting control rod levels to " .. insertion)
- print("There is currently " .. r.getEnergyStored() .. "RF in the reactor buffer")
- r.setAllControlRodLevels(insertion)
- if r.getFuelAmount() < 180000 and redstone.getInput("left") == false then
- r.setActive(false)
- print("Deactivating reactor (fuel levels low)")
- end
- sleep(1.5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement