Selecting a target at/near a particular loc?

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

Zorg
a lesser mummy
a lesser mummy
Posts: 44
Joined: Fri Oct 18, 2002 7:01 pm

Selecting a target at/near a particular loc?

Post by Zorg » Fri Oct 18, 2002 7:13 pm

The problem: I'm trying to target a mob that spawns at a certain loc near a bunch of mobs with the same name. I.e, there are half a dozen 'Foo' standing in a room, but I want to be able to always select the one closest to the east wall.

Here's what I've tried so far. I can target a mob with the correct name, and I get its loc to check against a value. However, I can't seem to find a way to iterate through the different mobs. I'll check against Foo1, it fails, and I try to target the next Foo, but I just get Foo1 again.

My plan is to create an array and then just keep on /target'ting new mobs. If the loc is different than the other elements of the array, it gets added to the list, so I populate the array with the locs of the mobs with a given name, and I can then find the one closest to a given location.

HOWEVER, /target just seems to return the same mob every time. Any suggestions?