switch72

Untitled

Apr 17th, 2020
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. reactor = null
  2.  
  3.  
  4. function initPeripherals()
  5. local perList = peripheral.getNames()
  6.  
  7. reactorNumber = 1
  8. monitorFound = false
  9. for i=1,#perList,1 do
  10. if peripheral.getType(perList[i]) == "BigReactors-Reactor" then
  11. reactor = peripheral.wrap(perList[i])
  12. end
  13. end
  14. end
  15.  
  16.  
  17. initPeripherals()
  18.  
  19. print("Reactor Energy Buffer Management Program")
  20. print("This program targets an energy buffer level")
  21. print("between 1% and 99%")
  22.  
  23. while true do
  24. if reactor.getEnergyStored() / reactor.getEnergyCapacity() > .98 then
  25. reactor.setActive(false)
  26. end
  27. if reactor.getEnergyStored() / reactor.getEnergyCapacity() < .05 then
  28. reactor.setActive(true)
  29. end
  30. sleep(3)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment