This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Sorting by market value would make a lot of sense if you have Auctioneer or something similar installed. I tried to patch that, but couldn't find the right place. I'll try again though :-)
For the implementation it would be best if the market value for items was fetched only once, or at least only once for each opening a particular subset.
Works now (not perfect, but ok):
Some modifications to try and not stumble over Research trade skills. ---------------------------------------------- local function ScanTrade() local num = GetNumTradeSkills() for i = 1,num do local name, kind, _, _, cast = GetTradeSkillInfo( i) if kind ~= 'header' and name then local trade = {} trade.difficulty = DIFFICULTY[kind] trade.index i trade.name = name trade.cast = cast trade.link = GetTradeSkillItemLink( i) trade.recipe = GetTradeSkillRecipeLink( i) if (not trade.cast and (not string.find(name, "Research")) then local sell, buy, buyout = Producer:GetPriceData( trade.link if buyout == nil then trade.marketvalue = 0 else trade.marketvalue = buyout end else trade.marketvalue = 0 end local minMade, maxMade = GetTradeSkillNumMade( i) trade.min = minMade or 1 trade.max = maxMade or 1 if not trade.link then Producer:Debug( 'missing link:', name) end if not trade.recipe then Producer:Debug( 'missing recipe:', name) end if trade.link == trade.recipe then Producer:Debug( 'link == recipe:', GetLinkID( trade.link name) end trade.reagents = {} local numReags = GetTradeSkillNumReagents( i) for j = 1,numReags do local rName, rIcon, rNeed = GetTradeSkillReagentInfo( i, j) if rName and rIcon then local rLink = GetTradeSkillReagentItemLink( i, j) table.insert( trade.reagents { name = rName, link = rLink, need = rNeed }) -- icon = rIcon, end end trade.set = L.Unsorted trade.skill = 450 data.profession[name] = trade end end end
typo... ------------------------------------- local function sortMarketValue( a, b) if not a then return false end if not b then return true end if a.marketvalue == b.marketvalue then return a.name < b.name end return a.marketvalue > b.marketvalue end
To post a comment, please login or register a new account.