API GetCompanionInfo

Returns information about the companions you have. creatureID, creatureName, creatureSpellID, icon, issummoned, mountType = GetCompanionInfo("type", id)

Arguments

 * type : String (companionType) - Companion type to query: "CRITTER" or "MOUNT".
 * id : Integer - The slot id to query (starts at 1).

Returns
Ground 0x01 Fly 0x02 Float 0x04 Underwater 0x08 Jump 0x10 (ex: the turtle can’t jump)
 * creatureID: Integer - The NPC ID of the companion.
 * creatureName: String - The name of the companion.
 * creatureSpellID: Integer - The spell ID to cast the companion. This is not passed to CallCompanion, but can be used with, e.g., GetSpellInfo.
 * icon: String - The texture of the icon for the companion.
 * issummoned: Flag - 1 if the companion is summoned, nil if it's not
 * mountType: Bitfield for air/ground/water mounts

Example
for i=1,GetNumCompanions("CRITTER") do    local creatureID, creatureName, creatureSpellID, icon, issummoned = GetCompanionInfo("CRITTER", i); print(creatureID, creatureSpellID, creatureName, icon, issummoned) end

Result

 * Prints all the information regarding your pets to the chat frame.

7555 Hawk Owl 10706 Interface\Icons\Ability_EyeOfTheOwl 1 7553 Great Horned Owl 10707 Interface\Icons\Ability_EyeOfTheOwl nil