Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tank = peripheral.wrap("bottom")
- inventory = tank.getTanks()
- modem = peripheral.wrap("top")
- modem.open(200)
- tank.capacity = inventory[1].amount
- tank.amount = inventory[1].capacity
- tank.name = inventory[1].name
- function math.percentProgress(cur_value, maxvalue, decimal)
- cur_value, maxvalue, decimal = tonumber(cur_value), tonumber(maxvalue), decimal or 1
- if (cur_value and maxvalue) then
- local percent = tostring((cur_value/maxvalue)*100)
- return string.format('%'..tostring(decimal)..'f%%', percent)
- end
- return false
- end
- n = math.percentProgress(tank.capacity, tank.amount, 0)
- nn = print(n)
- if nn==20 then
- prbar = "[##========]"
- else
- prbar = "[==========]"
- end
- modem.transmit(200,1,n.." of "..tank.name)
- nn = print(n)
- term.clear()
- while true do
- term.setCursorPos(5,2)
- print(n.." of "..tank.name)
- term.setCursorPos(5,6)
- print(prbar)
- modem.transmit(200,1,n.." of "..tank.name)
- sleep(10)
- end
Add Comment
Please, Sign In to add comment