View Single Post
01/05/24, 11:30 PM   #4
DakJaniels
AddOn Author - Click to view addons
Join Date: Mar 2021
Posts: 31
Originally Posted by vsrs_au View Post
Thanks for the reply, much appreciated.

However, this doesn't explain how I have the same item showing in both bags, e.g. in the bank UI in game, the item "Revelry Pie" shows with a stack of 60, then in my SavedVariables file, I have the same item showing in BAG_BANK and in BAG_SUBSCRIBER_BANK, and both have a count of 60, i.e. there's only 1 stack of 60 and it shows in both bags. It looks like GetItemLinkStacks() is returning the same value for that item for both bags, which doesn't make sense to me.

If it's any help, my DumpItem function is as follows:
Code:
function InventoryDump.DumpItem(bagType, count, itemName)
	if bagType == BAG_BANK then
		InventoryDump.savedVariablesAccountWide.Bank[itemName] = count
	elseif bagType == BAG_SUBSCRIBER_BANK then
		InventoryDump.savedVariablesAccountWide.ESOBank[itemName] = count
	elseif bagType == BAG_VIRTUAL then
		InventoryDump.savedVariablesAccountWide.CraftBag[itemName] = count
	elseif bagType == BAG_BACKPACK then
		InventoryDump.savedVariablesPerChar.Backpack[itemName] = count
	end
end
I then have the following in SavedVariables file:
Code:
InventoryAccountWide =
{
    ["EU Megaserver"] = 
    {
        ["@vsrs_au"] = 
        {
            ["$AccountWide"] = 
            {
                ["version"] = 1,
                ["ESOBank"] = 
                {
...
                    ["Revelry Pie"] = 60,
...
                }
                ["Bank"] = 
                {
...
                    ["Revelry Pie"] = 60,
...
                }
Probably need to implement using
Lua Code:
  1. --- @param bagId Bag
  2. --- @param slotIndex integer
  3. --- @return id64|nil id
  4. function GetItemUniqueId(bagId, slotIndex) end

That way you get that uniqueId
  Reply With Quote