Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- i = 201
- tank = peripheral.wrap("bottom")
- inventory = tank.getTanks()
- modem = peripheral.wrap("top")
- modem.open(i)
- tank.amount = inventory[1].amount
- tank.capacity = inventory[1].capacity
- tank.name = inventory[1].name
- nn = ((tank.amount/tank.capacity)*100)
- if nn<=10 then
- prbar = "[#=========]"
- elseif nn<=20 then
- prbar = "[##========]"
- elseif nn<=30 then
- prbar = "[###=======]"
- elseif nn<=40 then
- prbar = "[####======]"
- elseif nn<=50 then
- prbar = "[#####=====]"
- elseif nn<=60 then
- prbar = "[######====]"
- elseif nn<=70 then
- prbar = "[#######===]"
- elseif nn<=80 then
- prbar = "[########==]"
- elseif nn<=90 then
- prbar = "[#########=]"
- else
- prbar = "[##########]"
- end
- term.clear
- term.setCursorPos(1,2)
- print(prbar.." "..nn.."% / 100%".." "..term.setTextColor(colors.green)..tank.name)
- modem.transmit(i,1,prbar.." "..nn.."/100%".." "..tank.name)
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment