local function hasItemsInStorage(storage) for _, _ in pairs(storage.list()) do return true end return false end local function hasItemsInTurtle() for ii = 1, 16 do if turtle.getItemCount(ii) > 0 then return true end end return false end local function getEmptySlotInStorage(storage) return 5 -- TODO end local function swapSlotsInStorage(storage, slotA, slotB) local emptySlot = getEmptySlotInStorage(storage) storage.pushItems(peripheral.getName(storage), slotA, nil, emptySlot) storage.pushItems(peripheral.getName(storage), slotB, nil, slotA) storage.pushItems(peripheral.getName(storage), emptySlot, nil, slotB) end return { hasItemsInStorage = hasItemsInStorage, hasItemsInTurtle = hasItemsInTurtle, swapSlotsInStorage = swapSlotsInStorage }