Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local rc = component.br_reactor
- local Me = rc.getEnergyStored()
- local function lvl()
- local en = rc.getEnergyStored()
- pct = (en * 100) / Me
- end
- while true do
- lvl()
- if pct < 20 and rc.getActive() == false then
- rc.setActive(true)
- elseif pct >= 99 and rc.getActive() == true then
- rc.setActive(false)
- end
- os.sleep(3)
- end
Add Comment
Please, Sign In to add comment