View Single Post
03/13/23, 10:31 AM   #3
cabwav
Join Date: Aug 2020
Posts: 7
Thank you for your reply. I changed the code as follows:
Lua Code:
  1. for j = 1, GetNumGuilds() do
  2.         local guildId = GetGuildId(j)
  3.         local gotTrader = DoesGuildHavePrivilege(guildId, GUILD_PRIVILEGE_TRADING_HOUSE) or false
  4.         local isPlayerAllowedToSell = DoesPlayerHaveGuildPermission(guildId, GUILD_PERMISSION_STORE_SELL)
  5.  
  6.         if gotTrader and isPlayerAllowedToSell then
  7.             if (SelectTradingHouseGuildId(guildId)) then
  8.                 local currentListingCount, maxListingCount = GetTradingHouseListingCounts()
  9.                 if(currentListingCount > 0) then
  10.                     for i = 1, currentListingCount do
  11.                         local _,itemName,displayQuality,stackCount,_,timeRemaining,salePrice = GetTradingHouseListingItemInfo(i)
  12.                         local link = GetTradingHouseListingItemLink(i)
  13.                         local linkItemId = GetItemLinkItemId(link)
  14.                         table.insert(mytable,string.format("%s;%s;%s;%s;%s",guildId,linkItemId,itemName,salePrice,timeRemaining))
  15.                     end
  16.                 end
  17.             end
  18.         end
  19.     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
  Reply With Quote