Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
No edit summary
KethoBot (talk | contribs)
m (restrictedapi note)
Tag: WoW API docs
 
(15 intermediate revisions by 6 users not shown)
Line 1: Line 1:
  +
{{wowapi}} {{restrictedapi|protected|note=The "pet" action type of [[SecureActionButtonTemplate]] can be used to call this function.}}
<center>'''CastPetAction''' </center>
 
 
 
Cast the corresponding pet skill.
 
Cast the corresponding pet skill.
 
CastPetAction(index[, target])
   
 
==Arguments==
CastPetAction(index);
 
  +
:;index:{{apitype|number}} - pet action bar slot index, ascending from 1.
 
  +
:;target:{{apitype|string?}} : [[UnitId]] - The unit to cast the action on; defaults to "target".
----
 
;''Arguments''
 
 
: (index)
 
:; index : Number - The index of the pet skill for query.
 
 
----
 
;''Returns''
 
 
: nil
 
 
----
 
;''Example''
 
Cast by specified action name
 
 
for i=1, NUM_PET_ACTION_SLOTS, 1 do
 
local name, subtext, texture, isToken, isActive, autoCastAllowed, autoCastEnabled = GetPetActionInfo(i);
 
if ( name == "Sacrifice" ) then
 
CastPetAction(i);
 
end
 
end
 
 
Please notice that this exemple will only works if the sacrifice skill is named "Sacrifice" in the client locale.
 
 
----
 
;''Description''
 
 
: Cast the corresponding pet skill. Requires a button press.
 
 
   
  +
==Patch changes==
----
 
  +
{{Patch 2.0.1|note=Protected.}}
{{WoW API}}
 

Latest revision as of 07:29, 24 August 2023

Cast the corresponding pet skill.

CastPetAction(index[, target])

Arguments

index
number - pet action bar slot index, ascending from 1.
target
string? : UnitId - The unit to cast the action on; defaults to "target".

Patch changes

Bc icon Patch 2.0.1 (2006-12-05): Protected.