Advertisement
rungholt

invtest

Aug 5th, 2023 (edited)
1,271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local chest = peripheral.find("sc-goodies:diamond_chest")
  2. local total = 0
  3. local itemDetail = chest.getItemDetail(1)
  4.  
  5. for slot, item in pairs(chest.list()) do
  6.   print(("%d x %s in slot %d"):format(item.count, item.name, slot))
  7. end
  8. print(chest.size())
  9. for i = 1, chest.size() do
  10.     total = total + chest.getItemLimit(i)
  11. end
  12. print("Free:", (total))
  13.  
  14. if not itemDetail then print("No item") return end
  15.  
  16. print(("%s (%s)"):format(itemDetail.displayName, itemDetail.name))
  17. print(("Count: %d/%d"):format(itemDetail.count, itemDetail.maxCount))
  18.  
  19. if itemDetail.damage then
  20.   print(("Damage: %d/%d"):format(itemDetail.damage, itemDetail.maxDamage))
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement