Page 1 of 1

target closest pc

Posted: Sun Jul 19, 2015 10:12 pm
by MyEmQueTwo
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?

Re: target closest pc

Posted: Sun Jul 19, 2015 11:14 pm
by Blitter

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}