Storing a Target Name

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Sandypants
decaying skeleton
decaying skeleton
Posts: 8
Joined: Fri Dec 16, 2011 12:23 am

Storing a Target Name

Post by Sandypants » Fri Dec 16, 2011 2:07 pm

I need to know if there is a way, and how, to store specific mob name information.

For example, say I'm surrounded by five An Inferno Goblin mobs.

I want my mage to assist my tank, do his nuking thing, but then if my mage's pet's HP goes down to a certain point, I want him to target his pet and cast a heal. Then target his original mob and get back to nuking.

Is storing ${Target.Name} good enough? Or will that target the nearest Goblin?

I'm also not sure how to store a string in a variable. Will a simple /varset do the trick?

So:

Code: Select all

/declare targetname string

:nukeandhealloop

/if (${Me.Pet.PctHPs} < 70){

/varset targetname ${Target.Name}

/target ${Me.Pet}
/call HealPet

/target targetname
/goto :nukeandhealloop
} else {
/call Nukem

/goto :nukeandhealloop

}

Gomer
a snow griffon
a snow griffon
Posts: 304
Joined: Fri Apr 15, 2005 2:38 pm

Re: Storing a Target Name

Post by Gomer » Fri Dec 16, 2011 2:17 pm

Use IDs not names.

Sandypants
decaying skeleton
decaying skeleton
Posts: 8
Joined: Fri Dec 16, 2011 12:23 am

Re: Storing a Target Name

Post by Sandypants » Fri Dec 16, 2011 2:27 pm

Ah, thanks.