Try this. I put it together pretty quickly and I haven't tested it very well, couldn't find 2 char's with names like that to test it on. Should work though (famous last words :) ..fantum409 wrote:I haven't figured out a fix for that targeting bug.
Code: Select all
/call FindExactPC joe
/if (${Macro.Return}) /target id ${Macro.Return}
Code: Select all
Sub FindExactPC(string Name)
/declare CurrentID int local
/declare FirstID int local
/declare Counter int local 1
/varset FirstID ${Spawn[pc ${Name}].ID}
/varset CurrentID ${FirstID}
:FindNext
/if (!${CurrentID} || ${Spawn[id ${CurrentID}].CleanName.Equal[${Name}]}) /return ${CurrentID}
/varset CurrentID ${Spawn[id ${FirstID}].NearestSpawn[${Counter},pc ${Name}].ID}
/varcalc Counter ${Counter}+1
/goto :FindNext
/return 0

