sviridovt

Untitled

Mar 25th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tank = peripheral.wrap('bottom')
  2.  
  3. monitor = peripheral.wrap('back')
  4. monitor.clear()
  5.  
  6. term.redirect(monitor)
  7. term.clear()
  8. term.setBackgroundColor(colors.black)
  9. term.setCursorPos(3, 1)
  10. term.write("Tank Monitoring System")
  11.  
  12. term.setCursorPos(3, 3)
  13. term.write("Liquid:")
  14.  
  15. term.setCursorPos(3, 5)
  16. term.write("Amount:")
  17.  
  18. term.setCursorPos(3, 7)
  19. term.write("Capacity:")
  20.  
  21. while true do
  22.  
  23.   term.setCursorPos(15, 3)
  24.   term.write(tank.getTankInfo()[1].contents.rawName)
  25.  
  26.   term.setCursorPos(15, 5)
  27.   term.write(tank.getTankInfo()[1].contents.amount)
  28.  
  29.   term.setCursorPos(15, 7)
  30.   term.write(tank.getTankInfo()[1].capacity)
  31.  
  32.   percent = tank.getTankInfo()[1].contents.amount / tank.getTankInfo()[1].capacity * 45
  33.  
  34.   paintutils.drawBox(3, 9, 48, 10, colors.red)
  35.   paintutils.drawBox(3, 9, 3 + percent, 10, colors.green)
  36.   term.setBackgroundColor(colors.black)
  37.  
  38. end
Add Comment
Please, Sign In to add comment