MACRO cast

Casts the first spell for which the options are true. /cast [options] spell name or item or bagID slot or invSlotID

Arguments
The clause value is interpreted as either:
 * spell name : Name of the spell to cast, prefixed by an exclamation mark to prevent toggling an ability off
 * item : The name of the item to be used.
 * BagID slot : The bag the item is in (0 is backpack, etc...), and the slot number containing the item, starting at 1; e.g. "0 1" would use the first item in your backpack.
 * invSlotID : The slot on your character in which to use an item.

If the clause value is the name of both a spell and an item in your inventory, the /cast command prefers to cast the spell.

Examples
/cast [@pet,dead] Revive Pet; [nopet] Call Pet; Mend Pet
 * This will revive the pet if it is out and dead, call the pet if it is not out, or mend the pet if it is out and alive

/cast [@player, btn:2][@focus, help, nodead][@player] Flash Heal
 * If activated with mouse button 2, this will cast Flash Heal on the player else if the unit saved as the player's focus can have helpful spells cast on it and is alive, it will cast Flash Heal on the player's focus else it will cast Flash Heal on the player.
 * Let's analyze:

...[@player, btn:2]...
 * The macro directs the spell to be cast at the player if the macro is activated with mouse button 2.

...[@focus, help, nodead]...
 * The macro directs the spell to be cast at the player if the unit in the player's focus can have helpful spells cast on it and is alive.

...[@player]
 * The macro directs the spell to be cast at the player with no additional conditions.