Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("back")
- modem.open(1)
- local source = peripheral.getNames()
- while true do
- local sourceChests = {}
- local targetChests = {}
- for _, name in ipairs(source) do
- if string.match(name, "minecraft:chest") then
- table.insert(sourceChests, peripheral.wrap(name))
- elseif string.match(name, "techreborn:recycler") then
- table.insert(targetChests, peripheral.wrap(name))
- end
- end
- for _, sourceChest in ipairs(sourceChests) do
- for _, targetChest in ipairs(targetChests) do
- local targetName = peripheral.getName(targetChest)
- for slot, item in pairs(sourceChest.list()) do
- sourceChest.pushItems(targetName, slot, item.count, 1)
- end
- end
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement