Cowz

Untitled

Dec 6th, 2020 (edited)
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local generating = false
  2.  
  3. while true do
  4.  
  5.     local reactor = peripheral.wrap("BigReactors-Reactor_2")
  6.     local bat = peripheral.wrap("Induction Matrix_1")
  7.     local mon = peripheral.wrap("top")
  8.     mon.clear()
  9.     mon.setCursorPos(1,1)
  10.     if reactor.getActive() == true then
  11.         mon.write("Reactor Activated.")
  12.     else
  13.         mon.write("Reactor Deactivated.")
  14.     end
  15.    
  16.     mon.setCursorPos(1,2)
  17.     mon.write("RF/t:"..string.format(math.floor(bat.getInput())))
  18.    
  19.     mon.setCursorPos(1,3)
  20.     mon.write("CONTROL ROD STATISTICS:")
  21.    
  22.     mon.setCursorPos(1,4)
  23.     mon.write("Control Rods Insertion: ".. math.floor(reactor.getControlRodLevel(0)).."%")
  24.    
  25.     mon.setCursorPos(1,6)
  26.     local targetRodPosition = (bat.getEnergy() / bat.getMaxEnergy()) * 100
  27.     mon.write("Target Rod Position: ".. math.floor(targetRodPosition).."%")
  28.    
  29.     mon.setCursorPos(1,7)
  30.     if targetRodPosition > reactor.getControlRodLevel(0) then
  31.         reactor.setAllControlRodLevels(reactor.getControlRodLevel(0) + 1)
  32.     end
  33.    
  34.     if targetRodPosition < reactor.getControlRodLevel(0) then
  35.         reactor.setAllControlRodLevels(reactor.getControlRodLevel(0) - 1)
  36.     end
  37.    
  38.     sleep(0.25)
  39.    
  40. end
Add Comment
Please, Sign In to add comment