WoW API: GetNumCompanions

From AddOn Studio
Revision as of 09:20, 7 April 2009 by WoWWiki>Phyber (→‎Result: fix typo.)
Jump to navigation Jump to search

WoW API < GetNumCompanions


Returns the number of companions you have. New in Patch 3.0

count = GetNumCompanions("type")


Parameters

Arguments

("type")
type
String - The TypeID to query (e.g. "CRITTER", or "MOUNT")

Returns

count
Integer - The number of companions of a specific type.

Example

local count = GetNumCompanions("CRITTER");
ChatFrame1:AddMessage('Hello, I have collected a total of ' .. count .. ' pets.');

Result

Prints how many mini-pets the player has collected. e.g.
Hello, I have collected a total of 34 pets.