Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("left")
- modem.open(1)
- local source = peripheral.getNames()
- while true do
- local sourceChests = {}
- local targetChests = {}
- for _, name in ipairs(source) do
- if string.match(name, "sophisticatedstorage:chest_") then
- table.insert(sourceChests, peripheral.wrap(name))
- elseif string.match(name, "hostilenetworks:sim_chamber") then
- table.insert(targetChests, peripheral.wrap(name))
- elseif string.match(name, "hostilenetworks:loot_fabricator") 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
- if item.name == "hostilenetworks:prediction_matrix" then
- sourceChest.pushItems(targetName, slot, item.count, 2)
- end
- end
- for slot = 2, 4 do
- local item = targetChest.list()[slot]
- if item then
- targetChest.pushItems(peripheral.getName(sourceChest), slot, item.count, 1)
- end
- end
- if targetChest.getItemDetail(2) then
- local item = targetChest.getItemDetail(2)
- if item then
- targetChest.pushItems(peripheral.getName(sourceChest), 2, item.count, 1)
- end
- end
- end
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement