Yes, looks okay to me. Not sure why you get items of a guildId where no trader exists though. How should one list any item there?
Did you testreset the SV table before trying new so there is no old data in it?
Add d() debit messages to your code to see where it runs through, which items are added at what loop etc.
Originally Posted by cabwav
Thank you for your reply. I changed the code as follows:
Lua Code:
for j = 1, GetNumGuilds() do local guildId = GetGuildId(j) local gotTrader = DoesGuildHavePrivilege(guildId, GUILD_PRIVILEGE_TRADING_HOUSE) or false local isPlayerAllowedToSell = DoesPlayerHaveGuildPermission(guildId, GUILD_PERMISSION_STORE_SELL) if gotTrader and isPlayerAllowedToSell then if (SelectTradingHouseGuildId(guildId)) then local currentListingCount, maxListingCount = GetTradingHouseListingCounts() if(currentListingCount > 0) then for i = 1, currentListingCount do local _,itemName,displayQuality,stackCount,_,timeRemaining,salePrice = GetTradingHouseListingItemInfo(i) local link = GetTradingHouseListingItemLink(i) local linkItemId = GetItemLinkItemId(link) table.insert(mytable,string.format("%s;%s;%s;%s;%s",guildId,linkItemId,itemName,salePrice,timeRemaining)) end end end end end
Unfortunately, I am still getting the double amount of items, i.e. the items that are actually sold in the Trading Guild, plus the same number of items for the 'regular' guild (that has no trader)
Did I understand your answer correctly?
thanks again,
cabwav
|