Advertisement
Guest User

Reactor

a guest
Apr 19th, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. local mon = peripheral.wrap('monitor_0')
  2. local r = peripheral.wrap('BigReactors-Reactor_0')
  3. local state = r.getActive()
  4. local stored = r.getEnergyStored()
  5.  
  6. mon.setBackgroundColor(colors.black)
  7. mon.setTextColor(colors.pink)
  8. mon.setCursorPos(1,1)
  9. mon.setTextScale(1)
  10. mon.clear()
  11.  
  12. while 1 do
  13.   mon.clear()
  14.   mon.setCursorPos(1,1)
  15.   mon.setTextColor(colors.pink)
  16.   state = r.getActive()
  17.   stored = r.getEnergyStored()
  18.   if state then
  19.     mon.write('R: ')
  20.     mon.setTextColor(colors.green)
  21.     mon.write('Online')
  22.   else
  23.     mon.write('R: ')
  24.     mon.setTextColor(colors.red)
  25.     mon.write('Offline')
  26.   end
  27.   mon.setCursorPos(1,2)
  28.   mon.setTextColor(colors.pink)
  29.   mon.write('E: ')
  30.   mon.setTextColor(colors.green)
  31.   mon.write(stored)
  32.   mon.setTextColor(colors.pink)
  33.   mon.write(' RF')
  34.   if stored>9000000 then r.setActive(false)
  35.   elseif stored<8000000 then r.setActive(true)
  36.   end
  37.   sleep(1)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement