CreeperNukeBoom

Weird double counting of inventory. [solved]

Dec 5th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. local chest=peripheral.wrap("back")
  2. local count=0
  3. local list={}
  4. --print(chest.listMethods())
  5. for c= 1,27 do
  6.   if chest.getStackInSlot(c) then
  7.     for i,v in pairs(chest.getStackInSlot(c)) do
  8.       list[i]=v
  9.     end
  10.     if list["display_name"]=="Iron Ingot" then
  11.       count=count+tonumber(list["qty"])
  12.       print(list["qty"])
  13.     end
  14.   end
  15. end
  16. print("payment detected: "..count)
Add Comment
Please, Sign In to add comment