Im trying to open all visible backpacks. I have persistent which counts items inside backpacks so its fine if I open each one just for a moment only. I have many backpacks inside other backpacks with diffrent colors. For now i have something like this :
for i = 0, 15 do
local cont = getcontainer(i)
for j = 1, cont.itemcount do
local info = iteminfo(cont.items[j].id)
if info.iscontainer then
local findIndex = 0
local contIN = getcontainer(info.name)
--if not contIN.isopen then
for _, v in pairs(backpacks) do
if v.name == info.name then
findIndex = v.index
v.index = v.index + 1
break
end
end
--print(findIndex)
openitem(info.name,cont,true,findIndex)
--end
end
end
end
And here is other file file with temporary table (only for tests)backpacks = {
{name = 'grey backpack',index = 1},
{name = 'red backpack',index = 1},
{name = 'brown backpack',index = 1},
{name = 'camouflage backpack', index = 1}
}
Im still so far from solution, if someone have any idea could be nice for sharing with me
@Raphael could you help here? I just want to sell all items from depot, I see 2 ways. First is try to sell all avaiable items from items.xml file, the second one is what Im trying to do. I need to open all containers from depot, then my persistent can count that