Hello there,
I'm trying to make a mod which can save in a SavedVariable file the guild bank items.
So I have this :
Code:
function LightningCore.GetInfoFromGuildBank()
LightningData["Guildbank"] = {};
for y=1, GetNumGuildBankTabs() do tabName, tabIcon, _, _, _, _ = GetGuildBankTabInfo(y); LightningData.GuildbankTabs[y] = tabName; end
for guildBankTabID = 1, MAX_GUILDBANK_TABS do
for slot=1, 98 do
itemLink = GetGuildBankItemLink(guildBankTabID, slot);
if itemLink and itemLink ~= nil then
itemName, _, itemRarity, _, _, _, _, _, _, _ = GetItemInfo(itemLink);
_, itemCount, _, _, _ = GetGuildBankItemInfo(guildBankTabID, slot);
tinsert(LightningData["Guildbank"], guildBankTabID..itemName.." ("..itemCount..")"..GetStringFromItemQualityID(itemRarity));
end
--DEFAULT_CHAT_FRAME:AddMessage(slot);
end
end
end
It works ... but only for the first guild bank tab. I mean, I have got something like this :
Code:
["Guildbank"] = {
"1Potion de soins runique (5)___common", -- [1]
"1Potion de soins runique (5)___common", -- [2]
"1Potion de soins runique (5)___common", -- [3]
"1Potion de soins runique (5)___common", -- [4]
etc.
}
But it doesn't work forr the 2nd, 3rd ... tab. I have spent 2 hours looking that damn "for" loop but I don't see any error ....
Have you any idea why it doesn't work ?
Tahnks
Tahmahal