WoW API: EditMacro

From AddOn Studio
Revision as of 19:43, 11 August 2008 by WoWWiki>Hypehuman (→‎Arguments: updated info on perCharacter)
Jump to navigation Jump to search

WoW API < EditMacro

Edit macro command/button.

EditMacro(index, name, icon, body, local, perCharacter)

This function may only be called when out of combat.

Arguments

(index, name, icon, body, local, perCharacter)
index
Numeric - Macro index number. Provided by GetMacroIndexByName().
name
String - The name of the macro to be displayed in the UI. The current UI imposes a 16-character limit.
icon
Numeric - A 1-based iconTextureId (index of icon textures as displayed in "Change Name/Icon" UI). Check the current number if icon textures available by calling GetNumMacroIcons().
body
String - The macro commands to be executed. If this string is longer than 255 characters, only the first 255 will be saved.
local
Numeric - Purpose unknown, always 1.
perCharacter
Archaic. Now purposeless, since character and account macros are given unique IDs.

Returns

macroId
Numeric - The 1-based index of the macro, as displayed in the "Create Macros" UI. Same as argument "index".

Example

macroId = EditMacro(1, "MyMacro", 12, "/script CastSpellById(1);", 1, 1);

Notes