Target Target's Pet

PumpThump

Member
Joined
Jan 28, 2011
Messages
603
Reaction score
5
Points
18
Age
37
I'm trying to figure out if it's possible to target your target's pet if your target has a pet. Any ideas?

Forgot to mention, I mean through a slash command or a short maccro. I'm making a healing maccro that will store the IDs of group members and their pets, so I want a quicker way of targeting a specific persons pet rather than double tapping a F# command.
 
Last edited:
If anything, it would be ${Me.TargetOfTarget.Pet.ID} or the same thing but different way: ${Spawn[${Me.TargetOfTarget}].Pet.ID}

but i honestly dont know that it would work.

Otherwise you could do a scan for all pets within a radius and see if any of them has your Target's Target as its master.
 
If I do the first one, then my target must be targeting their pet, correct?

I could potentially do the second if necessary.

Thanks!
 
Not sure if this will be helpful or not. You can use F1-6 keys to target a player in your group. If you hit F1-6 a second time, it will target this player's pet.

Perhaps if the player order in the group window matches the index for ${Group.Member[x]}, you can find out what "group slot" they are in and use /keypress command twice to target that player's pet.
 
Pete, I think you went one target to far hehe. Unless I'm misreading he want's the target's pet, not target of target.

If that is the case /target ID ${Target.Pet.ID}

That answers you question directly, however if you want to heal a group members pet, there is no reason to target the group member first. /target ID ${Group.Member[X].Pet.ID} this is assuming your macro has already checked via other methods and verified you needed to target the pet to heal it. If you are checking group members health by targeting them, that is unnecessary, there health is updated in the Group member object (${Group.Member[X].PctHPs}). Also check if they have a pet and if it needs to be healed using /if (${Group.Member[X].Pet.ID} && ${Group.Member[X].Pet.PctHPs} < ${HEALPCT}) {
 
Last edited:
doh. yes. i read target your target of target's pet. Target.Pet.ID is all he needed. i r can read gud!
 
Storing the IDs of the initial group isn't a problem. I have my healers macro working just nicely. On loading it cycles the F1 through F6 keys twice each and stores all PCs and Pets, and then runs a loop finding the lowest hp of all 12 possible targets, without having to target them to check hp, and heals it, or does a group heal if more than a couple need a heal. Here's my problem though. When a pet dies and is resummoned it's ID changes, so it has to be re-stored. My StoreIDs sub does just fine at restoring a single pet and only changing it's ID, but it has to cycle whole group of targets again and this can get distracting if the summoning is happening during a fight. This is my it would be nice to be able to target a specific ID's (PC's) pet and just store that ID than checking all 12 possible targets again. More efficient / Less time.

By the way, I love your bot macro Pete. I use it as a great resource on correct syntax and ideas of how to do things. However, I am running a full pet Tank/DPS group with the ability of Kite EXPing with my necro and so I need a very custom macro for all that :) That and I'm really enjoying going in depth into the macros.
 
Storing the IDs of the initial group isn't a problem. I have my healers macro working just nicely. On loading it cycles the F1 through F6 keys twice each and stores all PCs and Pets, and then runs a loop finding the lowest hp of all 12 possible targets, without having to target them to check hp, and heals it, or does a group heal if more than a couple need a heal. Here's my problem though. When a pet dies and is resummoned it's ID changes, so it has to be re-stored. My StoreIDs sub does just fine at restoring a single pet and only changing it's ID, but it has to cycle whole group of targets again and this can get distracting if the summoning is happening during a fight. This is my it would be nice to be able to target a specific ID's (PC's) pet and just store that ID than checking all 12 possible targets again. More efficient / Less time.

By the way, I love your bot macro Pete. I use it as a great resource on correct syntax and ideas of how to do things. However, I am running a full pet Tank/DPS group with the ability of Kite EXPing with my necro and so I need a very custom macro for all that :) That and I'm really enjoying going in depth into the macros.

You can completely remove the storing of the IDs and just use the Group object to do all of that dynamically and not have to worry about pet ids changing:

Simple Example with what you said (comments in the code to explain if you have questions feel free to ask) possibly typos in this since I just wrote it on the fly lol:
Code:
/declare lowHP int local 100
/declare lowHPID int local 0
/declare needHeal int local 0

/for x 0 to ${Group.Members}
	/if (${Group.Member[${x}].ID} && ${Group.Member[${x}].Type.NotEqual[CORPSE]} && ${Group.Member[${x}].Distance} < 200) {
		| Group member is in the zone, not a corpse, and in range to heal
		| If below 60 count as needing a heal for group heal count
		/if (${Group.Member[${x}].PctHPs} < 60) /varcalc needHeal ${needHeal} + 1
		| If lower than the lowest HP set as the lowest HP
		/if (${Group.Member[${x}].PctHPs} < ${lowHP}) {
			/varset lowHP ${Group.Member[${x}].PctHPs}
			/varset lowHPID ${Group.Member[${x}].ID}
		}
		| Check the group member pet for lowest hp if it exists
		| Does not check for group heal count since group heals do not effect pets
		/if (${Group.Member[${x}].Pet.ID} && ${Group.Member[${x}].Pet.PctHPs} < ${lowHP}) {
			/varset lowHP ${Group.Member[${x}].Pet.PctHPs}
			/varset lowHPID ${Group.Member[${x}].Pet.ID}			
		}
	}
/next x

/if (${needHeal} >= 2) 
{
	| Use group heal if 2 or more members need a heal (hp below 60)
	/cast "GROUP HEAL SPELL"
} else /if (${Spawn[${lowHPID}].ID} && ${Spawn[${lowHPID}].Type.NotEqual[Corpse]} && ${Spawn[${lowHPID}].PctHPs} < 80 && ${Spawn[${lowHPID}].Distance} < 200) {
	| Heal the low hp if they are targetable, within range, not a corpse, and low enough to actually need a heal 
	| (assuming a 200 range on heal spell, can change it to get the actual heal spell range if you want)
	/squelch /target ID ${lowHPID}
	/delay 2s ${Target.ID}==${lowHPID}
	| Make sure we actually have the correct target
	/if (${Target.ID}==${lowHPID}) /cast "HEAL SPELL"
}
 
Last edited:
Nice, thank you Devestator! Does exactly what my code does but without storing IDs and with half the lines (if not less!) lol. Question though. When checking a group member pet's hp, should it be...

${Group.Member[${x}].Pet.PctHPs not ${Group.Member[${x}].PctHPs?
 
Nice, thank you Devestator! Does exactly what my code does but without storing IDs and with half the lines (if not less!) lol. Question though. When checking a group member pet's hp, should it be...

${Group.Member[${x}].Pet.PctHPs not ${Group.Member[${x}].PctHPs?

Yes it should be .Pet.PctHPs, should also be .Pet.PctHPs on the varset of lowHP, and lowHPID. That is what I get for using copy and paste while coding on the fly hehe. Sorry I'll correct that in the other post in case anyone else references it.
 
Last edited: