This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Live
PTR
10.2.7
PTR
10.2.6
Beta
Need abit help with a /focus and /clearfocus macro.
Post Reply
Return to board index
Post by
572799
This post was from a user who has deleted their account.
Post by
Wikipedia
/clearfocus
/focus
This would be the same as 'cancelaura' macro. If you know what I'm talking about.
If it's a button you click you could use a 'btn:1'/'btn:2" modifier, or if you want; a shift modifier.
Post by
pelf
Hmm, the problem here being that you can move the focus from one thing to another, but actually making the second press clear it and
NOT
assign it to something else after that is hard.
Once the /focus or /clearfocus lines run, the next line in the macro will see the new state of the units. Really what you need to be able to do is something like...
if not UnitExists("focus") then
focus("target");
else
clearfocus();
end
...but that particular structure isn't (I don't think?) possible to reproduce with the
/focus
and
/clearfocus
slash commands.
Post by
213828
This post was from a user who has deleted their account.
Post by
Wikipedia
Yeah, you should be able to use something like it as a parameter.
/focus Kinda
edit.
just thought of one of my own macros.
#showtooltip
/clearfocus
/focus
/cast It's a close one..
Post by
pelf
Yeah, like I said, easy to make one that sets a new focus but hard to make one that clears one as well.
Post by
Wanderingfox
Hmm, the problem here being that you can move the focus from one thing to another, but actually making the second press clear it and
NOT
assign it to something else after that is hard.
Once the /focus or /clearfocus lines run, the next line in the macro will see the new state of the units. Really what you need to be able to do is something like...
if not UnitExists("focus") then
focus("target");
else
clearfocus();
end
...but that particular structure isn't (I don't think?) possible to reproduce with the
/focus
and
/clearfocus
slash commands.
Not really... Trying to /focus with no target will clear the focus :P I can't really think of a situation where you'd need to clear your focus (rather than changing it) without losing your current target. With that said, you really only need to set a keybind for /focus
Post by
pelf
I guess the situation would be the OP's request. I could maybe see it being nice if my focus keybind worked like that. I target something to focus, click it, I get a focus. Then, instead of having to clear my target, I can just hit my focus keybind again and it clears my focus. I'm pretty used to the existing behavior though, so I probably would just leave it.
All of this said, just using
modifier
/
mod
or
button
/
btn
would make this just work the way the OP wants, compromising just a bit.
Post by
SirPunky
/focus
Sets your focus to your current target (or clears your focus if you don't have a target) in one of the following situations:
You don't have a harmful focus (either it's friendly or doesn't exist)
Your current focus is dead
You are holding down a modifier key (in case you want to change your focus after you already have a valid one)
Post by
213828
This post was from a user who has deleted their account.
Post by
Wanderingfox
Not quite... See his edit.
Post by
pelf
Okay, so Punky's is kind of a sticky focus. I like that. It's not quite the toggle situation the OP asked for, but it's creative.
Post by
949814
This post was from a user who has deleted their account.
Post by
pelf
I
always
forget about the
none
unit. Also, the fact that that implicitly falls back on the default behavior of
/focus
when that first conditional doesn't pass is very sneaky. This is really cool.
It's equivalent to, but much cooler than...
/focus none; target
I approve and assign this a high level of sneakiness.
Sorry I bumped this. It is really cool.
Post by
HighFive
Not to mention it takes advantage of the way /focus is defined:SecureCmdList = function(msg)
if ( msg == "" ) then
FocusUnit();
else
local action, target = SecureCmdOptionParse(msg);
if ( action ) then
if ( not target or target == "focus" ) then
target = action;
end
FocusUnit(target);
end
end
end
For any other "@" than "@focus", /focus will ignore the action.
Also, why is this text so criminally sneaky? Didn't even see it at first glance.
Post by
pelf
\\ is the new bold smiley.
Post by
800521
This post was from a user who has deleted their account.
Post by
765310
This post was from a user who has deleted their account.
Post by
138583
This post was from a user who has deleted their account.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.