${Spawn[]} command question

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

Moderator: MacroQuest Developers

JJ
a hill giant
a hill giant
Posts: 227
Joined: Thu Nov 11, 2004 5:50 am

${Spawn[]} command question

Post by JJ » Fri Nov 26, 2004 1:29 pm

After a few help file and board searches, I have failed to find exactly what I am looking for. In the help file under the spawn search filter page it shows:
loc <intX> <intY>
I was trying to test out the Spawn command and I am not doing something right. Basically if I have a mob spawn point, I want to target or get info on the mob at that spawn point. Here is what I was using:

Code: Select all

/target ${Spawn[loc -176 -726]}
among other failed attempts. It keeps targetting me. I got the mobs exact location from ${Target.X} and ${Target.Y} and he is a static NPC. Any hints, ideas, etc. would be appreciated.

Thanks,
JJ

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Fri Nov 26, 2004 1:46 pm

try ${NearestSpawn[loc -176 -726]}

JJ
a hill giant
a hill giant
Posts: 227
Joined: Thu Nov 11, 2004 5:50 am

Post by JJ » Fri Nov 26, 2004 1:52 pm

Thanks for the response. Tried it, targets me also.

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Fri Nov 26, 2004 3:20 pm

Code: Select all

/echo ${NearestSpawn[loc -176 -726]}
to see what it's returning.

/target with ${Spawn} names directly is almost always a bad idea. Use IDs. What you want probably looks more like

Code: Select all

/target id ${NearestSpawn[1, npc radius 10 loc -176 -726].ID}

JJ
a hill giant
a hill giant
Posts: 227
Joined: Thu Nov 11, 2004 5:50 am

Post by JJ » Fri Nov 26, 2004 3:56 pm

On the /echo it returns my name no matter what the location is.

Edit: Also, I am not standing near that location either. I am testing it in the bazaar for now standing in the back of the bazaar and trying to target Ward Gebson at X=-126 Y=-726

Edit2: Also just tried out ${NearestSpawn[npc loc -176 -726]} as well as just spawn and it gives me the closest npc to me. Seems to ignore the loc argument.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Nov 26, 2004 6:10 pm

Code: Select all

/target ${Spawn[loc -176 -726 radius 10]}
loc implies exactly at that location.

JJ
a hill giant
a hill giant
Posts: 227
Joined: Thu Nov 11, 2004 5:50 am

Got it! Thanks!

Post by JJ » Fri Nov 26, 2004 6:42 pm

According to ${Target.X} and ${Target.Y}, that is his exact location. But once I put in radius, it works great! Even at radius 0. So maybe a suggestion for the help file would be to add the radius argument is required as well as INT X and INT Y.

So for my static spawn I am now using:

/target ${Spawn[loc INTX INTY RADIUS 0]}

Thanks a ton DKAA!

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Nov 26, 2004 7:57 pm

It shouldn't be INT. It should be FLOAT.

JJ
a hill giant
a hill giant
Posts: 227
Joined: Thu Nov 11, 2004 5:50 am

Ok

Post by JJ » Sat Nov 27, 2004 1:07 am

Was just going off of the help file. Glad to know you can use FLOAT numbers. Lets me get even more accurate.

Thanks.

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Sat Nov 27, 2004 2:48 pm

dont_know_at_all wrote:It shouldn't be INT. It should be FLOAT.
JJ wrote:Was just going off of the help file. Glad to know you can use FLOAT numbers. Lets me get even more accurate.

Thanks.
Updated the readme and html.