chand1012

Reactor Auto Shutoff

Aug 26th, 2018
69
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local reactor = peripheral.wrap("back")
  2. while true do
  3.     local energy = reactor.getEnergyStored()
  4.     local state = reactor.getActive()
  5.     if state==true and energy>=9500000 then
  6.         reactor.setActive(false)
  7.     elseif state==false and energy<=100000 then
  8.         reactor.setActive(true)
  9.     end
  10.    
  11. end
RAW Paste Data