WoW:API GetNumCompanions: Difference between revisions
Jump to navigation
Jump to search
m (→Result: fix typo.) |
(cleanup) |
||
Line 1: | Line 1: | ||
{{wowapi}} | {{wowapi}} | ||
Returns the number of companions you have. New in [[Patch 3.0]] | Returns the number of companions you have. New in [[Patch 3.0]] | ||
count = GetNumCompanions("type") | count = GetNumCompanions("type") | ||
== Arguments == | |||
;type : String ([[companionType]]) - Type of companions to count ("CRITTER", or "MOUNT") | |||
== Returns == | |||
;count : Number - The number of companions of a specific type. | |||
== Example == | == Example == | ||
The following snippet prints how many mini-pets the player has collected. | |||
local count = GetNumCompanions("CRITTER"); | local count = GetNumCompanions("CRITTER"); | ||
print('Hello, I have collected a total of ' .. count .. ' pets.'); | |||
Revision as of 23:42, 5 June 2010
Returns the number of companions you have. New in Patch 3.0
count = GetNumCompanions("type")
Arguments
- type
- String (companionType) - Type of companions to count ("CRITTER", or "MOUNT")
Returns
- count
- Number - The number of companions of a specific type.
Example
The following snippet prints how many mini-pets the player has collected.
local count = GetNumCompanions("CRITTER"); print('Hello, I have collected a total of ' .. count .. ' pets.');