Jo__2001__Bo

startup

Mar 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.72 KB | None | 0 0
  1. function activate()
  2.   local reactor = peripheral.wrap("<Put Reactor name here>")
  3.   reactor.setActive(true)
  4. end
  5.  
  6. function deactivate()
  7.   local reactor = peripheral.wrap("<Put Reactor name here>")
  8.   reactor.setActive(false)
  9. end
  10.  
  11. function reactorControl()
  12.   local reactor = peripheral.wrap("<Put Reactor name here>")
  13.   local currentRfStored = reactor.getEnergyStored(w)
  14.  
  15.   if currentRfStored <= 5000000 then activate()
  16.   end
  17.  
  18.   if currentRfStored >= 8000000 then deactivate()
  19.   end
  20. end
  21.  
  22. while true do
  23.   local reactor1 = peripheral.wrap("<Put Reactor name here>")
  24.   local mon = peripheral.wrap("<Put Monitor name here>")
  25.   mon.clear()
  26.  
  27.   -- Begin Reactor 1
  28.   --mon.setCursorPos(1,1)
  29.   --mon.setTextColor(colors.white)
  30.   --mon.write("Reactor #: ")
  31.   --mon.setTextColor(colors.lime)
  32.   --mon.write("1")
  33.  
  34.   mon.setCursorPos(1,1)
  35.   mon.setTextColor(colors.white)
  36.   mon.write("Active: ")
  37.   mon.setTextColor(colors.lime)
  38.   mon.write(reactor1.getActive())
  39.    
  40.   mon.setCursorPos(1,2)
  41.   mon.setTextColor(colors.white)
  42.   mon.write("RF/T: ")  
  43.   mon.setTextColor(colors.lime)
  44.   mon.write(math.floor(reactor1.getEnergyProducedLastTick()))
  45.  
  46.   mon.setCursorPos(1,3)
  47.   mon.setTextColor(colors.white)
  48.   mon.write("RF Stored: ")
  49.   mon.setTextColor(colors.lime)
  50.   mon.write(math.floor(reactor1.getEnergyStored()))
  51.  
  52.   mon.setCursorPos(1,4)
  53.   mon.setTextColor(colors.white)
  54.   mon.write("Casing Heat: ")
  55.   mon.setTextColor(colors.lime)
  56.   mon.write(math.floor(reactor1.getCasingTemperature()))
  57.  
  58.   mon.setCursorPos(1,5)
  59.   mon.setTextColor(colors.white)
  60.   mon.write("Fuel Heat: ")
  61.   mon.setTextColor(colors.lime)
  62.   mon.write(math.floor(reactor1.getFuelTemperature()))
  63.   -- End Reactor 1
  64.   reactorControl()
  65.    sleep(2)
  66. end
Add Comment
Please, Sign In to add comment