Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API GetTradePlayerItemLink

Last wiki revision 2022-07-22

Returns the item link for an item in the trade window. chatItemLink = GetTradePlayerItemLink(ID);

  • ID:numeric - index value of the "player's" (your character) trade slots (starts at 1 and proceeds to 6. 7 may be used for the will-not-be-traded-slot.)
  • chatItemLink: - a string that can be used to link items in the chat log

for i = 1, 7 do chatItemLink = GetTradePlayerItemLink(i); end

-- Function: extractItemLinkFromChatItemLink Purpose: gets an item link string from a chat item link string Note: don't ask questions, it works function extractItemLinkFromChatItemLink(message) local _, _, _, _itemLink = string.find(message, "(|H(.+)|h)"); _, _, _itemLink = string.find(_itemLink, "(.-|h)"); return _itemLink; end

  • Remember, chatItemLink(s) are different than itemLink parameters needed by many APIs. To properly extract an itemLink from a chatItemLink, here is a neat function:
  • Here is a chatItemLink Example:

|cffffffff|Hitem:3771:0:0:0|h[Wild Hog Shank]|h|r

  • Here is an itemLink Example:

item:3771:0:0:0

Source

https://warcraft.wiki.gg/wiki/API_GetTradePlayerItemLink · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.