I'm still fairly new to MQ macros, so perhaps I'm unaware of a better set of commands to help me accomplish what I want. The macro basically scans every spawn in the zone and will echo any spawn that has a capital letter in the name or a pound-sign (a pseudo-named-spawn checker

). It's using the TLO LastSpawn[] to loop through the array till .Name is a null string. It runs rather slow sometimes, and seems to run slower and slower as I use it more or as I'm online longer. I'm not sure if I'm mem leaking or this method sucks in general.
Code: Select all
Sub Main
/declare i int local 1
/echo Checking for nameds...
:loop
/if (${LastSpawn[${i}].Name.Length}>0) {
/if (${LastSpawn[${i}].Name.Lower.NotEqualCS[${LastSpawn[${i}].Name}]} || ${LastSpawn[${i}].Name.Count[#]}>0) {
/if (${LastSpawn[${i}].Type.Equal[NPC]}) {
/echo ..${LastSpawn[${i}].CleanName}
}
}
/varcalc i ${i}+1
/goto :loop
}
/echo Done.
/endmacro
I've also thought about somehow writing this in code and adding myself a custom command, but I'd probably crash MQ2. I'm still 100% newb under the hood.