checking mobs by loc

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

Moderator: MacroQuest Developers

NobodyImportant
a lesser mummy
a lesser mummy
Posts: 46
Joined: Sun Nov 02, 2003 8:42 pm

checking mobs by loc

Post by NobodyImportant » Sun Aug 15, 2004 3:02 pm

I spent several hours browsing the forums to find nothing, i was wondering if there was a way to check spawns by loc, and not name, like there is a room full of froglocks, all named the same, but only 1 is a PH, if I find the 1, take down its loc, and then check what mob is at that loc, i can effectively know when the mob spawns.


The closest thing i have come up with on my own is something like ...

Code: Select all



/for counter 0 to ${SpawnCount}

/if (${Spawn[${counter}].X}==PHlocX) /if (${Spawn[${counter}].Y}==PHlocY) /if (${Spawn[${counter}].Z}==PHlocZ) /echo PH IS UP

/next counter


This just seems to... ugly I guess, I was wondering if there was a way to check spawns by loc without actually having the target or ID.


Thanks in advance, if im being a dumbass and not see'ing something, go ahead with the flames.

eqjoe
a grimling bloodguard
a grimling bloodguard
Posts: 984
Joined: Sat Sep 28, 2002 12:26 pm

Post by eqjoe » Sun Aug 15, 2004 11:49 pm

If you know the name of the PH, create an array of all the mobs in zone with that name. Then check the location of each mob in your array.

In the macros forum there are several examples on how to do this stuff.

-j

User avatar
SukMage
a ghoul
a ghoul
Posts: 88
Joined: Fri Jun 04, 2004 5:08 pm

Post by SukMage » Mon Aug 16, 2004 6:01 am

If you know where it spawns and it's name, you could /mapf custom <PH name> and look on the map in the designated spot. I believe your way would work or you can /who npc <name> and superwho will give you the location of each spawn. Compare the superwho loc with the loc you have written down. those methods might not be as easy for ya though.

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Mon Aug 16, 2004 2:36 pm

This is from my root/dot macro. Gets the ID of a mob within a radius of 10 from the specified loc. If a mob is there the ID will be nonzero. Might want to lower the radius a bit depending on your situation.

Code: Select all

/varset MobID ${Spawn[loc ${MobX} ${MobY} radius 10 npc].ID}

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Mon Aug 16, 2004 3:52 pm

I'm trying to work something out similar for a pull routine. Where tehre's 4 mobs (random type of mob at each spot), and they can all be single pulled if done in the right order. Anyhow...

something like this:

/echo ${Spawn[loc 100 -50 radius 10 npc]}

Won't work if there is a mob right on 100 -50
But if I take out the radius part, this works:

/echo ${Spawn[loc 100 -50 npc]}

The problem for me is this will show if that 1 mob is up, but if it's not, it will or may be finding one of the other 3. How could I resolve this problem? I just want to check an exact loc, and to return NULL if nothing is there. Seems simple, but I can't figure it out /boggle

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Mon Aug 16, 2004 4:08 pm

well if you use that and then once you have a spawn ID check the spawns loc to see if it really is the mob you want.
Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Tue Aug 17, 2004 2:36 am

I think there's something screwed up with ${Spawn}

I thought I had it working, and I noticed no matter what the parameters, as long as it has npc in there, it would just be targeting the cloest npc... not what I want.

${Spawn[npc loc -475 1020]}

will target the same mob as:

${Spawn[npc loc 10 10]}

That mob being the closest one to me.

I was looking in the readme and I thought my problem was in the ${Spawn} filters, x comes before y, but it didn't make a difference.

Any ideas?

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Tue Aug 17, 2004 10:37 am

deleted cause I was talking crap.
Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Tue Aug 17, 2004 11:09 am

Got it to work. but only with the use of radius.

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Tue Aug 17, 2004 11:19 am

Doh didnt spot you hadn't put radius on. In the code if your spawn is not at the exact loc it then checks the radius to see if its within that radius so if you dont have a radius defined it would probably just ignore the loc argument altogether.
Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]

Sman
orc pawn
orc pawn
Posts: 13
Joined: Tue Jun 03, 2003 11:47 pm

Post by Sman » Tue Aug 17, 2004 11:52 am

just some food for thought...back in the day when I was playing EQ and using MQ1, I was writing a pullling routine and found out some useful information....

if a mob gets aggro'd and moves from his spawn point, when he returns, he doesn't not return to the exact spot he spawned in, so you do need to use a radius to check, just in case the mob has been aggro'd.

Hope this is useful here.
eq n00b!

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Tue Aug 17, 2004 12:55 pm

Not posting my macro, but here's a small snippet :)

Code: Select all

   /varset Spawn1ID ${Spawn[npc loc ${Spawn1X} ${Spawn1Y} radius ${R}].ID}
   /varset Spawn2ID ${Spawn[npc loc ${Spawn2X} ${Spawn2Y} radius ${R}].ID}
   /varset Spawn3ID ${Spawn[npc loc ${Spawn3X} ${Spawn3Y} radius ${R}].ID}
   /varset Spawn4ID ${Spawn[npc loc ${Spawn4X} ${Spawn4Y} radius ${R}].ID}

   /target id ${Spawn1ID}
   /if (${Spawn1ID.NotEqual["NULL"]}) {
      /varset MobToPull 1
      /goto :TargetAquired
   }
   
   /target id ${Spawn2ID}
   /if (${Spawn2ID.NotEqual["NULL"]}) {
      /varset MobToPull 2
      /goto :TargetAquired
   }
   
   /target id ${Spawn3ID}
   /if (${Spawn3ID.NotEqual["NULL"]}) {
      /varset MobToPull 3
      /goto :TargetAquired
   }
   
   /target id ${Spawn4ID}
   /if (${Spawn4ID.NotEqual["NULL"]}) {
      /varset MobToPull 4
      /goto :TargetAquired
   }
Using a radius of 10 works and has been working perfectly for me.

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Tue Aug 17, 2004 1:15 pm

Seems a bit unnessecary to store an id as a string when it's an int.

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Tue Aug 17, 2004 3:37 pm

As the fact that you don't have the rest of the macro in front of you, then you would be right.