Action Targeting Macro

Hi there, I am playing a hunter and sometimes the new Action Targeting isn’t the best. I don’t want to constantly flip back into the options ui to enable / disable that. Is anyone familiar enough to write a macro using GetCVar / SetCVar (i mean I can do that part, i just dont know what the actual cvar is called). I tried getting advancedinterfaceoptions and searching for it but nothing is right for that that i can find.

2 Likes

softTargetEnemy

/run local k,v = "softTargetEnemy" v = C_CVar.GetCVar(k) C_CVar.SetCVar(k, 1 - v) print("Action Targeting " .. (v == "1" and "Disabled" or "Enabled"))

https://github.com/Gethe/wow-ui-source/blob/f0084386950fe3dc31a1d61de33b364e268cf66b/Interface/FrameXML/SettingDefinitions/Combat.lua#L123

3 Likes

What is that “softTargetEnemy” thing anyway. I saw it in AIO and it looks new.

That does it do, if anyone knows.

I assume it’s mostly intended for people playing with controllers.

Ah. So automation for console players.

This game is doomed if it ever jumps to Console for real.

It’ll just be another shooter then.

:slight_smile:

1 Like

Thanks much Elvenbane!

1 Like

I’ve tried this but it only disables ‘Enable Action Targeting’. I have to go back into options and uncheck/ check ‘Enable Action Targeting’ for it to work again.

1 Like

You should just need to press the button again.

1 Like

I do. Chat shows “Action Targeting Disabled” and “Action Targeting Enabled” when I click on the macro on my action bar.

If ‘Enabled Action Targeting’ is already checked in options and I then use the macro, it will disable able Action Targeting. Note: it does not uncheck ‘Enabled Action Targeting’ in my options.

If I click the macro again, it does not enable ‘Enabled Action Targeting’ . The check mark for ‘Enabled Action Targeting’ is still check in my options.

I have to uncheck/ recheck the ‘Enabled Action Targeting’ in options before it will work again.

Not sure if I’m doing something wrong or maybe an addon?

So looks like SoftTargetEnemy has 4 states: 0: off, 1: Gamepad, 2: Keyboard, 3: Always

/run local k,v = "SoftTargetEnemy" v = GetCVar(k) SetCVar(k, (v == "0" and 3 or 0)) print("Action Targeting " .. (v == "0" and "Enabled" or "Disabled" ))

[added]
Still doesn’t seem to toggle the Enable Action Targeting checkbox in the UI unless you do a ReloadUI

If you care about the checkbox (doesn’t actually affect functionality).

/run local k,v = "SoftTargetEnemy" v = GetCVar(k) SetCVar(k, (v == "0" and 3 or 0)) print("Action Targeting " .. (v == "0" and "Enabled" or "Disabled" )) ReloadUI()
2 Likes

Credits to Elvenbane for explaining to me how it all works. Here are the macro commands to enable action targeting:

/console SoftTargetEnemy 3

as well as to disable action targeting:

/console SoftTargetEnemy 0

For easy toggling action targeting on and off with a single macro. Mouse left-click to enable, and right-click to disable:

/console SoftTargetEnemy 3
/stopmacro [button:1]
/console SoftTargetEnemy 0
3 Likes

I 'm happy I came back to check on any update. Thanks Aphroditie, this works great.

1 Like

Sorry for necroing this thread but is there a way to use the console commands in such a way that i at least dont have to use modifiers to make it toggle?

This one doesn’t require modifiers.

Sadly that one doesn’t work, for some reason SetCVar doesn’t work with that specific CVar it seems. If you do a ConsoleExec it does, but i can’t seem to get the code right to switch between 0 and 3. If you use SetCVar you have to reloadui for it to even function at all, but ConsoleExec doesn’t seem to have that same problem.

Finally after a ton of trys getting this darn thing to work i have gotten one that seems to function without a reload.

/run local k="SoftTargetEnemy" x=GetCVar v=x(k) z=ConsoleExec if (v=="0") then v="3" else v="0" end r=k .. " " .. v z(r) v=x(k) print("Action Targeting " .. (v=="0" and "Disabled" or "Enabled" ))
1 Like

If you wanna go that route the simplest modification would be:

/run local k,v = "SoftTargetEnemy" v = GetCVar(k) ConsoleExec(k .. ' ' .. (v == "0" and 3 or 0)) print("Action Targeting " .. (v == "0" and "Enabled" or "Disabled" ))

I’m not seeing any functional difference between the two though. They both change the SoftTargetEnemy CVar to the desired value without updating Interface > Combat > Enable Action Targeting checkbox.