SHARE
TWEET

startup

a guest Jan 11th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. term.clear()
  2.  
  3. reactorEnergyCapacity = 10000000
  4.  
  5. maxThreshold = 80
  6.  
  7. minThreshold = 30
  8.  
  9. reactor = peripheral.wrap("BigReactors-Reactor_0")
  10.  
  11. if reactor.getConnected() == false then
  12.   print("Was unable to find valid reactor.")
  13.   os.shutdown()
  14. end
  15. if reactor.getActive() == false then
  16.   print("Reactor Offline...")
  17.   print("Starting Reactor...")
  18.   reactor.setActive(true)
  19. end
  20.  
  21. reactor.setAllControlRodLevels(0)
  22.  
  23. while true do
  24.   energyBufferPercentage = reactor.getEnergyStored() / (reactorEnergyCapacity / 100)
  25.   if energyBufferPercentage > maxThreshold then
  26.     reactor.setAllControlRodLevels(100)
  27.   end
  28.   if energyBufferPercentage < minThreshold then
  29.     reactor.setAllControlRodLevels(0)
  30.   end
  31.   sleep(1)
  32.   reactor.setActive(true)
  33. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top