Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local extractor = peripheral.wrap("back")
- local storageChest = peripheral.wrap("container_chest_1")
- local function tableCount(inputTable)
- local count = 0
- for _ in pairs(inputTable) do count = count + 1 end
- return count
- end
- while true do
- print("sleeping")
- sleep(1)
- print("exporting stuffed items to chest")
- storageChest.pullItem("west", 2)
- storageChest.pullItem("east", 4)
- storageChest.pullItem("west", 2)
- storageChest.pullItem("east", 4)
- print("compressing chest")
- storageChest.condenseItems()
- print("trying to import back") -- Push items back, where they will fit
- for i,data in pairs(storageChest.getAllStacks()) do
- print("chest slot "..i)
- for j = 2,4,1 do
- print("extractor slot "..j)
- if j == 4 then
- storageChest.pushItemIntoSlot("west",i,j)
- else
- storageChest.pushItemIntoSlot("east",i,j)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment