Macro Code Syntax

Not sure about the spelling and format of making macros?
Browse our syntax Directory!

3 Major Parts of a WoW Macro

There is three parts of a macro, the Command, the parameter and the condition.

For instance, if you want to cast entangling roots only when you can (basically when you're outdoors)

/cast [outdoors]Entangling Roots
Where:
/cast - is the command
[outdoors] - is the condition
Entagling Roots - is the parameter

Now Let's Discuss Each Part

Command

The Macro Command is the first and only part of the macro that is totally compulsory or in other words, must be present in all macros or else it will make the macro talk in chat instead of executing it as a command

For more detail, read macro command syntax and macro command list

Commands starts with a slash ( / ) except two commands #show and #showtooltip. Each of the commands require different parameters and all commands are not case sensitive.Some of the most useful commands are /cast, /castsequence, /stopcasting /stopmacro, /use and /run

Parameters

Parameters is the part of the macro that describes the property of a command, for example

/cast Arcane Shot

This will cast arcane shot
#show Arcane Shot

This will show the
icon
of the macro
as Arcane Shot

Clearly on the example above, parameters just tell the property of the command. It will act differently on different commands.

Parameters are not case sensitive and will vary depending on commands, every commands requires different parameters and some commands doesn't require parameters and some doesn't use parameters at all.

There are few types of parameters, since this parameter types are used on more than one command,For more information, read Macro Parameters Syntax and Parameter Type List

Condition

Condition is the part of the macro that controls when/where or what condition must be true before a macro execute.

This part is completely optional, BUT some commands doesn't make sense without conditions.

Macro Condition are wrapped with a bracket, if there are more than one condition that needs to befulfilled, they are wrapped inside the bracket, separated by commas. For more info, read syntax of condition and list of conditions

Scripts Syntax
Functions