Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local names = peripheral.getNames()
- if names ~= nil then
- local chests = {}
- for _, name in ipairs(names) do
- local wrapped = peripheral.wrap(name)
- if wrapped.getTransferLocations then
- chests[name] = wrapped
- end
- end
- for _, chest in ipairs(chests) do
- for slot,_ in ipairs(chest.list()) do
- local itemName = chest[slot].name
- if itemName == "minecraft:coal" or itemName == "minecraft:planks" or itemName == "minecraft:log" then
- local target = chest.getTransferLocations()
- for i, v in ipairs(target) do
- if v:match("^turtle") then
- target = v
- break
- end
- end
- chest.pushItem(target, slot)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement