Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p_min
- p_min = 10
- local p_max
- p_max = 90
- local r
- r = peripheral.wrap("back")
- print(r.getConnected())
- max_fuel = 10000000
- max = max_fuel/100*p_max
- min = max_fuel/100*p_min
- -- Bucle principal
- while true do
- state = r.getActive()
- if r.getEnergyStored() >= max and state == true then
- r.setActive(false)
- print("Apagat")
- elseif r.getEnergyStored() <= min and state == false then
- r.setActive(true)
- print("Ences")
- end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement