#showtooltip changes the icon and tooltip of the macro to match what the macro is going to cast, if you chose the ? icon when making the macro
/cast command which attempts to use a spell, then an item if no spell of that name exists (/use does the same thing, but starts with items first)
[] stuff inside brackets need to all be true to trigger the command (AND)
[][] two or more bracket groups means that if the first group is false, the next group is tried (ELSEIF/OR)
@mouseover checks if your mouse is currently touching something you can cast on and aims the command on that
help friendly unit
nodead unit is not dead
@player aims command at you
Spell Name the spell you want to cast
Pseudocode (fake code) of what the macro does:
Code:local unit,reaction,alive=GetMouseoverUnit() if unit and reaction=="friendly" and alive==true then CastSpellByName("Spell Name",unit) else CastSpellByName("Spell Name","player") end