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?
