WoW:API CastSpellByName: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Return value)
m (punctuation fix)
Line 35: Line 35:
: This problem does only appear when working with Lua source files. When you're using macros, inside the WoW client, it should work in unicode directly.
: This problem does only appear when working with Lua source files. When you're using macros, inside the WoW client, it should work in unicode directly.


:In patch 1.10, this function operates when called From; Button presses, Slash Commands and '''some''' Events. (PLAYER_TARGET_CHANGED is the only one i have found, but there may be more, i assume Events that are called In reaction to Player's Actions are those that work.)
:In patch 1.10, this function operates when called From Button presses, Slash Commands and '''some''' Events. (PLAYER_TARGET_CHANGED is the only one i have found, but there may be more, i assume Events that are called In reaction to Player's Actions are those that work).


----
----


{{Template:WoW API}}
{{Template:WoW API}}

Revision as of 12:12, 4 June 2006

CastSpellByName -Documentation by Sliver-

Arguments
( name{, onSelf})
name
String - Spell Name(as seen when mouse-over).
onSelf
Value - Any value or nil.

Returns
nil

Example
( syntax )
CastSpellByName("spellname(Rank X)")
CastSpellByName("spellname")


CastSpellByName('Life Tap(Rank 2)')

Result
Casts Life Tap (This example is warlock specific). When the (Rank X) string is omitted, the highest rank of the spell which the user has in his spellbook is cast. This is not true for Stone creation spells (i.e. "Create Firestone"), because they do not use "ranks".

Description
Casts a spell by the spells given name.

Notes:
To cast spells that contains parentheses in the spell name, such as "Create Healthstone (Major)" and "Faerie Fire (Feral)", it's necessary to either specify rank or add () to the end of the spell name, like: CastSpellByName("Faerie Fire (Feral)()").
You might encounter difficulties when using this on a localized version of WoW.
See the Unicode part of the Localization HOWTO for more details about editing a source file containing localized strings.
This problem does only appear when working with Lua source files. When you're using macros, inside the WoW client, it should work in unicode directly.
In patch 1.10, this function operates when called From Button presses, Slash Commands and some Events. (PLAYER_TARGET_CHANGED is the only one i have found, but there may be more, i assume Events that are called In reaction to Player's Actions are those that work).

Template:WoW API