Fandom

WoWWiki

API EditMacro

104,632pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

WoW API < EditMacro

Edit macro command/button.

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

This function may only be called when out of combat.

Arguments Edit

(index or macroName, name, icon, body, local, perCharacter)
index or macroName 
Number or string - the index or name of the macro to be edited. Index ranges from 1 to 36 for account wide macros and 37 to 54 for character specific.
name 
String - The name of the macro to be displayed in the UI. The current UI imposes a 16-character limit. The name remains unchanged if nil.
icon 
Numeric - A 1-based iconTextureId (index of icon textures as displayed in "Change Name/Icon" UI). Check the current number of icon textures available by calling GetNumMacroIcons(). The icon remains unchanged if nil.
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 Edit

macroId 
Numeric - The new index of the macro, as displayed in the "Create Macros" UI. Same as argument "index" unless the macro name is changed, as they are sorted alphabetically.

Example Edit

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

Notes Edit

  • If this function is called from within the macro that is edited, the rest of the macro (from the final character's position of the /run command onward) will run the new version.

Also on Fandom

Random Wiki