From 640d3f144f1e626f9e58f2c917f9c3593d666d5f Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Thu, 1 May 2025 19:42:40 +0200 Subject: initial commit --- inv_utils.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 inv_utils.lua (limited to 'inv_utils.lua') 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 } -- cgit v1.2.3-70-g09d2