Justiik

Untitled

Oct 26th, 2021 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. while true do
  2. i = 201
  3. tank = peripheral.wrap("bottom")
  4. inventory = tank.getTanks()
  5. modem = peripheral.wrap("top")
  6. modem.open(i)
  7.  
  8.  
  9. tank.amount = inventory[1].amount
  10. tank.capacity = inventory[1].capacity
  11. tank.name = inventory[1].name
  12.  
  13. nn = ((tank.amount/tank.capacity)*100)
  14.  
  15. if nn<=10 then
  16. prbar = "[#=========]"
  17.  
  18. elseif nn<=20 then
  19. prbar = "[##========]"
  20.  
  21. elseif nn<=30 then
  22. prbar = "[###=======]"
  23.  
  24. elseif nn<=40 then
  25. prbar = "[####======]"
  26.  
  27. elseif nn<=50 then
  28. prbar = "[#####=====]"
  29.  
  30. elseif nn<=60 then
  31. prbar = "[######====]"
  32.  
  33. elseif nn<=70 then
  34. prbar = "[#######===]"
  35.  
  36. elseif nn<=80 then
  37. prbar = "[########==]"
  38.  
  39. elseif nn<=90 then
  40. prbar = "[#########=]"
  41.  
  42. else
  43. prbar = "[##########]"
  44. end
  45.  
  46. term.clear
  47. term.setCursorPos(1,2)
  48. print(prbar.." "..nn.."% / 100%".." "..term.setTextColor(colors.green)..tank.name)
  49.  
  50. modem.transmit(i,1,prbar.." "..nn.."/100%".." "..tank.name)
  51. sleep(1)
  52. end
Advertisement
Add Comment
Please, Sign In to add comment