Advertisement
Guest User

startup

a guest
Mar 31st, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. local r = peripheral.wrap("right")
  2. local max = 9000000
  3. local min = 50000
  4. function Loop()
  5.   while true do
  6.     monitorReactor()
  7.     renderStatus()
  8.     os.sleep(50)
  9.   end
  10. end
  11. function monitorReactor()
  12.     if (r.getActive() == true) then
  13.     if (r.getEnergyStored() >= max) then
  14.       r.setActive(false)
  15.       print("Disabling")
  16.     end
  17.   else
  18.     if (r.getEnergyStored() <= min) then
  19.       r.setActive(true)
  20.       print("Enabling")
  21.     end
  22.   end
  23. end
  24.  
  25. function renderStatus()
  26.  
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement