Advertisement
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 FAM = rc.getFuelAmount()
- local function nv()
- local FM = rc.getFuelAmount()
- ptt = (FM * 100) / FAM
- end
- while true do
- nv()
- if ptt < 50 then
- rc.setActive(false)
- elseif ptt >= 51 then
- rc.setActive(true)
- end
- os.sleep(1)
- 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
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement