WoW API: GetNumCompanions

From AddOn Studio
Revision as of 07:14, 2 August 2008 by WoWWiki>Ackis (Initial creation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 coollected. e.g.
Hello, I have collected a total of 34 pets.