View Full Version : Macro conditionals: self?
Nepenthes
01-14-2009, 08:56 AM
Is there any conditional for macros that will indicate if the target is myself? I want a macro such that:
if target==self then cast shield
else if target == friend cast renew
else if target == hostile cast smite
Telling the difference between a friendly target and an enemy target is easy, but is there any way to tell the difference between myself and another party member?
Jafula
01-14-2009, 10:07 AM
I think player should be a valid unit id. Try
/cast [target=player] Power Word: Shield
/cast [target=target,help] Renew
/cast [target=target,harm] Smite
See link ('http://www.wowwiki.com/Making_a_macro#.5Btarget.3Dunit.5D') (wowwiki).
puppychow
01-14-2009, 12:29 PM
I think the above macro will always cast PWS on yourself, since [target=player] will always evaluate to true and execute first -- I believe [target=player] isn't evaluating whether the target is the player, its saying the target IS the player for this cast, no? Try it out and let us know though, I suck at macros and could be completely wrong.
Another option is (basically just reversing stuff):
/cast [help] Renew
/cast [harm] Smite
/cast [target=player] Power World: Shield
the [target=player] is actually superflous in this case if you have self-cast enabled.
Owltoid
01-14-2009, 01:08 PM
I don't believe we have found a way to conditionally cast a spell depending on if targeting self or others. Essentially I was asking the same question (with different functionality, but it all comes down to can I find out if I'm targeting myself) in the following thread:
Macro that if targeting self use barkskin, if targeting another player then heal ('http://www.dual-boxing.com/forums/index.php?page=Thread&threadID=17761')
There are some interesting ideas with playing with tartget=targettarget and so on, but I'm not sure if there was a functional solution in the end.
emesis
01-14-2009, 01:43 PM
I don't believe we have found a way to conditionally cast a spell depending on if targeting self or others. Essentially I was asking the same question (with different functionality, but it all comes down to can I find out if I'm targeting myself) in the following thread:
Actually, subject to the caveat of none of us having tested this particular code, I believe the approach outlined above and elaborated by puppychow should work.
It's basically using the fact that when a line of the macro does something that invokes the global cooldown, the following lines are not processed. On the other hand, if a line simply fails due to the target predicates, execution of the macro continues.
While this isn't fully conditional logic, the revised macro posted by puppychow takes advantage of this GCD-abort effect to effectively create target-based spell selection.
Owltoid
01-14-2009, 01:47 PM
/cast [help] Renew
So it doesn't consider yourself as "help"? If you target yourself and it considers yourself to be help then it will always cast renew unless targeting an enemy. You'll never get to the PW:Shield. If it doesn't consider yourself as help then this would also solve my barkskin question.
puppychow
01-14-2009, 02:28 PM
If you have yourself targeted, then yes [help] would cast Renew and you would never cast PW: Shield. Only if you have NOBODY targeted would the PW: Shield go off since neither [help] nor [harm] are valid. I just tested it on my pally while sitting kinda AFK in wintergrasp, my macro was:
#showtooltip
/cast [harm] Seal of Light
/cast [help] Flash of Light
/cast [target=player] Holy Light
if I target an enemy, Seal of Light casts, no problem. If I target a friendly player, Flash of Light casts. If I target nobody, Holy Light casts on myself. If I target myself, Flash of Light casts on myself, since [help] when target is myself evaluates as true.
So imo just always target nobody when you want it to be you and you will be able to do what you want. Otherwise you will have to do things with /castrandom and commas and hope it drops through randomly to abuse the GCD logic.
Sajuuk
01-15-2009, 02:15 PM
I have this for my low level priest/mage team. (Just does renew, SW: P)
/cast [target=mouseover, help]Renew;[target=mouseover, harm]Shadow Word: Pain;[help]Renew;[harm]Shadow Word: Pain; []Renew
Same macro, broken up -
/cast - This needs no explanation.
[target=mouseover, help]Renew; - (Allows mouse healing)
[target=mouseover, harm]Shadow Word: Pain; - (Allows Mouse attacking)
[help]Renew; - (Heals current target, if friendly)
[harm]Shadow Word: Pain; - (attacks current target, if hostile)
[]Renew - (If there is no friendly/unfriendly target/mouseover target, this will just cast renew)
As for the macro you want, try this: (Some fiddling may be required)
/cast [harm]Smite; [help]renew; [player]Power Word: Shield
If you need more character space you can try this:
/cast [harm]Smite; [help]renew; []Power Word: Shield
genocyde
01-16-2009, 01:16 PM
I personally set up these type of macros to use my normal targeting system as follows:
/cast [target=player mod:shift] Power Word: Shield; [target=focustarget exists,harm,nodead] Smite;
[target=focustarget exists,help,nodead] renew; [target=focustarget exists,dead] ressurect; [target=focus] Power Word: Shield
That way I can use focus targeting to hit enemies or heal friends with my lead toons target and if my focus does not have a living target it shields my focus with a shift:mod thrown in to shield the priest (this may not be needed for priest being lead toon etc.) and dead targets can be rez'd
(Disclaimer: I am at work so this macro may be typed incorrectly as I can't look at my macros right now, but you get the idea)
If it doesn't consider yourself as help then this would also solve my barkskin question.I already solved your barkskin problem in the other thread. It just takes a little bit of set up.
And there are NO unitID based conditionals, unfortunately you need to get creative with multiple buttons or modifiers to do what is being asked here.
There is no way to distinguish between yourself and a party member with conditionals.
vBulletin® v4.2.2, Copyright ©2000-2025, Jelsoft Enterprises Ltd.