Advertisement
Hubnester

Reactor Control

Mar 17th, 2021 (edited)
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. local reactor = peripheral.wrap("back")
  2.  
  3. local str = "Current Insertion: "
  4. term.clear()
  5. term.setCursorPos(1, 1)
  6. term.write(str)
  7.  
  8. while true do
  9. local energyRatio = reactor.battery().stored() / reactor.battery().capacity()
  10. reactor.setAllControlRodLevels(energyRatio * 100)
  11. term.setCursorPos(string.len(str) + 1, 1)
  12. term.write(reactor.getControlRod(0).level())
  13. sleep(0.5 - 0.05) -- Makes it run about 2 times a second (if the server is doing well)
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement