Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ball = peripheral.wrap("back")
- maxE = ball.getMaxEnergyStored()
- function update()
- local dumping = false
- while true do
- pct = ball.getEnergyStored() * 100 / maxE
- print("Power: " .. pct .. "%")
- if pct >= 90 then
- dumping = true
- end
- if pct < 50 and dumping then
- dumping = false
- end
- if dumping then
- redstone.setAnalogOutput("left", 1)
- else
- redstone.setAnalogOutput("left", 0)
- end
- sleep(5)
- end
- end
- parallel.waitForAny(update)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement