WoW:API CastSpellByName: Difference between revisions
Jump to navigation
Jump to search
(Caveat) |
(→Notes) |
||
| Line 21: | Line 21: | ||
* 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. | ||
It was previous claimed that this could still be used to open craft windows and activate lock picking, but opening craft windows with an unprotected call is no longer possible. Lock picking is as of yet unconfirmed. | |||
Revision as of 11:40, 4 September 2008
This function is PROTECTED, and can only be called from Blizzard code.
|
CastSpellByName(spellName{, onSelf});
Arguments
- name
- String - Name of the spell to cast. Rank is optional, if omitted, highest possible is picked automatically.
- onSelf
- Boolean - Should the spell be cast on the player (vs target)? If no target exists and the onSelf evaluates to false, cursor is switched to casting mode.
Example
CastSpellByName("Flash Heal(Rank 2)"); -- Cast Flash Heal (Rank 2) on target.
CastSpellByName("Flash Heal"); -- Cast Flash Heal (Highest rank) on target.
CastSpellByName("Flash Heal",1); -- Cast Flash Heal (Highest rank) on self.
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.
It was previous claimed that this could still be used to open craft windows and activate lock picking, but opening craft windows with an unprotected call is no longer possible. Lock picking is as of yet unconfirmed.