WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Macro Help (https://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   What is point of empty brackets? (https://www.wowinterface.com/forums/showthread.php?t=58049)

hasnogaems 06-13-20 04:23 AM

What is point of empty brackets?
 

Like here. Will this maro behave differently if I just remove those?

Rilgamon 06-13-20 06:35 AM

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.

DahkCeles 06-13-20 07:14 AM

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.


All times are GMT -6. The time now is 04:59 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI