WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Macro Help (https://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   Conditional Spell macro (https://www.wowinterface.com/forums/showthread.php?t=47700)

Taoth 08-24-13 11:14 PM

Conditional Spell macro
 
Hey all, i'm looking to make a conditional macro and wondering if what I want is possible.

What I want the macro to be able to do is to cast Wind Shear on an arena1-3 target that is not my focus or my current target. Meaning that if I have arena1 targetted and arena2 on focus, it'll shear arena3, and then if say 20 seconds later I switch my focus to arena3 and then it'll shear arena2.

I thought "/cast [@arena#, notarget, nofocus] Wind Shear" would work but target and focus aren't conditionals >.<

Anyone know any conditionals that would prevent the cast if the intended arena# in the line was either my current target or focus?

Seerah 08-24-13 11:58 PM

No, you cannot compare targets in a macro and you cannot create *smart* macros for targeting. This would be akin to the macro making decisions for you.

You can assign each arena opponent to a different modifier in your macro and do the targeting logic yourself, however.

Malsomnus 08-25-13 06:45 AM

If you're interested in that sort of efficiency, you might as well consider having 3 Wind Shear buttons, one for each arena opponent ;)

Taoth 08-25-13 08:42 PM

I already have 2 and if there was a way to get what I wanted I would have a 3rd. The problem with just going straight 3 as arena1-3 is that those would not be applicable in the world, pve, or bgs. It is confusing to have to have a set of keys work one way in the world and then another in arena.

Current keys are the one @target and the one @focus. It is annoying to have to switch my focus for the rare occasional 3rd guy interrupt, as the speed of casts nowadays usually prevents it from working well anyways, and so I hoped for an option that would make getting that 3rd guy interrupt easier while still being dynamic enough for whenever the focus changes.

Thats why I wanted the conditional, because such a conditional would only be useful for only a 3rd target in the area, and thus isn't "smart" past the 3rd guy.


Unfortunately now i'm probably just going to have to make a 3rd macro specifically targeting the arena# and manually change that # every game. Close enough functioning, but just a major major pain in the ass.

Phanx 08-25-13 09:49 PM

You could also use Clique to bind, for example, middle-click to cast Wind Shear on enemy unit frames. Then you can just middle-click on any unit frame when you see a cast bar start on it, to cast Wind Shear on that unit.

elcius 08-26-13 06:23 AM

Quote:

What I want the macro to be able to do is to cast Wind Shear on an arena1-3 target that is not my focus or my current target. Meaning that if I have arena1 targetted and arena2 on focus, it'll shear arena3, and then if say 20 seconds later I switch my focus to arena3 and then it'll shear arena2.
It's certainly possible to do it, but not using a single macro, you need a macro for every unit comparison and one to swap the target and focus frames:

Code:

CreateFrame("BUTTON","SwapTargetFocus",nil,"SecureActionButtonTemplate"):SetAttribute("type","macro");
SwapTargetFocus:SetAttribute("macrotext",[[
/cleartarget [@focus,noexists]
/target focus
/targetlasttarget
/clearfocus [noexists]
/focus target
/targetlasttarget
]]);

local TestT = [[
/stopmacro [noexists][@focus,noexists]
/cleartarget
/targetlasttarget
/target arena%d
/targetlasttarget
/click [exists] __TestF%d
/targetlasttarget [noexists]
]];

local TestF = [[
/click SwapTargetFocus
/cleartarget
/targetlasttarget
/target arena%d
/targetlasttarget
/cast [exists] Wind Shear
/targetlasttarget [noexists]
/click SwapTargetFocus
]];

for i=1,3 do
        CreateFrame("BUTTON","__TestF"..i,nil,"SecureActionButtonTemplate"):SetAttribute("type","macro");
        _G["__TestF"..i]:SetAttribute("macrotext",TestF:format(i,i));
        CreateFrame("BUTTON","__Shear"..i,nil,"SecureActionButtonTemplate"):SetAttribute("type","macro");
        _G["__Shear"..i]:SetAttribute("macrotext",TestT:format(i,i));
end

/click __Shear1
/click __Shear2
/click __Shear3

this will shear the first unit (between arena1, arena2 & arena3) that is not currently your focus or target.
it requires that you actually have a focus and a target, and will probably do weird stuff if they are the same unit.


All times are GMT -6. The time now is 12:20 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI