WoW:API GetContainerItemInfo: Difference between revisions

no edit summary
No edit summary
Line 30: Line 30:


: An item in a character's inventory can become "locked" for a number of reasons.  It might be locked because it is attached to the cursor, or because it has been split and the new stack is attached to the cursor, or because is in the "create auction" item slot, or because it is in a trade slot.  In all of these cases, the item is considered to be "locked".  Also, typically, the item's icon is shown in grayscale.  The item will become unlocked when the action that locked the icon is complete.  When the item's move is finished (and the server accepts the move), the item will become unlocked.  When the server reports that the auction has been created, the item will become unlocked (although it will also disappear).  During the period that the item is locked, some methods that affect the item (such as [[API PickupContainerItem|PickupContainerItem]]) silently fail.
: An item in a character's inventory can become "locked" for a number of reasons.  It might be locked because it is attached to the cursor, or because it has been split and the new stack is attached to the cursor, or because is in the "create auction" item slot, or because it is in a trade slot.  In all of these cases, the item is considered to be "locked".  Also, typically, the item's icon is shown in grayscale.  The item will become unlocked when the action that locked the icon is complete.  When the item's move is finished (and the server accepts the move), the item will become unlocked.  When the server reports that the auction has been created, the item will become unlocked (although it will also disappear).  During the period that the item is locked, some methods that affect the item (such as [[API PickupContainerItem|PickupContainerItem]]) silently fail.
== Example ==
/script DEFAULT_CHAT_FRAME:AddMessage(({GetContainerItemInfo(1,1)} )[2])
=== Result ===
: This macro will print out the item count for the item located in slot 1 of bag 1. Different indices, instead of 2, can be used to slice out a specific return value.
Anonymous user