BigGamingGamers

Untitled

Nov 13th, 2020 (edited)
2,336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. local SLOT_COUNT = 16
  2.  
  3.  
  4. function getCountOfItem(name)
  5. count = 0
  6. for i = 1, SLOT_COUNT, 1 do
  7. d = turtle.getItemDetail()
  8. if(d ~= nil) then
  9. if(d['name'] == name) then
  10. count = count + d['count']
  11. end
  12. end
  13. end
  14.  
  15. return count
  16. end
  17.  
  18. x = getCountOfItem('minecraft:bamboo')
  19. print(x)
Add Comment
Please, Sign In to add comment