Open main menu
Home
Random
Log in
Settings
About AddOn Studio
Disclaimers
AddOn Studio
Search
Editing
WoW:API GetCompanionInfo
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Examples == ;Example 1 for i=1,GetNumCompanions("CRITTER") do local creatureID, creatureName, creatureSpellID, icon, issummoned = GetCompanionInfo("CRITTER", i); print(creatureID, creatureSpellID, creatureName, icon, issummoned) end 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 ;Example 2 for i = 1, GetNumCompanions("MOUNT") do local _,name,_,_,_,typeID,typeString = GetCompanionInfo("mount", i) -- Assign local vars name and typeID from GetCompanionInfo(). Create unnasigned local var typeString. typeID = bit.band(3, typeID) -- Bitwise AND operator sets typeID to 0 for water, 1 for ground and 3 for flying mounts. typeString = typeID == 0 and "Water" or typeID == 1 and "Ground" or "Flying" -- Nested and..or operator to set typeString according to typeID. print(name, typeString) end Prints the name of all of your mounts, followed by their mount type: Abyssal Seahorse Water Black Drake Mount Flying Ochre Skeletal Warhorse Ground
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Close
Loading editor…