WoW:API EquipItemByName: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
m (Move page script moved page API EquipItemByName to API EquipItemByName without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{wowapi}}__NOTOC__
{{wowapi}}__NOTOC__
Equips an item, optionally into a specified slot.
EquipItemByName(itemId or "itemName" or "itemLink"[, slot])


<center>'''EquipItemByName''' - ''Documentation by L'ombra''</center>
== Parameters ==
=== Arguments ===
:(itemId or "itemName" or "[[itemLink]]"[, [[inventorySlotId|slot]]])


Equips an item by its name, optionally into a specified slot.
:;itemId : Integer - The numeric ID of the item. ie. 12345
:;itemName : String - The name of the item, ie "Worn Dagger". Partial names are valid inputs as well, ie "Worn". If several items with same piece of name exists, the first one found will be equipped.
:;[[itemLink]] : String - The [[itemLink]], when Shift-Clicking items.
:;[[inventorySlotId|slot]] : Numeric - ''(optional)'' - The [[InventorySlotId|inventory slot]] to put the item in, obtained via [[API GetInventorySlotInfo|GetInventorySlotInfo()]].


== Parameters ==
== Changes in 3.3.0 ==
=== Arguments ===
When in combat this function now "picks up" the item instead of equipping it, similar to [[API_PickupInventoryItem|PickupInventoryItem]].  Out of combat, the function behaves as expected.  This change was made to address the issue of rogues using "poison swapping" addons to increase their DPS.<ref>{{ref web|url=http://forums.worldofwarcraft.com/thread.html?topicId=21042559255&pageNo=1&sid=1#6|title=Blue post confirming 3.3.0 change}}</ref>
:;"name" : String - The name of the item, ie "Worn Dagger". Partial names are valid inputs as well, ie "Worn". If several items with same piece of name exists, the first one found will be equipped.
 
:;[[inventorySlotId|slot]] : Numeric - ''(optional)'' - The [[API TYPE InventorySlotID|inventory slot]] to put the item in, obtained via [[API GetInventorySlotInfo|GetInventorySlotInfo]].
== References ==
{{reflist}}

Latest revision as of 04:45, 15 August 2023

WoW API < EquipItemByName

Equips an item, optionally into a specified slot.

EquipItemByName(itemId or "itemName" or "itemLink"[, slot])

Parameters[edit]

Arguments[edit]

(itemId or "itemName" or "itemLink"[, slot])
itemId
Integer - The numeric ID of the item. ie. 12345
itemName
String - The name of the item, ie "Worn Dagger". Partial names are valid inputs as well, ie "Worn". If several items with same piece of name exists, the first one found will be equipped.
itemLink
String - The itemLink, when Shift-Clicking items.
slot
Numeric - (optional) - The inventory slot to put the item in, obtained via GetInventorySlotInfo().

Changes in 3.3.0[edit]

When in combat this function now "picks up" the item instead of equipping it, similar to PickupInventoryItem. Out of combat, the function behaves as expected. This change was made to address the issue of rogues using "poison swapping" addons to increase their DPS.[1]

References[edit]