Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- b = peripheral.wrap("left")
- r = peripheral.wrap("back")
- m = peripheral.wrap("top")
- while true do
- cur = b.getEnergyStored("top")
- max = b.getMaxEnergyStored("top")
- perc = cur / max * 100
- if perc > 95 then
- r.setActive(false)
- end
- if perc < 70 then
- r.setActive(true)
- end
- if perc < 30 then
- rs.setOutput("bottom",true)
- end
- if perc > 30 then
- rs.setOutput("bottom",false)
- end
- newperc = string.sub(tostring(perc),0,4)
- m.clear()
- m.setCursorPos(2,3)
- m.write(newperc.."%")
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement