[Please note: I'm sure there is an addon that does what I'm trying to do, it's the doing not the results that I'm interested in]
I'm doing a little inline Lua script to talk to the Enchanting shard trader to tell me which Formula AucAdvanced thinks will produce the most saleable scroll. The only step I'm missing is eliminating which of the formulas I already know.
Is there a method for determining that I already know the formula? Either in the query from the merchant or from the info I get back from her? (For now, I just scan the enchanting list for a list of all the cuts I know, but I mean a way /other/ than that :)
local numItems = GetMerchantNumItems()
local results = {}
for index = 1, numItems
do
local name, _, _, _, _, isUsable, _ = GetMerchantItemInfo(index)
if isUsable then
-- Replace the formula name with "Scroll of" to query AucAdvanced for the scroll's value
local scrollName = gsub(name, "^Formula: ", "Scroll of ")
if scrollName ~= name then
local aaImg = AucAdvanced.API.QueryImage({ name = scrollName })
if aaImg then
local info = AucAdvanced.API.UnpackImageItem(aaImg)
if info and info.link and info.link[1] then
local iLink = info.link[1]
local simp = math.floor(AucAdvanced.API.GetAlgorithmValue("Simple", iLink) / 100 / 100)
table.insert(results, { ['gold'] = simp, ['link'] = iLink })
end
end
end
end
end
-- Sort the results into descending value order
function SortByValue(a, b) return a.gold > b.gold end
table.sort(results, SortByValue)
for index = 1, 5
do
if results[index] then
DEFAULT_CHAT_FRAME:AddMessage(results[index].link .. " is worth " .. results[index].gold .. " gold")
end
end
In this particular case, probably true, but that's not really the reason for asking.
Also: doing that by hand is a pain because the vendor sells Formulas, so I'd have to map the Formulas => Scrolls to get the value for each; right now I just call an API function in the addon I'm working on:
if isUsable and Profiteer.API.IsDesignKnown(name) == false then
...
But I'd still like to know if there is a way to tell if a design/recipe from a merchant is already known while scanning their item using Blizzard's API without having to cache my tradeskill list.
In this particular case, probably true, but that's not really the reason for asking.
Also: doing that by hand is a pain because the vendor sells Formulas, so I'd have to map the Formulas => Scrolls to get the value for each; right now I just call an API function in the addon I'm working on:
if isUsable and Profiteer.API.IsDesignKnown(name) == false then
...
But I'd still like to know if there is a way to tell if a design/recipe from a merchant is already known while scanning their item using Blizzard's API without having to cache my tradeskill list.
Only 2 ways:
1) Cache your tradeskill list of formulas you know.
2) Or, scan the tooltip of the formula for the text "Already Known". This is probably the better option.
Only 2 ways:
1) Cache your tradeskill list of formulas you know.
2) Or, scan the tooltip of the formula for the text "Already Known". This is probably the better option.
I'm doing a little inline Lua script to talk to the Enchanting shard trader to tell me which Formula AucAdvanced thinks will produce the most saleable scroll. The only step I'm missing is eliminating which of the formulas I already know.
Is there a method for determining that I already know the formula? Either in the query from the merchant or from the info I get back from her? (For now, I just scan the enchanting list for a list of all the cuts I know, but I mean a way /other/ than that :)
Also: doing that by hand is a pain because the vendor sells Formulas, so I'd have to map the Formulas => Scrolls to get the value for each; right now I just call an API function in the addon I'm working on:
But I'd still like to know if there is a way to tell if a design/recipe from a merchant is already known while scanning their item using Blizzard's API without having to cache my tradeskill list.
Only 2 ways:
1) Cache your tradeskill list of formulas you know.
2) Or, scan the tooltip of the formula for the text "Already Known". This is probably the better option.
Just for the reference of anyone who finds this thread while googling, wowwiki offers this solution for invisibly scanning tooltips: