Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- maxEnergy = peripheral.call("front", "getMaxEnergy")
- on = true
- while(true) do
- currentEnergy = peripheral.call("front", "getEnergy")
- if(currentEnergy / maxEnergy < 0.1) then
- on = true
- end
- if(currentEnergy / maxEnergy > 0.9) then
- on = false
- end
- if(on) then
- redstone.setAnalogOutput("bottom", 15)
- else
- redstone.setAnalogOutput("bottom", 0)
- end
- os.sleep(5)
- end
Add Comment
Please, Sign In to add comment