diff options
author | Botond Hende <nettingman@gmail.com> | 2025-05-01 19:42:40 +0200 |
---|---|---|
committer | Botond Hende <nettingman@gmail.com> | 2025-05-01 19:42:40 +0200 |
commit | 640d3f144f1e626f9e58f2c917f9c3593d666d5f (patch) | |
tree | c16552db6b9474e9c74cddcf25de37cdd4e13141 /inv_utils.lua |
initial commit
Diffstat (limited to 'inv_utils.lua')
-rw-r--r-- | inv_utils.lua | 13 |
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 } |