API call to get Item Information
Zwixx opened this issue ยท 4 comments
I tried to get Informations about an Item with a Item link. I tried the function:
AllTheThings.SearchForLink(
this succeds, but the result is not what I expected. Like the tooltip I'm interested which addon (Classic, TBC, SL, etc.) this item is from. Is there a simple function call to du this?
Thanks in advance.
The SearchForLink function returns an array of nodes that were found in the addon hierarchy that matched your query. This means for an item that only displays one source location, it'll probably only appear once in that array. All of these nodes are class instances, meaning you can call to fields like "text" and "icon" and get a programmatic response back.
The "parent" field is the next hierarchy level up from the object. If an item is in Crafted Items > Classic, that would mean that somewhere on that parent chain you'd find the Classic header.
Typically you use it by caching the response array from the call like this:
local results = AllTheThings.SearchForLink("itemid:" .. 10156); if results and #results > 0 then print(results[1].text); end
I tried to get Informations about an Item with a Item link
Unless you're trying to interface with ATT programmatically you're likely just wanting to shift-click the Item link into the chat box using /att [Item Link]