Multi use macro
Trying to create a macro for any spell, whereas the script checks first if the spell is castable on the target, and if so, casts and prints a message. The whole idea is to stop <no target> spam. I'm new to scripting in WoW so bear with me:
/script CastSpellByName("spell"); ct = SpellCanTargetUnit("target") if (ct == 1) then SendChatMessage('your say message', 'Say') else SpellStopTargeting(); end
Just to break down what I'm trying to do:
1. Check if spell is castable on target and assign value ct.
2. If ct is true ( I'm assuming this is like good old binary whereas 1=true, 0=false) then execute the chat message.
3. If the spell is not castable, cancels targetting.
Am I approaching this correctly or is there a cleaner way to do this? Also getting an error
[string "CastSpellByName("spell"); ct = SpellCanTargetUnit("target") if (ct == 1) then SendChatMessage('your say message', 'Say') else SpellStopTargeting(); end ":1: `then' expected nearī`;'
|