Page 1 of 1

Self \ friendly cast macro.

PostPosted: Thu Mar 24, 2016 11:32 am
by vasecha
Hello everyone. Im looking for a macro with such features:
If there is no friendly target or an enemy(harm) then self cast - if there is friendly target then cast on it.
Is this even possible without using default autoself cast option which buggs other addons?

Re: Self \ friendly cast macro.

PostPosted: Thu Mar 24, 2016 11:35 am
by Dreez
Code: Select all
/run if UnitIsFriend("player", "target") then CastSpellByName("Flash Heal") else CastSpellByName("Flash Heal", 1)end

Replace "Flash Heal" by whatever spell you want to cast

Re: Self \ friendly cast macro.

PostPosted: Thu Mar 24, 2016 11:38 am
by vasecha
HORRAY thank You!!!!

Re: Self \ friendly cast macro.

PostPosted: Fri Mar 25, 2016 2:07 pm
by Forcerius
Do you know a way to get /cast [target=Sanderic] Flash Heal to work?
I need a macro that self casts while still having a friendly targeted and without changing my current target.

Also, is there no command for /use? I need the same macro but for bandages and can't find any command that works on here for using items. Only on live.

Re: Self \ friendly cast macro.

PostPosted: Fri Mar 25, 2016 2:27 pm
by Dreez
Forcerius wrote:Do you know a way to get /cast [target=Sanderic] Flash Heal to work?
I need a macro that self casts while still having a friendly targeted and without changing my current target.

Also, is there no command for /use? I need the same macro but for bandages and can't find any command that works on here for using items. Only on live.

/run CastSpellByName("Name of your spell", 1) does this, it will always cast on yourself

/use is provided in supermacro, I'd suggest you to use that addon, there's different solutions to this but they require 200+ figure macros

Code: Select all
/run local i,j for i=0,4 do for j=1,18 do local d=GetContainerItemInfo(i,j) if d then local l=GetContainerItemLink(i,j) if strfind(l, "Conjured Mineral Water") then UseContainerItem(i,j) end end end end

is a macro to use an item (in this case Conjured Mineral Water)

Re: Self \ friendly cast macro.

PostPosted: Sat Mar 26, 2016 12:11 pm
by Forcerius
Dreez wrote:
Forcerius wrote:Do you know a way to get /cast [target=Sanderic] Flash Heal to work?
I need a macro that self casts while still having a friendly targeted and without changing my current target.

Also, is there no command for /use? I need the same macro but for bandages and can't find any command that works on here for using items. Only on live.

/run CastSpellByName("Name of your spell", 1) does this, it will always cast on yourself

/use is provided in supermacro, I'd suggest you to use that addon, there's different solutions to this but they require 200+ figure macros

Code: Select all
/run local i,j for i=0,4 do for j=1,18 do local d=GetContainerItemInfo(i,j) if d then local l=GetContainerItemLink(i,j) if strfind(l, "Conjured Mineral Water") then UseContainerItem(i,j) end end end end

is a macro to use an item (in this case Conjured Mineral Water)


Wow awesome thanks alot dude. Havn't had a chance to try it yet but I will when I can, seems legit.