Advertisement
Guest User

startup

a guest
Jul 31st, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | None | 0 0
  1. local minimum = 25
  2.  
  3. local maximum = 75
  4.  
  5. while true do
  6.  
  7.   local reactor = peripheral.wrap("BigReactors-Reactor_1")
  8.  
  9.   local display = peripheral.wrap("monitor_0")
  10.  
  11.   local power = reactor.getEnergyStored()
  12.  
  13.   local maxenergy = 10000000
  14.  
  15.   local percent = (power / 10000000) * 100
  16.  
  17.   if percent < minimum then
  18.     reactor.setActive(true)
  19.   elseif percent > maximum then
  20.     reactor.setActive(false)
  21.   end
  22.  
  23.   term.setCursorPos(1,1)
  24.   term.clear()
  25.   display.clear()
  26.   display.setCursorPos(1,1)
  27.  
  28.   print("Reactor Internal Buffer(RF)")
  29.   print(power, "RF")
  30.   print("")
  31.   print("Reactor Internal Buffer(%)")
  32.   print(math.floor(percent), "%")
  33.   print("")
  34.   print("Is This Reactor Currently On?")
  35.   print(reactor.getActive())
  36.  
  37.   display.write("Reactor Internal Buffer(RF)")
  38.   display.setCursorPos(1,2)
  39.   display.write(power, "RF")
  40.   display.setCursorPos(1,4)
  41.  
  42.   display.write("Reactor Internal Buffer(%)")
  43.   display.setCursorPos(1,5)
  44.   display.write(math.floor(percent), "%")
  45.   display.setCursorPos(1,7)
  46.  
  47.   display.write("Is This Reactor Currently On?")
  48.   display.setCursorPos(1,8)
  49.   display.write(reactor.getActive())
  50.  
  51.  
  52.   sleep(0.5)
  53.  
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement