Open main menu
Home
Random
Log in
Settings
About AddOn Studio
Disclaimers
AddOn Studio
Search
Editing
WoW:API GetInventoryItemCount
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{wowapi}} Determine the quantity of an item in an inventory slot. count = GetInventoryItemCount("unit", slotId) == Parameters == === Arguments === :("unit", slotId) :;unit : String - The [[API TYPE UnitId|UnitId]] of the unit whose inventory is to be queried. :;slotId : Numeric - The [[API TYPE InventorySlotID|inventory slot]] to be queried, obtained via [[API GetInventorySlotInfo|GetInventorySlotInfo]]. === Returns === :count :;count : Numeric - Returns 1 on empty slots (Thus, on empty ammo slot, 1 is returned). For containers (Bags, etc.), this returns the number of items stored inside the container (Thus, empty containers return 0). Under all other conditions, this function returns the amount of items in the specified slot. == Example == <!-- begin code --> local ammoSlot = GetInventorySlotInfo("AmmoSlot"); local ammoCount = GetInventoryItemCount("player", ammoSlot); if ((ammoCount == 1) and (not GetInventoryItemTexture("player", ammoSlot))) then ammoCount = 0; end; <!-- end code --> ---- __NOTOC__
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Tocright
(
edit
)
Template:Wowapi
(
edit
)