Quantcast
WoWInterface - View Single Post - What is point of empty brackets?
View Single Post
06-13-20, 07:14 AM   #3
DahkCeles
An Aku'mai Servant
 
DahkCeles's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2020
Posts: 32
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