Thread Tools Display Modes
Prev Previous Post   Next Post Next
12-05-05, 01:03 PM   #1
Thoinan
A Defias Bandit
Join Date: Dec 2005
Posts: 2
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ī`;'
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Multi use macro

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