Advertisement
Guest User

essai

a guest
Jul 30th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.33 KB | None | 0 0
  1. p = peripheral.wrap("back")
  2. m = peripheral.wrap("top")
  3. p.condenseItems()
  4. maxS = p.getInventorySize()
  5. print(maxS)
  6. qty2 = 0
  7.  
  8. for i=1,maxS do
  9.  
  10. chest = p.getStackInSlot(i)
  11. if chest then
  12.   itemqty = chest.qty
  13.   print(itemqty)
  14.   qty2 = qty2 + itemqty
  15.   print(qty2)
  16. end
  17.  
  18. end
  19.  
  20. m.clear()
  21. m.setCursorPos(1,3)
  22. m.write(qty2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement