Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local out = "right"
- local message = "Cell not detected, checking again in 30 seconds"
- local cell = peripheral.wrap("top")
- local CellStored = cell.getEnergyStored("top")
- local CellFull = cell.getMaxEnergyStored("top")
- local cellPercent = math.floor(100*CellStored/CellFull)
- while true do
- if cell == true then
- print(tonumber(CellStored).."/"..CellFull.." "..cellPercent.."%")
- if CellStored == CellFull then
- rs.setoutput(out, true)
- sleep(1)
- rs.setoutput(out, false)
- else
- sleep(5)
- end
- else
- print(message)
- sleep(30)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement