Advertisement
Guest User

reactor

a guest
Aug 10th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. local reactor = peripheral.wrap("back")
  2. local monitor = peripheral.wrap("left")
  3.  
  4.  
  5. local action = ""
  6. while action ~= "exit" do
  7.   term.write("[enable|disable|status|setrods]: ")
  8.   action = read()
  9.  
  10.   if action ~= "exit" then
  11.      
  12.      if action == "status" then
  13.      
  14.        term.write("Active: ")
  15.        print(reactor.getActive())
  16.        
  17.        term.write("RF/t: ")
  18.        print(reactor.getEnergyProducedLastTick())
  19.      elseif action == "setrods" then
  20.        term.write("[0-100]: ")
  21.        local newRods = tonumber(read())
  22.        
  23.        reactor.setAllControlRodLevels(newRods)
  24.        term.write("Set Control Rods = ")
  25.        print(newRods)
  26.      elseif action == "enable" then
  27.        reactor.setActive(true)
  28.        print("Reactor activated")
  29.      elseif action == "disable" then
  30.        reactor.setActive(false)
  31.        print("Reactor deactivated")
  32.      end
  33.      
  34.   end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement