PDA

View Full Version : IfExists Check - Will this work?



Zzyzxx71
10-14-2009, 10:53 AM
What I'm looking for is a way to do an "IfExists" check on the current target. The goal here is to differentiate between when the tank is leader, and when I'm just running 4 shammies in BG's.

The goal is to cause spells to FAIL when the tank is in group and leading (and targetted - it's a nofocus thing), but to SUCCEED when anyone other than the tank is leading.

/clearfocus
/focus Teezee
/stopmacro [focus]
/cast [target=targettarget] [] Chain Lightning

Logic here is...

Clear Focus
Focus Teezee (if he's not there, he won't be focused)
Stop the macro if something is focused...
Else..
Cast Pew Pew...

That look right? I'm pretty sure I haven't broken any rules as far as conditions...

Zzyzxx71
10-14-2009, 11:01 AM
Good resource - didn't know it exists, apparently /stopmacro doesn't like [focus], but I'm sure theres a way to check and see if I have a focus...

Edit:

/clearfocus
/focus Teezee
/stopmacro [target=focus,exists]
/cast [target=targettarget] []Chain Lightning

Is supposed to work like a champ.. time to start writing macros for BG's!

Bettysue
10-15-2009, 08:27 PM
Ifexists sort of already exists in the wow macro API, and you could have your shaman do something different when the tank exists, in the example below they cast LB on your leaders target when he's not around or doesn't have a target, and FS on the tank target when he is there and has a target. I used these 2 spells so you could see the difference, you could use the same spell if desired.

/clearfocus
/focus Teezee
/cast [target=focustarget] Flame Shock; [target=targettarget] []Chain Lightning

You could replace flame shock with null and the macro will do nothing whenever, they try to attack the tank target. Or you could just put [target=focus] Null, and it would do nothing as long as you had a focus.

Anyway the [exists] parameter you found checks for the existence of a valid target for the spell, however, it is often a redundant and unnecessary parameter, [target=focus,exists] will fail every time [target=focus] would. [exists] is usually used for targeting when it's likely the team member will be offline...for instance a char used to boost is checked for, and if not present the online chars follow the normal leader.

/target [exists] Booster; NormalGuy
/follow

that macro would be such a case.

Zzyzxx71
10-16-2009, 09:02 AM
Good point on the null - The purpose for them to do nothing is I have keys reserved for tanking functions only (charge, taunt, primarily) but want to use those buttons for other functions when the tank is not leading (i.e. BGs, PVP) such as the opportunity for a good chain lightning or frost shock.