I'm using the Inventory Manager from Advanced Peripherals, and I'm trying to make a script that transfers my inventory to a chest but keeps the positioning of all the items. The getItems()
function is supposed to return a table in which the keys are the slot numbers containing items and the values are the data for the items in those slots. However, that's not what I seem to be getting. The table returned by getItems()
doesn't seem to record the slot numbers anywhere - the keys are just numbers increasing from 1 to the amount of filled slots in my inventory, no matter where the items are located.
local inv = peripheral.find("inventoryManager")
local invTable = inv.getItems()
for slot,item in pairs(invTable):
print(slot..": "..item.name.." x"..item.count)
end