Cast spell when Friendly target only.

Game configuration tutorials, addons and macros.

Cast spell when Friendly target only.

by roestvrijstaal » Mon Jun 08, 2015 8:46 am

Hello,

I'm trying to make a macro that ONLY let's me cast a spell when I have a FRIENDLY unit targeted.

I looked around on google but could not find any working one.

Any help appreciated.
roestvrijstaal
Private
Private
 

Re: Cast spell when Friendly target only.

by roestvrijstaal » Tue Jun 09, 2015 11:11 am

Any one know the working macro or scrip for this?
Pleas this would really help me

thanks
roestvrijstaal
Private
Private
 

Re: Cast spell when Friendly target only.

by DEDRICK » Tue Jun 09, 2015 2:37 pm

/script if UnitCanAssist("player","target") then CastSpellByname("something") else CastSpellByName("something","player"); end

if target is friend then cast spell on target, else cast spell on self (if needed, you can get rid of the else portion)
Cachecow - Tauren Warrior
DEDRICK
Sergeant
Sergeant
 

Re: Cast spell when Friendly target only.

by roestvrijstaal » Wed Jun 10, 2015 9:12 am

DEDRICK wrote:/script if UnitCanAssist("player","target") then CastSpellByname("something") else CastSpellByName("something","player"); end

if target is friend then cast spell on target, else cast spell on self (if needed, you can get rid of the else portion)


I don't need the else part so I cut it down to what you said:
/script if UnitCanAssist("player","target") then CastSpellByname("something"); end

But this is not working and gives me an LUA error. Yes I have supermacros.

Any one has a working macro for this? would be great thank you.
roestvrijstaal
Private
Private
 

Re: Cast spell when Friendly target only.

by DEDRICK » Wed Jun 10, 2015 2:11 pm

I'll go over my macros when I get home, there is no reason for it not to work
Cachecow - Tauren Warrior
DEDRICK
Sergeant
Sergeant
 

Re: Cast spell when Friendly target only.

by roestvrijstaal » Thu Jun 11, 2015 12:41 pm

DEDRICK wrote:I'll go over my macros when I get home, there is no reason for it not to work

Found anything yet? Because it's not working for me.
roestvrijstaal
Private
Private
 

Re: Cast spell when Friendly target only.

by Mr_Rosh » Thu Jun 11, 2015 2:05 pm

Forget stupid macros, just use Discord Action Bars. You can let the default UI or customize them as you wish. Above that, it has a lot of option to work with, like the one you want. Give it a try ;) .
User avatar
Mr_Rosh
Senior Sergeant
Senior Sergeant
 

Re: Cast spell when Friendly target only.

by DEDRICK » Thu Jun 11, 2015 10:57 pm

roestvrijstaal wrote:
DEDRICK wrote:I'll go over my macros when I get home, there is no reason for it not to work

Found anything yet? Because it's not working for me.


The problem was really simple....It's case sensitive FML

This works, replace lesser heal. It will not cast unless you have a target, and that target is friendly

/script if UnitCanAssist("player","target") then CastSpellByName("Lesser Heal") end;
Cachecow - Tauren Warrior
DEDRICK
Sergeant
Sergeant
 


Return to Getting started on Nostalrius