summaryrefslogtreecommitdiff
path: root/inv_utils.lua
diff options
context:
space:
mode:
Diffstat (limited to 'inv_utils.lua')
-rw-r--r--inv_utils.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/inv_utils.lua b/inv_utils.lua
new file mode 100644
index 0000000..830e39e
--- /dev/null
+++ b/inv_utils.lua
@@ -0,0 +1,13 @@
+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 { swapSlotsInStorage = swapSlotsInStorage }