WoW:API GetCompanionInfo: Difference between revisions

m
→‎Example: There's no second argument for GetNumCompanions()
m (Fixed typo in example code.)
m (→‎Example: There's no second argument for GetNumCompanions())
Line 31: Line 31:
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
<!-- begin code -->
<!-- begin code -->
  for i=1,GetNumCompanions("CRITTER",1) do
  for i=1,GetNumCompanions("CRITTER") do
local creatureID, creatureName, creatureSpellID, icon, issummoned = GetCompanionInfo("CRITTER", i);
    local creatureID, creatureName, creatureSpellID, icon, issummoned = GetCompanionInfo("CRITTER", i);
ChatFrame1:AddMessage(creatureID .. " " .. creatureSpellID .. " " .. creatureName .. " " .. icon .. " " .. issummoned) end
    print(creatureID, creatureSpellID, creatureName, icon, issummoned)
end
<!-- end code -->
<!-- end code -->


Anonymous user