Advertisement
Guest User

test

a guest
May 26th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. while true do
  2.   local reactor1 = peripheral.wrap("BigReactors-Reactor_0")
  3.   local cell1 = peripheral.wrap("powered_tile_0")
  4.   local mon1 = peripheral.wrap("monitor_0")
  5.   local low = 8000000
  6.   local high = 9900000
  7.   mon1.clear()
  8.  
  9.   --Begin query
  10.   --Reactor 1 - ME Reactor
  11.   if cell1.getEnergyStored() <= low then
  12.     reactor1.setActive(true)
  13.   end
  14.    
  15.   if cell1.getEnergyStored() >= high then
  16.     reactor1.setActive(false)
  17.   end
  18.  
  19.   mon1.setCursorPos(1,1)
  20.   mon1.setTextColor(colors.red)
  21.   mon1.write("ME Reactor")
  22.  
  23.   mon1.setCursorPos(1,2)
  24.   mon1.setTextColor(colors.white)
  25.   mon1.write("Active: ")
  26.   mon1.setTextColor(colors.lime)
  27.   mon1.write(reactor1.getActive())
  28.  
  29.   mon1.setCursorPos(1,3)
  30.   mon1.setTextColor(colors.white)
  31.   mon1.write("RF/T: ")
  32.   mon1.setTextColor(colors.lime)
  33.   mon1.write((math.floor(reactor1.getEnergyProducedLastTick())) / 1000000)
  34.  
  35.   mon1.setCursorPos(1,4)
  36.   mon1.setTextColor(colors.white)
  37.   mon1.write("RF Stored: ")
  38.   mon1.setTextColor(colors.lime)
  39.   mon1.write((math.floor(reactor1.getEnergyStored())) / 1000000)
  40.  
  41.  
  42.   mon1.setCursorPos(1,5)
  43.   mon1.setTextColor(colors.red)
  44.   mon1.write("Cell 1")
  45.  
  46.   mon1.setCursorPos(1,6)
  47.   mon1.setTextColor(colors.white)
  48.   mon1.write("RF: ")
  49.   mon1.setTextColor(colors.lime)
  50.   mon1.write((math.floor(cell1.getEnergyStored())) / 1000000)
  51.    
  52.  
  53.   sleep(5)
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement