Advertisement
markman4897

TankStatus

Apr 9th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. tank = peripheral.wrap('back')
  2.  
  3. function printTankInfo()
  4.     tankInfo = tank.getTankInfo()
  5.     contents = tankInfo[1].contents
  6.  
  7.     print('Capacity: '..tankInfo[1].capacity)
  8.     if contents then
  9.         print('Name:'..contents.name)
  10.         print('Raw Name: '..contents.rawName)
  11.         print('Amount: '..contents.amount)
  12.     else
  13.         print('The tank is empty.')
  14.     end
  15. end
  16.  
  17. printTankInfo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement