Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Returns the number (or available charges) of an item in the inventory.
count = GetItemCount(itemInfo [, includeBank, includeUses, includeReagentBank])
Arguments[]
- itemInfo
- number|string - Item ID, Link or Name
- includeBank
- boolean? - If true, includes the bank
- includeUses
- boolean? - If true, includes each charge of an item similar to GetActionCount()
- includeReagentBank
- boolean? - If true, includes the reagent bank
Returns[]
- count
- number - The number of items in your possession, or charges if includeUses is true and the item has charges.
Example[]
local count = GetItemCount(29434)
print("Badge of Justice:", count)
local count = GetItemCount(33312, nil, true)
print("Mana Saphire Charges:", count)
local clothInBags = GetItemCount("Netherweave Cloth")
local clothInTotal = GetItemCount("Netherweave Cloth", true)
print("Netherweave Cloth:", clothInBags, "(bags)", (clothInTotal - clothInBags), "(bank)")
Patch changes[]
Patch 7.2.0 (2017-03-28): Added includeReagentBank optional argument.[1]
Patch 2.3.0 (2007-11-13): Added includeUses optional argument.[2]
Patch 2.0.1 (2006-12-05): Added.[3]
References[]
- ^ 2017-03-28, MerchantFrame.lua, version 7.2.0.23835, near line 578, archived at Townlong-Yak
- ^ Iriel 2007-08-27. Upcoming 2.3 Changes - Concise List. BlueTracker. Archived from the original
- ^ slouken 2006-10-11. Re: 2.0.0 Changes - Concise List. Archived from the original