Page 1 of 1

Targeting Macro Question

Posted: Mon Jan 10, 2011 4:57 am
by Araela
Greetings all,

I use NPCscan, but like many of you I also use the "old fashioned" macro to find various NPCs.

After some modifications of a regular old targeting macro I found for the Turkey Lurker achievement about a year ago, I wanted to display what I currently have in my targeting bar (although I have all of these rare pets, I keep a lookout for friends)

/cleartarget
/tar Terrorpene
/tar Sambas
/tar Karoma
/tar Ghostcrawler
/tar Jadefang
/tar Madexx
/tar Baradin
/target Mysterious Camel Figurine
/run SetRaidTarget("target", 1)
/stopmacro [noexists]
/w Araela You've Found! >

You will notice that I have Baradin in there at the end- this used to be the "Wild Turkey" instead but obviously I have changed it since I'm not looking for Turkies.

My question is, with this macro and the way it is set up, I am unable to have it skip over a target if that target is dead. Thus, if I just spam "Baradin" it will target a Baradin Fox corpse or live animal, depending on what is nearby.

Any super macro people have an idea of how to fix this so it skips over corpses?

Thank you!

Re: Targeting Macro Question

Posted: Mon Jan 10, 2011 5:00 am
by Vephriel
I'm certainly no expert in macros, I'm not sure if it's possible to specify a live or dead target. I do know that a targetting macro will always choose a living target over a dead one if both are in range, so if you target a dead one then you know for sure there isn't a live one near you.

Re: Targeting Macro Question

Posted: Mon Jan 10, 2011 5:52 am
by Araela
Excellent thank you! I did not know that.

Re: Targeting Macro Question

Posted: Mon Jan 10, 2011 8:33 am
by Anyia
Building on what Veph said, that means that you can add a line before the /run SetRaidTarget(...) to say:
/cleartarget [dead]
That way you treat a dead target as a non-existent target (since you would untarget it again before you do the "interesting" bits in the macro).

Re: Targeting Macro Question

Posted: Mon Jan 10, 2011 10:00 am
by Worba
Cathyliz7 wrote:Greetings all,

I use NPCscan, but like many of you I also use the "old fashioned" macro to find various NPCs.

After some modifications of a regular old targeting macro I found for the Turkey Lurker achievement about a year ago, I wanted to display what I currently have in my targeting bar (although I have all of these rare pets, I keep a lookout for friends)

/cleartarget
/tar Terrorpene
/tar Sambas
/tar Karoma
/tar Ghostcrawler
/tar Jadefang
/tar Madexx
/tar Baradin
/target Mysterious Camel Figurine
/run SetRaidTarget("target", 1)
/stopmacro [noexists]
/w Araela You've Found! >

You will notice that I have Baradin in there at the end- this used to be the "Wild Turkey" instead but obviously I have changed it since I'm not looking for Turkies.

My question is, with this macro and the way it is set up, I am unable to have it skip over a target if that target is dead. Thus, if I just spam "Baradin" it will target a Baradin Fox corpse or live animal, depending on what is nearby.

Any super macro people have an idea of how to fix this so it skips over corpses?

Thank you!
I'm another longtime NPC_Scan holdout (although I have poked around its source code as I think it's neat how they got that to work); try this

/cleartarget
/tar Terrorpene
/tar [dead] Sambas
/tar [dead] Karoma
/tar [dead] Ghostcrawler
/tar [dead] Jadefang
/tar [dead] Madexx
/tar [dead] Baradin
/tar [dead] Myster
/stopmacro [noexists]
/run SetRaidTarget("target", 1)
/w Araela You've Found! >

The above will skip to the next target if the current one is dead, and I've confirmed this all fits within 255 chars (I shortened the last target name a bit to save space - when targeting you can use truncations and it will still work, as long as they remain unique for the area you will be searching)

Hope this helps :)

Re: Targeting Macro Question

Posted: Mon Jan 10, 2011 10:04 am
by Worba
Sometimes using conditionals with /tar can be buggy, so if you run into trouble with that, you can try this (will just fit):

/cleartarget
/tar Terrorpene
/target [dead] Sambas
/target [dead] Karoma
/target [dead] Ghostcr
/target [dead] Jadef
/target [dead] Madexx
/target [dead] Barad
/target [dead] Myster
/stopmacro [noexists]
/run SetRaidTarget("target", 1)
/w Araela You've Found! >

BTW cool use of SetRaidTarget