Is that possible to use a var name after a /target command in a macro? Example:
/run mobname = "Hermit Crab";
/target mobname
In this example, target is searching for a mob called “mobname” instead of Hermit Crab. I’m almost sure I can’t use target with a var, but to make sure I’d thought about asking here.
It’s because I have a target macro and every time I’m farming mobs, I need to open this macro, edit the target name, save, etc… I know, not a big deal, but by using a var, I could do a /run mobname = "Hermit Crab" on the chat and the macro would be adjusted for the kind of mob I need.
I find it very strange that both of the two most highly respected posters on this forum: Fizzlemizz and Elevenbane, were unable to correctly address this simple maco request.
This is the macro you are looking for, simply name your macro “target” and paste the following code:
/run if SecureCmdOptionParse("[mod:ctrl]") then local t,n=UnitName("target"),"target" local b=GetMacroBody(n) EditMacro(n,n,nil,strsub(b,1,strfind(b,"\n")).."\n/target "..t) end
/target x
Hold Ctrl and use the macro to set the target’s name, after that every subsequent use will target that same name. It will not work in combat.
There is a greater issue here that appears to be that this macro forum is being deliberately sabotaged in an attempt to hide or restrict certain functionality.
This is not a difficult macro. It does not require an addon. Both Fizzlemizz and Elevenbane were more than capable of posting this solution. Why didn’t they?
If anyone has any idea why these “respected” forum members are choosing to stonewall certain macro requests, please share. I would greatly appreciate it.
lol we’re not omniscient and there’s certainly no conspiracy to sabotage these forums, which are community driven. Fizzle and I are just regulars who enjoy helping people and have some knowledge and expertise to share, nothing more.
First, I’m still dirty at Blizzard for ‘cough’ loosing WoWI’s list of addon authors for Classic Beta invites (including mine). There’s stuff I wanted to get done before launch tomorrow that would have allowed me to just play without having to constantly check for bug reports. So not happy. Don’t miss-represent verbose-poster with “insider”.
Seriously, everything I post is done with the expectation someone else can/will know and show better. This thread is an example of that and, assuming your code works as intended (which I assume it does), it should have ended there.
To be cheeky, “take the win!”
Edit:
The idea that there is a “proper solution” to any given problem, especially where computer code is concerned, is more of a “conspiracy” than anything else in this thread.
If you see a problem, you fix it by coming here every day, day after day, and posting your best solutions to peoples problems like…
How do we target mobs that have similar name like “voidscale hydra” or “siltridge hydra” or Stonemaw Hydra" ?
I mean is there a way to target the closest of these tthree in a macro?
or is there a way to be able to target any one who is the closest one and that have in its name “Hydra”?
I dont knwo how LUA works but I guess from the pgramming that I know in other languages that it should be possible…
and also if I would like to learn more about LUA and be able to program my self where do you suggest me to start? and with wich tool?
Not in combat, no. You can chain a bunch of /tar name commands together and it’ll stop at the last one but there isn’t a way to do it by proximity, they killed that back in Wrath.