WoW:API GetContainerItemLink: Difference between revisions

Homogenized variable names and added links for ItemLink and BagID
(Homogenized variable names and added links for ItemLink and BagID)
Line 3: Line 3:


<!-- Describe the purpose of the function, exhausting detail can be saved for a later section -->
<!-- Describe the purpose of the function, exhausting detail can be saved for a later section -->
Returns the item link of the item located in bag# and slot#.
Returns the [[ItemLink]] of the item located in [[bagID]] and slotID.


<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
  ItemLink = GetContainerItemLink(bag, slot)
  ItemLink = GetContainerItemLink(bagID, slotID)




Line 12: Line 12:
=== Arguments ===
=== Arguments ===
<!-- List each argument, together with its type -->
<!-- List each argument, together with its type -->
:bagID, slot
:bagID, slotID


:;[[API TYPE bagID|bagID]] : Numeric - The number of the bag. Valid bags are 0-4. 0 is the backpack.
:;[[bagID|bagID]] : Numeric - The number of the bag. Valid bags are 0-4. 0 is the backpack.
:;slot : Numeric - The slot of the specified bag. Valid slots are 1 through BagSize. 1 is the left slot in the top row.
:;slotID : Numeric - The slot of the specified bag. Valid slotID's are 1 through BagSize. 1 is the left slot in the top row.


=== Returns ===
=== Returns ===
Line 21: Line 21:
:ItemLink
:ItemLink


:;ItemLink : Returns the ItemLink (The item link is the link when you shift-click an item while the chat edit box is visible). Returns nil if the slot of the specified bag is empty. Example link returned: '''|Hitem:6948:0:0:0:0:0:0|h[Hearthstone]|h''' . To use this link in other functions that require an "itemlink", you have to strip out the extra chat link information.  Ex: '''item:6948:0:0:0:0:0:0'''
:;[[ItemLink|ItemLink]] : Returns the [[ItemLink]] (The item link is the link when you shift-click an item while the chat edit box is visible). Returns nil if the slot of the specified bag is empty. Example link returned: '''|Hitem:6948:0:0:0:0:0:0:0|h[Hearthstone]|h''' . To use this link in other functions that require an [[ItemLink]], you have to strip out the extra chat link information.  Ex: '''item:6948:0:0:0:0:0:0:0'''


== Example ==
== Example ==
Line 49: Line 49:
:[[API GetContainerNumSlots|GetContainerNumSlots(bagID)]] - Gives you the number of slots available in the bag specified by the index.
:[[API GetContainerNumSlots|GetContainerNumSlots(bagID)]] - Gives you the number of slots available in the bag specified by the index.


===== UseContainerItem(bagID,slot) =====
===== UseContainerItem(bagID,slotID) =====


:[[API UseContainerItem|UseContainerItem(bagID,slot)]] - Uses an item located in bag# and slot#.
:[[API UseContainerItem|UseContainerItem(bagID,slot)]] - Uses an item located in [[bagID]] and slotID.


===== string.find(string,pattern{,init{,plain}}) =====
===== string.find(string,pattern{,init{,plain}}) =====
Anonymous user