Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. local component = require("component") --// just a tip. especially if running in the background,
  2. -- if you're not sharing this variable with other programs... localize it..
  3.  
  4. local RF_BUFFER_MAX = 9000000
  5. local RF_BUFFER_MIN = 1000000
  6. local running = true -- set to false to kill the program
  7.  
  8. while running do
  9. -- your code
  10. for _, reactor in pairs(REACTORS) do
  11. if reactor.getEnergyStored() >= RF_BUFFER_MAX then
  12. reactor.setActive(false)
  13. print("Reactor is offline")
  14. else if reactor.getEnergyStored() <=RF_BUFFER_MIN then
  15. reactor.setActive(true)
  16. print("Reactor is online")
  17. end
  18. end -- end for / end your code
  19. end -- end while
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement