Advertisement
chand1012

Reactor Auto Shutoff

Aug 26th, 2018
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.28 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement