Macro Branching with /click
Say you want a button that chooses between three different spells based on shift, ctrl, or no modifier and two different targets depending on left or right click. This can be done all in one like the following:
Code:
/cast [mod:shift, button:2, @player] [mod:shift, @party1] Greater Heal; [mod:ctrl, button:2, @player] [mod:ctrl, @party1] Flash Heal; [nomod, button:2, @player] [nomod, @party1] Renew
That's quite an unwieldy bit of script there. We can split it onto multiple lines for clarity and remove some redundancies to save room but it's still a bit of a beast:
Code:
/cast [mod:shift, button:1, @party1] [mod:shift, @player] Greater Heal
/cast [mod:ctrl, button:1, @party1] [mod:ctrl, @player] Flash Heal
/cast [button:1, @party1] [@player] Renew
However, by using one master macro to choose the target based on mouse button and two macros to choose the spells based on modifier key, we can make it much easier to follow. For the sake of these examples, macros 2 and 3 are on MultiBarLeftButton2 and MultiBarLeftButton3, respectively.
Macro 1:
Code:
/click [button:1] MultiBarLeftButton2; MultiBarLeftButton3
Macro 2:
Code:
/cast [mod:shift, @party1] Greater Heal; [mod:ctrl, @party1] Flash Heal; [@party1] Renew
Macro 3:
Code:
/cast [mod:shift, @player] Greater Heal; [mod:ctrl, @player] Flash Heal; [@player] Renew
Taken from Making a macro - WoWWiki - Your guide to the World of Warcraft