GetItemCount

From Wowpedia
Jump to: navigation, search
Game Flavors
Links
Patch
Added in 2.0.1 / 1.13.2

Counts an item.

count = GetItemCount(itemInfo [, includeBank, includeUses, includeReagentBank])

Arguments

itemInfo 
string - ItemLink, Name or ID
includeBank
boolean?Optional. Could be nil. - If true, includes the bank
includeUses
boolean?Optional. Could be nil. - If true, includes each charge of an item similar to GetActionCount()
includeReagentBank
boolean?Optional. Could be nil. - 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

References

 
  1. ^ 2017-03-28, MerchantFrame.lua, version 7.2.0.23835, near line 578, archived at Townlong-Yak
  2. ^ Iriel 2007-08-27. Upcoming 2.3 Changes - Concise List. BlueTracker. Archived from the original
  3. ^ Blizzard Entertainment slouken 2006-10-11. Re: 2.0.0 Changes - Concise List. Archived from the original