View Full Version : Macro that if targeting self use barkskin, if targeting another player then heal
Owltoid
12-24-2008, 12:38 PM
I'm currently multiboxing with three moonkins using an FTL setup through HotKeyNet. Often in a PvE environment one of my moonkins pulls the aggro and I would like to heal using the other two moonkins. Currently whomever I choose to heal all three moonkins will shapeshift and start casting a heal at that target. What I would like to do is have a macro that tests to see if the target to be healed is itself... if so, then I want to stay in moonkin form and just cast barkskin while the other two shapeshift and heal.
My current macro is:
MACRO 12 "Healing Touch" Spell_Nature_HealingTouch
/assist [mod:ralt,mod:rctrl]Owltoid;[mod:ralt,nomod:rctrl]Owlive;[nomod:ralt,mod:rctrl]Weirdowl
/cast Healing Touch(Rank 12)
Using the FTL setup I just have the different mods being sent depending on which WoW window is active at the time. If we assume Owltoid is the active, and we assume that Weirdowl is the target taking damage, then how can I add the conditional statement so that both Owltoid and Owlive heal Weirdowl while Weirdowl casts barkskin (staying in moonkin form)? I'm hoping that this works since I plan to use in PvP as well.
Owltoid
12-24-2008, 12:41 PM
To help clarify a little bit, is there any way that Weirdowl can check to see if his current target is himself? If he is targeting himself, then cast barkskin. If he is targeting something else, then cast healing touch.
Zzyzxx71
12-24-2008, 12:57 PM
/cast [target=player] barkskin; [target=help]Healing Touch(Rank 12); [target=harm] PEWPEWPEW
First checks to see if you're targetting you - if so, barkskin... if not, checks to see if target is help, healing touch... you could also add if your target is a baddy, then DIE DIE DIE.
Disclaimer - untested, I'm bored and at work.
Owltoid
12-24-2008, 01:00 PM
/cast [target=player] barkskin; [target=help]Healing Touch(Rank 12); [target=harm] PEWPEWPEW
First checks to see if you're targetting you - if so, barkskin... if not, checks to see if target is help, healing touch... you could also add if your target is a baddy, then DIE DIE DIE.
Disclaimer - untested, I'm bored and at work.Thank you! I thought it may be something relatively basic, and I hope this works. For some reason I thought the [target=player] actually sets the target to the player instead of just a conditional true/false. If this works then it should be some easy tweaks to incorporate into FTL and then I'm off. Thanks again!
Owltoid
12-24-2008, 01:01 PM
Since I'm also at work, do you know offhand if the [target=self] is an actual command? I'm trying to keep my macro file identical for the three druids and if I can avoid Weirdowl's macro looking like [target=Weirdowl] the it would be preferable.
Zzyzxx71
12-24-2008, 01:07 PM
I know that [target=player] is used in many self bandage macros for warriors (concussion blow, immediately target self, use bandage kinda thing) so no reason I can see it wouldn't apply here.
Owltoid
12-24-2008, 01:12 PM
I know that [target=player] is used in many self bandage macros for warriors (concussion blow, immediately target self, use bandage kinda thing) so no reason I can see it wouldn't apply here.Ah, I was thinking that "player" meant enter "Weirdowl" in the "player" spot. Instead it seems that it means what I was hoping when I mentioned [target=self]. Thanks again for the help! Damn holidays/girlfriend commitments will keep me from testing it out for a couple days. Merry f'n Christmas! :D
Owltoid
12-24-2008, 03:47 PM
Unfortunately [target=player] does not work. I think the problem is that the brackets contain true/false statements. The setting of target=player just automatically sets the current target to the player instead of checking to see if it's true. For instance, I think this would always fail [target=player,harm] because it returns a [true, false] since setting the target to player is allowed, but now that player is not a harmful target. I have to log, but does anyone know how to add contitional statements to check to see if the target is myself? If so, cast barkskin, if not, cast heal?
Thanks!
elsegundo
12-24-2008, 04:14 PM
just use mod:alt
or mod:shift
or mod:ctrl.
no need to actually target myself. saves me so much time.
Owltoid
12-25-2008, 12:51 AM
just use mod:alt
or mod:shift
or mod:ctrl.
no need to actually target myself. saves me so much time.
Thanks for trying to help, but I don't think you're talking about doing the same thing as I am. I'm trying to figure out a way to build a macro so that it's smart enough to know if the player is targeting themself. Since I don't know which of the three druids is going to take damage (from either aggro or in PvP who they're focus firing) I want the macro to be smart enough to say "I was told to cast a healing spell on myself. Instead of doing that I will cast barkskin and therefore retain the armor bonus from moonkin form while the other two druids heal me." Yes, I could keybind my healing touch three different ways so that if I'm quick enough I can push the right button and heal the guy getting hurt, but I'd rather have one healing touch button and have the druids figure out if they're supposed to be the target of the heal or if they're supposed to heal something else.
I know there must be a way, but I don't know if it will involve /script. I'm hoping for some advanced macro help.
Thanks!
Sam DeathWalker
12-25-2008, 12:56 AM
http://www.wowwiki.com/Complex_heal_macro_notes
/script if (UnitName("target") ~=nil and UnitIsFriend("player","target")) then CastSpellByName("Healing Touch(Rank 9)") SendChatMessage("Healing %T", "Party") else TargetUnit("player") CastSpellByName("Healing Touch(Rank 9)") TargetLastEnemy(); end
You should be able to do as you want by modifying the above.
Something like:
/script if UnitName("target") =yurname then ... else castspellbyname
Anyway this is the key:
http://www.wowwiki.com/Talk:API_UnitName
Owltoid
12-25-2008, 01:02 AM
http://www.wowwiki.com/Complex_heal_macro_notes
/script if (UnitName("target") ~=nil and UnitIsFriend("player","target")) then CastSpellByName("Healing Touch(Rank 9)") SendChatMessage("Healing %T", "Party") else TargetUnit("player") CastSpellByName("Healing Touch(Rank 9)") TargetLastEnemy(); end
You should be able to do as you want by modifying the above.Wow, many thanks Sam! Happy holidays all!
Owltoid
12-25-2008, 01:49 AM
Damn, it looks like Blizzard removed the ability to cast spells using a conditional statement. In other words, the CastSpellByName doesn't seem to work if nested in an if statement.
I'm trying to figure out a way out of this problem. For example, I'd be fine if I couldn't cast Barkskin. Really what I want is for that druid who needs healing to ignore the heal command so he doesn't shapeshift out. The only way I can think is to check if the player targeted equals self (using the /script command mentioned) and if so then exit out of the macro. However, I don't know how to call "/stopmacro" from the script command.
Any idea?
Sam DeathWalker
12-25-2008, 04:31 PM
/click ?
Bettysue
12-25-2008, 07:57 PM
You can't use if statements, or castspellbyname while in combat. The best way you can achieve what you want to do is using another level of target target. In the FTL system you usually have the concerned character find the target of his spell by asking for the target of another character. Now you have 1 thing working for you here, barkskin can only be cast on yourself. In order to achieve what you want to do you may have to turn off the auto self cast option. Then use the following macro
/target [mod:alt,mod:ctrl]Owltoid;[mod:alt,nomod:ctrl]Owlive;[nomod:alt,mod:ctrl]Weirdowl
/cast [target=targettargettarget,help] Barkskin; [help][target=targettargettarget][target=targettarget] Healing Touch; [target=targettarget,harm] Moonfire
/targetlasttarget
What will happen is it will find the target selected in the assist line and find his target, then it will look at the target of that target, if it's helpful it will cast barkskin. The ability to cast barkskin would only occur in 2 situations, the main is targeting themself, or the main is targeting the dps target and the dps target is now targeting the guy who just pulled aggro.
The other druids would have a false in that step and would move on to the next conditional and cast Healing Touch on the newly barkskinned druid. If you switch targets to the druid with aggro they will still be able to cast healing Touch because of the second check in the second part. If they can't find someone to heal they will revert to a druids real purpose in life moonfire spam on the red guys :D
The third line just makes the druid target the last thing he was targeting before trying this heal/barkskin business. You can omit this line with no consequence. Oh and make note of the /target vs /assist in the first line, this will make it work, /assist may not.
Feel free to change the names of spells and whatnot, Im not a druid and that's the spells I could remember offhand. I didn't try this macro in WoW so if it's too long take out the first line and place that in it's own macro, then drag that macro to the furthest righthandside vertical bar's top button and put "/click MultiBarRightButton1" in as the first line.
I use key clone for my FTL set up, but I would think HKN would have the ability to do key mappings like KeyClone does.
That being said, I would set up two buttons on each druid
Macro1 (bound to key 1)
/cast barkskin
Macro2 (bound to key 2)
/cast [mod:CTRL,nomod:ALT,nomod: SHIFT,target=ToonA][nomod:CTRL,mod:ALT,nomod: SHIFT,target=ToonB][nomod:CTRL,nomod:ALT,mod: SHIFT,target=ToonC]
Healing Touch
Then would make the following key map
ToonA
1 -> Barkskin
Alt+2 -> Barkskin
Shift+2 -> Barkskin
ToonB
1 -> Barkskin
CTRL+2 -> Barkskin
SHIFT+2 -> Barkskin
ToonC
1 -> Barkskin
CTRL+2 -> Barkskin
ALT+2 -> Barkskin
This way, which ever your "leader" character is would barkskin, the other two would heal it.
Golle
12-26-2008, 03:08 PM
http://www.wowwiki.com/Complex_heal_macro_notes
/script if (UnitName("target") ~=nil and UnitIsFriend("player","target")) then CastSpellByName("Healing Touch(Rank 9)") SendChatMessage("Healing %T", "Party") else TargetUnit("player") CastSpellByName("Healing Touch(Rank 9)") TargetLastEnemy(); end
You should be able to do as you want by modifying the above.
Something like:
/script if UnitName("target") =yurname then ... else castspellbyname
Anyway this is the key:
http://www.wowwiki.com/Talk:API_UnitNameCastSpellByName has been disabled by blizzard. Same thing with TargetUnit.
Owltoid
12-29-2008, 11:54 AM
You can't use if statements, or castspellbyname while in combat. The best way you can achieve what you want to do is using another level of target target. In the FTL system you usually have the concerned character find the target of his spell by asking for the target of another character. Now you have 1 thing working for you here, barkskin can only be cast on yourself. In order to achieve what you want to do you may have to turn off the auto self cast option. Then use the following macro
/target [mod:alt,mod:ctrl]Owltoid;[mod:alt,nomod:ctrl]Owlive;[nomod:alt,mod:ctrl]Weirdowl
/cast [target=targettargettarget,help] Barkskin; [help][target=targettargettarget][target=targettarget] Healing Touch; [target=targettarget,harm] Moonfire
/targetlasttarget
What will happen is it will find the target selected in the assist line and find his target, then it will look at the target of that target, if it's helpful it will cast barkskin. The ability to cast barkskin would only occur in 2 situations, the main is targeting themself, or the main is targeting the dps target and the dps target is now targeting the guy who just pulled aggro.
The other druids would have a false in that step and would move on to the next conditional and cast Healing Touch on the newly barkskinned druid. If you switch targets to the druid with aggro they will still be able to cast healing Touch because of the second check in the second part. If they can't find someone to heal they will revert to a druids real purpose in life moonfire spam on the red guys :D
The third line just makes the druid target the last thing he was targeting before trying this heal/barkskin business. You can omit this line with no consequence. Oh and make note of the /target vs /assist in the first line, this will make it work, /assist may not.
Feel free to change the names of spells and whatnot, Im not a druid and that's the spells I could remember offhand. I didn't try this macro in WoW so if it's too long take out the first line and place that in it's own macro, then drag that macro to the furthest righthandside vertical bar's top button and put "/click MultiBarRightButton1" in as the first line.
Wow, this is a very interesting idea. Thank you! I appreciate the help of other posters in this thread, but a couple have mentioned using alternate keys for depending on who I'm healing or assuming that my current lead toon is the one getting damage... that's not exactly what I was asking for.
I tried out your macro, Bettysue, with a few modifications. It seemed to work well for the first heal. It didn't matter who I targeted, the "healed" would cast barkskin and the "healers" would cast the heal correctly. However, after the first button push all would continue to try to cast barkskin instead of healing.
I'm really using this for arena and I'm second guessing my original attempts. I think that your idea may actually work well enough. I mean lets be honest, if I'm trying to heal the whole time then I'm screwed anyway. I haven't decided if I'm going to keep starfall or go with a nature swiftness build for some instant healing. If I go with the instant healing, then I'll likely use your macro since I'll only allow myself one massive quick heal and then back to DPS.
Bettysue
12-29-2008, 04:07 PM
Changing the following section:
[help][target=targettargettarget][target=targettarget] Healing Touch
to:
[target=targettargettarget,help][target=targettarget,help] Healing Touch
may remedy the screwy one heal Imma stand there thing. I'll try it on my shamans with a different spellset of course to make sure it works but there really is no reason it shouldn't work that way. Don't forget a /stopcasting at the beginning if you want to use it as an emergency heal. Anywho (no pun intended) good luck :D
Ualaa
12-29-2008, 08:52 PM
My heals are mostly:
/cast [help] Heal Spell; [help, target=targettarget] Heal Spell; [target=player] Heal Spell.
Not sure if you could have different spells in there depending on target.
Bettysue
12-30-2008, 09:12 AM
If you use the same spell in all 3 places you could reduce your macro to
/cast [help][help, target=targettarget][target=player] Heal Spell
or using it as you have it
/cast [help] Heal Spell; [help, target=targettarget] Heal Spell; [target=player] Heal Spell
it could be
/cast [help] Heal Spell; [help, target=targettarget] Big Heal Spell; [target=player] Quick Heal Spell; [harm] Attack
of course it would never get to the attack in this case but you get the idea.
Owltoid
12-30-2008, 12:08 PM
If you use the same spell in all 3 places you could reduce your macro to
/cast [help][help, target=targettarget][target=player] Heal Spell
or using it as you have it
/cast [help] Heal Spell; [help, target=targettarget] Heal Spell; [target=player] Heal Spell
it could be
/cast [help] Heal Spell; [help, target=targettarget] Big Heal Spell; [target=player] Quick Heal Spell; [harm] Attack
of course it would never get to the attack in this case but you get the idea.I'm sorry, but I'm a bit confused. Are you responding to Ualaa's post or is this about the barkskin/heal question? If I'm reading your post correctly, then as long as I'm targeting a friendly unit (which could be myself) then it would cast heal... not what I was intending at all.
Owltoid
12-30-2008, 12:47 PM
I'm at work so I can't test this macro out. However, I'm more interested in the logic and structure.
Scenarios: players AAA, BBB, CCC
AAA is master
BBB, CCC are slaves
Macro for all toons:
/assist AAA
/cast [help,target=targettarget]Barkskin; [help,target=targettarget] Healing Touch(Rank 14)
Scenario 1: AAA needs heals
I am controlling AAA and highlight AAA in WoW. Then I run the macro.
AAA assists AAA which leads to his target being AAA. AAA casts Barkskin at the target which is successful and the macro completes
BBB assists AAA which leads to his target being AAA. Now comes the confusing circle part. The target of AAA is AAA, and the target of AAA is AAA. BBB attempts to cast Barkskin on AAA which fails.*** Since the first part fails it goes to the second part which is to cast healing touch at AAA. This part succeeds.
CCC does the same thing as BBB.
***I'm not sure if Barkskin will actually fail. I have auto-selfcast turned off and I believe it does work the first time, but repeated mashing fails.
Scenario 2: BBB needs heals
I am controlling AAA and I highlight BBB in WoW. Then I run the macro.
AAA assists AAA which leads to his target being BBB. The problem is I'm not sure who BBB is targeting at the moment because it depends on how quickly the macro is being executed on BBB. If BBB macro is running fast enough, then BBB has already gone through the "assist" part and is properly targeting himself (BBB). If the macro is too slow, then BBB could be targeting XXX and who knows who XXX is targeting.
If BBB is correctly assisting AAA and therefore targeting BBB, then I believe everything would work fine.
Hmmm, so stepping through the proccess leads me to believe that I need to hit two buttons. One to cause everyone to assist the leader and a second to run the barkskin/healing macro. I think the problem is that since I'm using target's target I need to make sure that everyone is on the same page before continuing.
Any thoughts, Bettysue? I tried walking through the "/target" in the first line instead of the "/assist" but I ran into the same problem... I don't know who the slaves are targeting at that exact moment in time if their macro hasn't updated quicklky enough.
Golle
01-01-2009, 09:12 PM
/cast [help,target=targettarget]Barkskin; [help,target=targettarget] Healing Touch
It will never cast Healing touch. First, the IF-statements are exactly the same, which will make the 2nd statement fail if the 1st did. Secondly, the macro will never be able to cast Healing Touch since when Barkskin is on cooldown it will say "Spell is not ready" and the macro will stop. It doesn't automatically go to the next spell in the chain.
Blizzard have been smart enough to remove all the features in which when you target a special person a special spell will be cast. I believe the only way to make sure the correct character cast barkskin is to either use modifiers or a button for each character.
Bettysue
01-03-2009, 06:18 PM
Yes my previous reply was in response to Ualaa sorry for the confusion...
Golle it does cast Healing touch if the first one fails. This is because Barkskin can only be cast on yourself, it's and instant cast meaning it can be cast in the same line as a global cooldown triggering spell, if and only if the barkskin cast fails. The logic here is all toons target a mob, the mob targets toonA, press your button and toonA will cast barkskin on the targets target or in this case himself. ToonB will attempt to cast Barkskin on an invalid target (toonA) and will then cast the healing touch on the targets target or toonA. This works fine for me so not sure what is causing the problem for you. This only works for spells that are selfcast only. Other spells will do exactly what you stated and fail. You will also have a problem where toonA will continually try to cast Barkskin on himself because he is a valid target for the spell on cooldown which will exist the macro. This means it's a great "emergency" heal macro, not really a spam heal macro.
Ghallo
01-03-2009, 11:30 PM
The problem is that any conditional you have will be True in the situations you have described:
[help] - this checks if the target is friendly to you... if you have yourself targeted it will evaluate to true
[party] - this checks if the target is in your party ... same as above
[target = player] - this is not a conditional, this is an assignment so you could do the following:
/cast [harm] Moon Fire; [target = player] Barkskin
This would cast Moon Fire if you had something harmful targeted, otherwise it would cast Barkskin on your toon. The reverse, however, would not work:
/cast [target = player] Barkskin; [harm] Moon Fire
This would only ever cast Barkskin, because there isn't a conditional happening (and you can only cast 1 spell in a macro).
I hope that clarifies some limitations to the macro system.
Ualaa
01-04-2009, 03:49 AM
The game reads conditions, left to right, and goes with the first one which is true or doable.
In the case of: /cast [help, target=targettarget] Barkskin .... this is only true if the targettarget is the casting player, because barkskin is self cast only.
If you want Heal on another target or barkskin on yourself, go with something like:
/assist [target=party1]
/cast [help] Heal Spell; [help, target=targettarget] Heal Spell; [target=player] Barkskin.
Clicking this and your toon assists the party leader (or the current focus (ie /assist focus) if that is how you determine assists). If the target is friendly, it casts the heal. If the target is not friendly, it moves on to the second target sequence, which is the heal spell on the target of the target. This will almost always return as true, because your party leader will be targeting a hostile who in turn targets someone hostile to them but friendly to you. If both of these conditions are false (ie, assist's target is hostile and that creature's target is also hostile to you), it defaults to you casting barkskin on yourself.
To have a spell cast Barkskin on yourself but another spell on someone else, you need a logic arguement where the (targeting for the) spell to be cast on someone else will not be true when you are the target, but will be true for someone else. I'm not sure how this would work, but you'd need to use logic to that effect.
Shavi
01-14-2009, 09:57 PM
I think you can use something near [Stance=1] barksin
i remember seen it somewhere.
elsegundo
01-15-2009, 03:31 PM
I think you can use something near [Stance=1] barksin
i remember seen it somewhere.that would have been great in 2.4, but now we're able to use barkskin in form. so.... back to square one. =/
vBulletin® v4.2.2, Copyright ©2000-2025, Jelsoft Enterprises Ltd.