Open main menu
Home
Random
Log in
Settings
About AddOn Studio
Disclaimers
AddOn Studio
Search
Editing
WoW:API GetItemGem
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{wowapi}}__NOTOC__ Takes an item with a gem in it, and an index from 1-3, and returns the name and link for the gem at that index. itemName, itemLink = GetItemGem("name"|"itemlink", index) == Parameters == === Arguments === :(itemName or "[[itemLink]]", index) :;itemName : String - The Name of the Item, ex: "Hearthstone" (the item must be equiped or in your Inventory for this to work). :;"[[itemLink]]" : String - The itemLink, when Shift-Clicking items. :;index : Number - The index of the desired gem. 1, 2, or 3 === Returns === :itemName, itemLink :;itemName : String - The name of the gem at the specified index. :;[[itemLink]] : String - The gem's item Link; you will see the clickable Link instead of the string. (String, such as: "|cff0070dd|Hitem:24033:0:0:0:0:0:0:0|h[Solid Star of Elune]|h|r") == Example == local itemLink = "|cff0070dd|Hitem:27773:3010:2729:2729:2739:0:0:0|h[Barbaric Legstraps]|h|r" local gem1name, gem1Link = GetItemGem(itemLink, 1) local gem2name, gem2Link = GetItemGem(itemLink, 2) local gem3name, gem3Link = GetItemGem(itemLink, 3) if gem1name then DEFAULT_CHAT_FRAME:AddMessage("Gem 1: "..gem1name..", Link: "..gem1Link) end if gem2name then DEFAULT_CHAT_FRAME:AddMessage("Gem 2: "..gem2name..", Link: "..gem2Link) end if gem3name then DEFAULT_CHAT_FRAME:AddMessage("Gem 3: "..gem3name..", Link: "..gem3Link) end ====Result==== : As long as {{loot|rare|Barbaric Legstraps}}, {{loot|rare|Bright Living Ruby}}, and {{loot|rare|Shifting Nightseye}} all exist in your local cache, you will see the following lines in your chat frame: : Gem 1: Bright Living Ruby, Link: {{loot|rare|Bright Living Ruby}} : Gem 2: Bright Living Ruby, Link: {{loot|rare|Bright Living Ruby}} : Gem 3: Shifting Nightseye, Link: {{loot|rare|Shifting Nightseye}} ==Details== : This function will '''ONLY''' retrieve data that is in your local cache. : If you have never seen the item that belongs to the Item ID or Item Link it will return ''nil''. : Using the name may be ambiguous if you have more than one of the named item.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Loot
(
edit
)
Template:Tocright
(
edit
)
Template:Wowapi
(
edit
)