WoW:API CallCompanion: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
(boilerplate)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}}
 
 
<!-- Describe the purpose of the function, exhausting detail can be saved for a later section -->
Summons the specified companion. New in [[Patch 3.0]]
Summons the specified companion. New in [[Patch 3.0]]
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
  CallCompanion("type", id)
  CallCompanion("type", id)


==Parameters==
==Arguments==
===Arguments===
;type : String - The type of companion to summon or dismiss ("CRITTER", or "MOUNT").
<!-- List each argument, together with its type -->
;id : Integer - The companion index to summon or dismiss (ascending integers starting from 1).
:("type")
 
:;type : String - The [[API TYPE TypeId|TypeID]] to query (e.g. "CRITTER", or "MOUNT")
:;id : Integer - The slot id to query (starts at 1).
 
===Returns===
<!-- Result of simple test during beta, 9-23-08. May want to check again later. -->
:''nil''


==Example==
==Example==
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
The following macro summons the [alphabetically] first critter your character has acquired:
<!-- begin code -->
  /run CallCompanion("CRITTER",1)
  CallCompanion("CRITTER",1)
The following macro summons a random critter your character has acquired:
<!-- end code -->
 
===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. -->
:The first mini-pet you have will be summoned.
<!-- begin code -->
 
<!-- end code -->
 
[[Category:World of Warcraft API]]
 
==Random Pet Macro==
  /run CallCompanion("CRITTER", random(GetNumCompanions("CRITTER")))
  /run CallCompanion("CRITTER", random(GetNumCompanions("CRITTER")))

Revision as of 13:04, 19 December 2009

WoW API < CallCompanion

Summons the specified companion. New in Patch 3.0

CallCompanion("type", id)

Arguments

type
String - The type of companion to summon or dismiss ("CRITTER", or "MOUNT").
id
Integer - The companion index to summon or dismiss (ascending integers starting from 1).

Example

The following macro summons the [alphabetically] first critter your character has acquired:

/run CallCompanion("CRITTER",1)

The following macro summons a random critter your character has acquired:

/run CallCompanion("CRITTER", random(GetNumCompanions("CRITTER")))