WoW:API CastSpell: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
  <center>'''CastSpell''' ''-Documentation by Lorrick-''</center>
  <center>CastSpell</center>


Returns information about the specified spellbook tab.
Casts spell under spellbookType with ID spellID.


  CastSpell({spellID}, {spellbookTabNum});
  CastSpell({spellID}, {spellbookType});


----
----
Line 11: Line 11:
:;spellID : Integer - Spell ID.
:;spellID : Integer - Spell ID.


:( spellbookTabNum )
:( spellbookType )


:;spellbookTab : Integer - Spellbook tab to retrieve information for. Valid values are 1 through MAX_SKILLLINE_TABS(8).
:;spellbookType : String - Spellbook type. Valid values are "spell" and "pet". All players use "spell". Hunters and Warlocks may have additional tabs on the bottom when pets are summoned. Warlocks have Demon, which corresponnds to "pet" spellbook type.


----
----
Line 23: Line 23:
;''Example''
;''Example''


SPELLBOOK_TAB_GENERAL = 1;
  CastSpell( 1, "spell");
  CastSpell( 1, SPELLBOOK_TAB_GENERAL );




;''Result''
;''Result''


:;Casts the first spell listed on the general tab of the spellbook.
:;Casts the first spell listed in the spellbook (usually Alchemy or Attack).
----
;''Example''
 
CastSpell( 1, "pet");
 
 
;''Result''
 
:;Casts the first pet spell listed in the spellbook (usually Blood Pact if you control an Imp).
----
----
;''Description''
;''Description''
Line 37: Line 45:
;''Note''
;''Note''


: Just use SpellBookFrame.bookType as the spellbookTabNum for any spell. the id is then just counted from the beginning through all tabs. the CastSpell function can only be used in OnClick functions. Another way is to use it in a Slash command and then the user makes a macro out of it and clicks on it. (seems WoW only allows this when a mouseclick / key input has initiated it)
: Use "spell" or SpellBookFrame.booktype as the spellbookType for any non-pet spell. The id is counted from 1 through all spell types (tabs on the right side of SpellBookFrame). Pet spells also start from 1. (See example above). The CastSpell function can only be used in OnClick functions or in bindings.xml. [Obsolete: Another way is to use it in a Slash command and then the user makes a macro out of it and clicks on it. (seems WoW only allows this when a mouseclick / key input has initiated it)]
----
----
{{Template:WoW API}}
{{Template:WoW API}}
[[Category:API Spell Functions|CastSpell]]
[[Category:API Spell Functions|CastSpell]]

Revision as of 01:00, 5 October 2005

CastSpell

Casts spell under spellbookType with ID spellID.

CastSpell({spellID}, {spellbookType});

Arguments
( spellID )
spellID
Integer - Spell ID.
( spellbookType )
spellbookType
String - Spellbook type. Valid values are "spell" and "pet". All players use "spell". Hunters and Warlocks may have additional tabs on the bottom when pets are summoned. Warlocks have Demon, which corresponnds to "pet" spellbook type.

Returns
??

Example
CastSpell( 1, "spell");


Result
Casts the first spell listed in the spellbook (usually Alchemy or Attack).

Example
CastSpell( 1, "pet");


Result
Casts the first pet spell listed in the spellbook (usually Blood Pact if you control an Imp).

Description
Cast specified spell.

Note
Use "spell" or SpellBookFrame.booktype as the spellbookType for any non-pet spell. The id is counted from 1 through all spell types (tabs on the right side of SpellBookFrame). Pet spells also start from 1. (See example above). The CastSpell function can only be used in OnClick functions or in bindings.xml. [Obsolete: Another way is to use it in a Slash command and then the user makes a macro out of it and clicks on it. (seems WoW only allows this when a mouseclick / key input has initiated it)]

Template:WoW API