Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API CreateMacro

Last wiki revision 2023-08-24

Creates a macro. macroId = CreateMacro(name, iconFileID [, body, perCharacter])

  • name: - The name of the macro to be displayed in the UI. The current UI imposes a 16-character limit.
  • iconFileID: - A FileID or string identifying the icon texture to use. The available icons can be retrieved by calling and ; other textures inside may also be used.
  • body: - The macro commands to be executed. If this string is longer than 255 characters, only the first 255 will be saved.
  • perCharacter: - true to create a per-character macro, nil to create a general macro available to all characters.
  • macroId: - The 1-based index of the newly-created macro, as displayed in the "Create Macros" UI.

Creates an empty macro with the respective FileID for /run CreateMacro("test", 136243) Creates a character-specific macro. The question mark icon will dynamically display the Hearthstone icon. /run CreateMacro("to home", "INV_Misc_QuestionMark", "/cast Hearthstone", true)

  • This function will generate an error if the maximum macros of the specified kind already exist (120 for per account and 18 for per character).
  • It is possible to create macros with duplicate names. You should enumerate the current macros using GetNumMacros and GetMacroInfo(macroId) to ensure that your new macro name doesn't already exist. Macros with duplicate names can be used in most situations, but the behavior of macro functions that retrieve a macro by name is undefined when multiple macros of that name exist.

Source

https://warcraft.wiki.gg/wiki/API_CreateMacro · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.