WoW:API UseInventoryItem: Difference between revisions
Jump to navigation
Jump to search
m (Move page script moved page API UseInventoryItem to API UseInventoryItem without leaving a redirect) |
|||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{wowapi}} | |||
Use an item in a specific inventory slot. | Use an item in a specific inventory slot. | ||
Line 8: | Line 9: | ||
:You can get the [[API TYPE InventorySlotID|slot ID]] by using [[API GetInventorySlotInfo|GetInventorySlotInfo(slot)]] | :You can get the [[API TYPE InventorySlotID|slot ID]] by using [[API GetInventorySlotInfo|GetInventorySlotInfo(slot)]] | ||
=== Return Value === | |||
Always nil. | |||
=== Example=== | === Example=== | ||
Line 13: | Line 17: | ||
After patch 1.6 you cant auto-use items anymore. Addons can no longer activate items without the press of a button. In order to use UseInventoryItem( GetInventorySlotInfo("Trinket0Slot") ) you will have to call it from a button, keypress or icon as you do with spells. | After patch 1.6 you cant auto-use items anymore. Addons can no longer activate items without the press of a button. In order to use UseInventoryItem( GetInventorySlotInfo("Trinket0Slot") ) you will have to call it from a button, keypress or icon as you do with spells. | ||
Latest revision as of 04:47, 15 August 2023
Use an item in a specific inventory slot.
Syntax[edit]
UseInventoryItem( slotID );
Arguments[edit]
- slotID
- The inventory slot ID
- You can get the slot ID by using GetInventorySlotInfo(slot)
Return Value[edit]
Always nil.
Example[edit]
- /script UseInventoryItem( GetInventorySlotInfo("Trinket0Slot") );
After patch 1.6 you cant auto-use items anymore. Addons can no longer activate items without the press of a button. In order to use UseInventoryItem( GetInventorySlotInfo("Trinket0Slot") ) you will have to call it from a button, keypress or icon as you do with spells.