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.