WoW:API GetNumCompanions: Difference between revisions
Jump to navigation
Jump to search
(Initial creation) |
m (→Result: fix typo.) |
||
Line 29: | Line 29: | ||
====Result==== | ====Result==== | ||
<!-- If it helps, include example results here, though they are not required. You're allowed to cheat liberally since WoW isn't a command line language. --> | <!-- If it helps, include example results here, though they are not required. You're allowed to cheat liberally since WoW isn't a command line language. --> | ||
:Prints how many mini-pets the player has | :Prints how many mini-pets the player has collected. e.g. | ||
<!-- begin code --> | <!-- begin code --> | ||
Hello, I have collected a total of 34 pets. | Hello, I have collected a total of 34 pets. | ||
<!-- end code --> | <!-- end code --> | ||
[[Category:World of Warcraft API]] | [[Category:World of Warcraft API]] |
Revision as of 09:20, 7 April 2009
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.