Advertisement
jdroid91

chestSort2

Dec 12th, 2023 (edited)
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.92 KB | None | 0 0
  1. local blocksAndChests = {
  2.     {"minecraft:chest_4", "minecraft:dirt"},
  3.     {"minecraft:chest_5", "minecraft:cobblestone"},
  4.     {"minecraft:chest_6", "minecraft:paper"},
  5.     {"minecraft:chest_7", "minecraft:wheat_seeds"},
  6.     {"minecraft:chest_8", "minecraft:cobbled_deepslate"},
  7.     {"minecraft:chest_9", "minecraft:deepslate"},
  8.     {"minecraft:chest_10", "minecraft:cherry_log"},
  9.     {"minecraft:chest_11", "minecraft:cherry_planks"},
  10.     {"minecraft:chest_12", "minecraft:bone"},
  11.     {"minecraft:chest_13", "minecraft:rotten_flesh"},
  12.     {"minecraft:chest_14", "minecraft:gold_ingot"},
  13.     {"minecraft:chest_15", "minecraft:iron_ingot"},
  14.     {"minecraft:chest_16", "minecraft:lapis_lazuli"},
  15.     {"minecraft:chest_17", "minecraft:redstone"},
  16.     {"minecraft:chest_18", "minecraft:white_wool"},
  17.     {"minecraft:chest_19", "minecraft:kelp"},
  18.     {"minecraft:chest_20", "minecraft:tuff"},
  19.     {"minecraft:chest_21", "minecraft:gravel"},
  20.     {"minecraft:chest_22", "minecraft:string"},
  21.     {"minecraft:chest_23", "minecraft:stick"},
  22.     {"minecraft:chest_24", "minecraft:spider_eye"},
  23.     {"minecraft:chest_25", "minecraft:quartz"},
  24.     {"minecraft:chest_26", "minecraft:gunpowder"},
  25.     {"minecraft:chest_27", "minecraft:blaze_rod"},
  26.     {"minecraft:chest_33", "minecraft:sand"},
  27.     {"minecraft:chest_34", "minecraft:netherrack"},
  28.     {"minecraft:chest_35", "minecraft:carrot"},
  29.     {"minecraft:chest_36", "minecraft:sugar_cane"},
  30.     {"minecraft:chest_37", "minecraft:beef"},
  31.     {"minecraft:chest_38", "minecraft:clay_ball"},
  32.     {"minecraft:chest_44", "minecraft:ender_pearl"},
  33.     {"minecraft:chest_45", "minecraft:leather"},
  34.     {"minecraft:chest_46", "minecraft:cod"},
  35.     {"minecraft:chest_47", "minecraft:salmon"},
  36.     {"minecraft:chest_48", "minecraft:cherry_sapling"},
  37.     {"minecraft:chest_49", "minecraft:oak_planks"},
  38.     {"minecraft:chest_50", "minecraft:glass_bottle"},
  39.     {"minecraft:chest_51", "minecraft:glass_pane"},
  40.     {"minecraft:chest_52", "minecraft:cherry_logs"},
  41.     {"minecraft:chest_53", "minecraft:tropical_fish"},
  42.     {"minecraft:chest_54", "minecraft:charcoal"},
  43.     {"minecraft:chest_55", "minecraft:obsidian"},
  44.     {"minecraft:chest_108", "minecraft:chorus_fruit"},
  45.     {"minecraft:chest_109", "minecraft:glowstone"},
  46.     {"minecraft:chest_110", "minecraft:gold_nugget"},
  47.     {"minecraft:chest_111", "minecraft:ender_eye"}
  48. }
  49.  
  50. local topChest = peripheral.wrap("ironchest:crystal_chest_3")
  51.  
  52. while (true)
  53. do
  54.     index = 1
  55.     while (index <= topChest.size())
  56.     do
  57.         itemDetail = topChest.getItemDetail(index)
  58.         if (itemDetail ~= nil)
  59.         then
  60.             index2 = 1
  61.             while (index2 <= #blocksAndChests)
  62.             do
  63.                if (itemDetail.name == blocksAndChests[index2][2])
  64.                then
  65.                     topChest.pushItems(blocksAndChests[index2][1], index)
  66.                     break
  67.                end
  68.                index2 = index2 + 1
  69.             end
  70.         end
  71.         index = index + 1
  72.     end
  73.     os.sleep(0.5)
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement