Advertisement
Skortioth

[CC]: Extreme Reactor - Simple Reactor Energy Controller

Jul 4th, 2020 (edited)
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. --This works with the Extreme Reactors Reactor & Turbine. Just set the amount at wich the reactor should turn on/off
  2. local side = "back" -- the computer side where the computer is connected to the reactor or turbine (left/right/back/front/up/down)
  3. local energyAmountToStop = 800000 -- Amount for stopping the reactor
  4. local energyAmountToStart = 100000 -- Amount for starting the reactor
  5.  
  6. local turbine = peripheral.wrap(side)
  7.  
  8. while true do
  9.     if(turbine.getEnergyStored() >= energyAmountToStop)then
  10.         turbine.setActive(false)
  11.     end
  12.     if(turbine.getEnergyStored() <= energyAmountToStart)then
  13.         turbine.setActive(true)
  14.     end
  15.     os.sleep(0.25)
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement