Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:ItemLink
Jump to navigation
Jump to search
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!
{{DISPLAYTITLE:itemLink}} {{wowapitype}} [[ItemLink]]s are [[itemString]]s with additional formatting for embedding 'link' text for a [[item|game item]] link, typically used for display in the UI such as text boxes that can display them as clickable hyperlinks. See {{apif|GetAuctionItemLink}}, {{apif|GetContainerItemLink}}, {{apif|GetInventoryItemLink}}. |cff9d9d9d|Hitem:3299::::::::20:257::::::|h[Fractured Canine]|h|r == Format == * |cff9d9d9d - Colorizes the link with a medium grey color (hex color code) ** The first two characters after '|c' may be the alpha level, where 'ff' is fully opaque. ** The next three sets of two characters represent the red, green, and blue levels, just like HTML. * |H - Hyperlink link data starts here * item:7073:0:0:0:0:0:0:0:0:0:0:0:0 or item:7073:::::::::::: - the item string. See [[itemString]]. * |h - End of link, text follows * [Broken Fang] - The actual text displayed * |h - End of hyperlink * |r - Restores color to normal |cff9d9d9d|Hitem:7073::::::::::::|h[Broken Fang]|h|r == Summary == === Example === local itemLink = "|cff9d9d9d|Hitem:3299::::::::20:257::::::|h[Fractured Canine]|h|r" local itemString = string.match(itemLink, "item[%-?%d:]+") Produces: itemString == "item:3299::::::::20:257::::::" This example extracts the itemString from a given itemLink using the string.match regex Lua function. == Details == '''To obtain all the data within a hyperlink, you can use the following:''' local _, _, Color, Ltype, Id, Enchant, Gem1, Gem2, Gem3, Gem4, Suffix, Unique, LinkLvl, Name = string.find(itemLink, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*):?(%d*):?(%-?%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?") Note that this will accept any hyperlink (item/spell/quest/talent/achievement/tradeskill/etc), it will take itemstrings alone, or even just a single number. === Printing links for debug === Printing out the contents of an item link is perhaps not so obvious; displaying it anywhere in-game will just show you a clickable link. Reformat it slightly to ruin the [[UI Escape Sequences|escape sequences]] and you'll see what it really looks like: link = [[API GetContainerItemLink|GetContainerItemLink]](0, 1); printable = [[API gsub|gsub]](link, "\124", "\124\124"); ChatFrame1:AddMessage("Here's what it really looks like: \"" .. printable .. "\""); "124" is the ascii value of the "|" character. If you are writing this in a regular .lua file, feel free to go ahead and just use "|" and "||". However, if you're typing it in an in-game editor, it's better to use the ascii code escape to avoid problems. == Simple ingame item look-up == For calling up an item in the game that is not available via shift+left-click (such as something on the AH or in the professions tab), follow these very easy steps: *Look up the item on wowhead *Click on the "Links" button in the top right of the item page *Select the "Ingame link" section (usually already selected); copy the information *Enter the game and paste the information into the chat window *A clickable link for that item should appear == Changes == * Patch 5.0.4 - changed the number of [[itemString]] parameters from 10 to 11 * Patch 7.0.3 - in the 'itemString' portion place holder 0s can be removed or left blank to be assumed 0. For example ''|cff9d9d9d|Hitem:7073:0:0:0:0:0:0:0:80:0:0:0:0|h[Broken Fang]|h|r'' becomes ''|cff9d9d9d|Hitem:7073:::::::0:80::::|h[Broken Fang]|h|r''. See [[itemString]] == Notes == * The format of the link is similar for enchant, spell and quest links, with merely the "itemstring" changing. See [[spellString]], [[enchantString]] and [[questString]] == See Also == * [[itemString]] * {{apif|GetContainerItemLink}} * [[item|game item (item)]] * [[questString]], [[spellString]], [[enchantString]]
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:Api
(
edit
)
Template:Apif
(
edit
)
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Wowapi
(
edit
)
Template:Wowapitype
(
edit
)