target closest pc

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

MyEmQueTwo
orc pawn
orc pawn
Posts: 14
Joined: Mon Jul 13, 2015 7:15 pm

target closest pc

Post by MyEmQueTwo » Sun Jul 19, 2015 10:12 pm

Hello again!

Im currently looking for a way to target the closest PC and check it's distance for my OOG cleric for heal distance checks.

I was looking at the http://www.macroquest2.com/wiki/index.php/Spawn_Search link but didn't see a way. Is there something I am missing? Does anyone have an example even if non-related that I can learn off of?

Blitter
a hill giant
a hill giant
Posts: 151
Joined: Sat Dec 29, 2007 11:07 pm
Location: Sky

Re: target closest pc

Post by Blitter » Sun Jul 19, 2015 11:14 pm

Code: Select all

/if (${NearestSpawn[1, PC radius 300].ID}) {
  /tar id ${NearestSpawn[1,PC radius 300].ID}
  /delay 2s ${Target.ID}==${NearestSpawn[1, PC radius 300]}
}
NearestSpawn[Nth closest spawn to you, SpawnSearch]. So it checks to see the 1st closest PC within 300 radius of you and then targets it.

If you are going to use it for healing, then I'd recommend using an Alert List in the spawn search - otherwise it might target people you don't want to heal who are close to you.

If you are only healing group members then I'd more likely use - as I believe that Group/Xtar information is updated more rapidly/frequently
${Group.Member[MemberNumber].Distance}