Thread Tools Display Modes
06-13-20, 04:23 AM   #1
hasnogaems
A Flamescale Wyrmkin
 
hasnogaems's Avatar
Join Date: Apr 2016
Posts: 109
What is point of empty brackets?


Like here. Will this maro behave differently if I just remove those?
  Reply With Quote
06-13-20, 06:35 AM   #2
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
The brackets are "or" ... if the first OR the second OR the third is true cast the spell.
Empty bracket (no requirements to be met for being 'true') makes sure the spell is cast when the first two brackets fail.
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
06-13-20, 07:14 AM   #3
DahkCeles
A Cliff Giant
 
DahkCeles's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2020
Posts: 73
Totally agree with the previous post; just providing examples with and without the square brackets:


/cast [modifier:SELFCAST, @player] [@mouseover] [ ] Greater Heal
Code:
if my selfcast modifier key is pressed then
    cast Greater Heal on myself
elseif my mouse is over a unit then
    cast Greater Heal on the moused-over unit
else
    cast Greater Heal
end
/cast [modifier:SELFCAST, @player] [@mouseover] Greater Heal
Code:
if my selfcast modifier key is pressed then
    cast Greater Heal on myself
elseif my mouse is over a unit then
    cast Greater Heal on the moused-over unit
end
So adding the empty square brackets provides a "fallback" to still cast a spell even if you didn't have a modifier key pressed nor a mouseover target.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » What is point of empty brackets?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off