Faited

Testing Inventory

May 29th, 2022 (edited)
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. local orechest = peripheral.wrap("minecraft:chest_0")
  2. local targetchest = peripheral.wrap("minecraft:barrel_0")
  3. local needItem = {"minecraft:raw_iron", "create:raw_zinc","minecraft:redstone", "minecraft:lapis_lazuli", "bewitchment:raw_silver", "minecraft:raw_gold", "minecraft:diamond", "minecraft:raw_iron_block"}
  4. local barrelStorage = {"minecraft:barrel_1","minecraft:barrel_2","minecraft:barrel_3","minecraft:barrel_4","minecraft:barrel_5","minecraft:barrel_6",}
  5.  
  6. local function barrelPush()
  7.     for slot, item in pairs(targetchest.list()) do
  8.         for i = 1,6 do
  9.         targetchest.pushItems(barrelStorage[i],slot)
  10.         end
  11.     end
  12. end
  13.  
  14. while true do
  15.  
  16. for slot, item in pairs(orechest.list()) do
  17.     for i = 1,8 do
  18.         if item.name == needItem[i]
  19.         then
  20.         print(("%d x %s in slot %d"):format(item.count, item.name, slot))
  21.         orechest.pushItems("minecraft:barrel_0", slot)
  22.         end
  23.     end
  24. end
  25. barrelPush()
  26.  
  27.  
  28. sleep(20)
  29. end
Add Comment
Please, Sign In to add comment