Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local input = "front"
- local ctrl
- for _, n in pairs(peripheral.getNames()) do
- if peripheral.getType(n) == "nuclearcraft:fission_controller_new" then
- ctrl = n
- end
- end
- while true do
- local manual_control = rs.getInput(input)
- local energy = peripheral.call(ctrl, "getEnergyStored") / peripheral.call(ctrl, "getEnergyCapacity")
- local enable = energy < 0.5 and manual_control
- print(os.date "%H:%M:%S", energy, manual_control, enable)
- rs.setOutput(ctrl, enable)
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement