WoW:API GetSpellAutocast: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Updated with new information)
 
m (Move page script moved page API GetSpellAutocast to API GetSpellAutocast without leaving a redirect)
 
(No difference)

Latest revision as of 04:46, 15 August 2023

WoW API < GetSpellAutocast

Get information about a spell's Autocast.

autocastable, autostate = GetSpellAutocast("spellName" | spellId, bookType)


Arguments[edit]

spellName
String - the name of the spell.
spellId
Numeric - the offset (position) of spell in spellbook. SpellId can change when you learn new spells.
bookType
String - Either BOOKTYPE_SPELL ("spell") or BOOKTYPE_PET ("pet").


Returns[edit]

autocastable, autostate
autocastable
Number - whether a spell is autocastable.
Returns 1 if the spell is autocastable, nil otherwise.
autostate
Number - whether a spell is currently set to autocast.
Returns 1 if the spell is currently set for autocast, nil otherwise.

Details[edit]

  • As of patch 3.0.3, the only auto-castable spells exist in the pet spellbook (BOOKTYPE_PET).
  • Both return values will be nil in the following conditions:
    • The spell is not autocastable
    • The spell does not exist (or you don't know it)