toastonrye

Adv Peripherals Inventory Dump v1 Youtube

Jul 10th, 2022 (edited)
2,331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. --dumper program for Youtube
  2. --this was made in v1.18 and the removeItemFromPlayer function changed in 1.20.1
  3. --quick fix here https://pastebin.com/QX4YJYch
  4. --by toastonrye
  5.  
  6. local im = peripheral.find("inventoryManager")
  7. local cb = peripheral.find("chatBox")
  8.  
  9. if im == nil then error("the inventory manager not found") end
  10. if cb == nil then error("chatBox not found") end
  11.  
  12. print("Running dumper")
  13.  
  14. while true do
  15.  
  16.     local e, player, msg = os.pullEvent("chat")
  17.     if msg == "dump" and player == "toastonrye" then
  18.         print("Dumping slots 9 through 26")
  19.         myInv = im.getItems()
  20.         local foo = {}
  21.         for k,v in pairs(myInv) do
  22.             table.insert(foo,k,v.count)  
  23.         end
  24.         for k,v in pairs(foo) do
  25.             if k>=9 and k<=26 then
  26.                 print(k..": "..v)
  27.                 im.removeItemFromPlayer("EAST",v,k)
  28.             end
  29.         end
  30.     end
  31. end
Add Comment
Please, Sign In to add comment