Thread Tools Display Modes
12-22-08, 05:24 AM   #1
Tahmahal
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 10
GuildBank + Script = WTF ?

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
  Reply With Quote
12-28-08, 06:24 PM   #2
Bangerz
A Fallenroot Satyr
 
Bangerz's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 27
What happens if you click on the 2nd guild tab and run that script?
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GuildBank + Script = WTF ?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off