Creates a new macro. Warning: Will throw an error if the quota of allowed macros is already met.


See also Macro functions.

Signature:

index = CreateMacro("name", "iconTexture", "body", perCharacter)

Arguments:

  • name - Name for the new macro (up to 16 characters); need not be unique, though duplicate names can cause issues for other Macro API functions (string)
  • iconTexture - name of icon texture (string)
  • body - Body of the macro (up to 255 characters) (string)
  • perCharacter - 1 if the macro should be stored as a character-specific macro; otherwise nil (1nil)

Returns:

  • index - Index of the newly created macro (number, macroID)

Examples:

-- Create a character specific macro
local index = CreateMacro("DanceMonkey", "ABILITY_BACKSTAB", "/emote dances like a monkey!!!", 1)

-- Create a general macro
local index = CreateMacro("Heal", "SPELL_FROST_ARCTICWINDS", "/cast Flash Heal\n/say Let the light of Elune cleanse you!")