
Originally Posted by
blah88
Using this small code I get those results:
- With depot chest opened it returns: unknown x17
- With depot box I opened it returns: brocade backpack (that's what I want, but must be automatic...Self.OpenDepot()...)
Code:
local container = Container.GetLast()
for i=0, container:ItemCount()-1 do
local itemData = container:GetItemData(slot)
print(Item.GetName(itemData.id) )
end
That's the code I've been using to access a backpack inside Depot Box
Code:
local IDDepot = 22797
Self.CloseContainers()
local DepotChest = Self.OpenDepot()
for i = 0, DepotChest:ItemCount()-1 do
if (DepotChest:GetItemData(i).id == IDDepot) then
DepotChest:UseItem(i, true)-- until here it's open depot box I, after that nothing happens...
local depotBox = Container.GetLast() --return unknown
--local depotBox = Container.New('Depot Box I') --return nothimg
--local depotBox = Container.New(Item.GetName(IDDepot)) --return nothing
--local depotBox = Container.New(IDDepot) --return nothing
for j = 0, depotBox:ItemCount()-1 do
local itemData = depotBox:GetItemData(j)
print(Item.GetName(itemData.id))
end
break
end
end
It needs to open(automatic) a backpack inside a depot... because I need move items from inbox for that bp...
lua code:local DPBox = 1 -- From 1 to 17.
local BPName = "Brocade Backpack"
Self.CloseContainers()
Self.OpenDepot()
local DPChest = Container.GetLast()
for i = 0, DPChest:ItemCount()-1 do
if (DPChest:GetItemData(i).id == 22796 + DPBox) then
DPChest:UseItem(i, true) wait(Self.Ping() * 2, Self.Ping() * 3)
for j = 0, DPChest:ItemCount()-1 do
if (DPChest:GetItemData(j).id == Item.GetID(BPName)) then
DPChest:UseItem(j, true) wait(Self.Ping() * 2, Self.Ping() * 3)
end
end
end
end