Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local blocksAndChests = {
- {"minecraft:chest_4", "minecraft:dirt"},
- {"minecraft:chest_5", "minecraft:cobblestone"},
- {"minecraft:chest_6", "minecraft:paper"},
- {"minecraft:chest_7", "minecraft:wheat_seeds"},
- {"minecraft:chest_8", "minecraft:cobbled_deepslate"},
- {"minecraft:chest_9", "minecraft:deepslate"},
- {"minecraft:chest_10", "minecraft:cherry_log"},
- {"minecraft:chest_11", "minecraft:cherry_planks"},
- {"minecraft:chest_12", "minecraft:bone"},
- {"minecraft:chest_13", "minecraft:rotten_flesh"},
- {"minecraft:chest_14", "minecraft:gold_ingot"},
- {"minecraft:chest_15", "minecraft:iron_ingot"},
- {"minecraft:chest_16", "minecraft:lapis_lazuli"},
- {"minecraft:chest_17", "minecraft:redstone"},
- {"minecraft:chest_18", "minecraft:white_wool"},
- {"minecraft:chest_19", "minecraft:kelp"},
- {"minecraft:chest_20", "minecraft:tuff"},
- {"minecraft:chest_21", "minecraft:gravel"},
- {"minecraft:chest_22", "minecraft:string"},
- {"minecraft:chest_23", "minecraft:stick"},
- {"minecraft:chest_24", "minecraft:spider_eye"},
- {"minecraft:chest_25", "minecraft:quartz"},
- {"minecraft:chest_26", "minecraft:gunpowder"},
- {"minecraft:chest_27", "minecraft:blaze_rod"},
- {"minecraft:chest_33", "minecraft:sand"},
- {"minecraft:chest_34", "minecraft:netherrack"},
- {"minecraft:chest_35", "minecraft:carrot"},
- {"minecraft:chest_36", "minecraft:sugar_cane"},
- {"minecraft:chest_37", "minecraft:beef"},
- {"minecraft:chest_38", "minecraft:clay_ball"},
- {"minecraft:chest_44", "minecraft:ender_pearl"},
- {"minecraft:chest_45", "minecraft:leather"},
- {"minecraft:chest_46", "minecraft:cod"},
- {"minecraft:chest_47", "minecraft:salmon"},
- {"minecraft:chest_48", "minecraft:cherry_sapling"},
- {"minecraft:chest_49", "minecraft:oak_planks"},
- {"minecraft:chest_50", "minecraft:glass_bottle"},
- {"minecraft:chest_51", "minecraft:glass_pane"},
- {"minecraft:chest_52", "minecraft:cherry_logs"},
- {"minecraft:chest_53", "minecraft:tropical_fish"},
- {"minecraft:chest_54", "minecraft:charcoal"},
- {"minecraft:chest_55", "minecraft:obsidian"},
- {"minecraft:chest_108", "minecraft:chorus_fruit"},
- {"minecraft:chest_109", "minecraft:glowstone"},
- {"minecraft:chest_110", "minecraft:gold_nugget"},
- {"minecraft:chest_111", "minecraft:ender_eye"}
- }
- local topChest = peripheral.wrap("ironchest:crystal_chest_4")
- while (true)
- do
- print("What do you want?")
- desiredItem = "minecraft:"..io.read()
- index = 1
- while (index <= #blocksAndChests)
- do
- if (blocksAndChests[index][2] == desiredItem)
- then
- goalChest = peripheral.wrap(blocksAndChests[index][1])
- index2 = 1
- while (index2 < goalChest.size())
- do
- itemDetail = goalChest.getItemDetail(index2)
- if (itemDetail ~= nil)
- then
- goalChest.pushItems(peripheral.getName(topChest), index2)
- break
- end
- index2 = index2 + 1
- end
- end
- index = index + 1
- end
- print("Sent: "..desiredItem)
- os.sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement