$searchspawn() type functions with ${Spawn[]}

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

$searchspawn() type functions with ${Spawn[]}

Post by ml2517 » Thu Apr 08, 2004 10:56 pm

This doesn't appear to be working properly for me when trying to perform $searchspawn type calls. Its possible I'm using an incorrect syntax but these are the things I've tried. I'm doing this in West Freeport where there are multiple bats in view.

Code: Select all

/echo ${Spawn[npc "bat"].ID}
| This works fine and lets say it spits out 1755
| Now I'll try to get the next bat
| I'll show you all of the different ways I've tried.  Sometimes it gets one more mob but it isn't a bat usually and it never exceeds two mobs.
|

/echo ${Spawn[npc "bat" id 1755].Next.ID}
/echo ${Spawn[npc "bat" id:1755].Next.ID}
/echo ${Spawn["bat" npc id 1755].Next.ID}
/echo ${Spawn["bat" npc].Next.ID}
Tried several others that didn't work as well. Is my syntax f'd up or is it really not working?

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Fri Apr 09, 2004 12:07 pm

No, you're just doing it wrong :)

Any time you do spawn.Next, you're just getting whatever spawned right before it.

What you want is:
${NearestSpawn[n,search]}

e.g.:

Code: Select all

/echo Bat 1: ${NearestSpawn[1,npc bat].ID}
/echo Bat 2: ${NearestSpawn[2,npc bat].ID}
/echo Bat 3: ${NearestSpawn[3,npc bat].ID}
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Fri Apr 09, 2004 5:09 pm

Ah.... OK I'll try it when I get home tonight.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Fri Apr 09, 2004 6:49 pm

Not too shabby, this works better than $searchspawn() as far as I'm concerned. I haven't tested all of the optional criteria but looks good. Nice job Lax!

Just messed around with this to see how it works.

Code: Select all

#turbo

Sub Main
/declare Counter local
/varset Counter 1
/declare TempSpawn local
/varset TempSpawn 0

:GetSpawn
/varset TempSpawn ${NearestSpawn[@Counter,npc bat].ID}
/newif ${String[@TempSpawn].NotEqual[NULL]} {
    /echo Spawn:${Int[@Counter]} ID:@TempSpawn Name:${Spawn[@TempSpawn].Name}
    /varadd Counter 1
} else {
    /goto :DoneSearching
}
/goto :GetSpawn
:DoneSearching
/return