Basicly, this sub is the fixed location version, and you would want to modify it with your own @Param variables or x and y from $target. It does work as is if you want to know what and how many MOBs are around Orc_1 in East Commons though!
Post what you do with it to continue the refining process...subs, incs or even tidbits of code could help others in so many ways, just like Gumby helped me when I started the thread on this in Help today.
Thanks G!
Code: Select all
| Area51.mac
| Logic by Gumby - Refined by bonehand
|
| Special thanks to Gumby who came up with the basic idea!!
|
| Tested and working 100% as is.
| This is base code. You would need to impliment your own code to this
| so that you could change the loc based on user input or a target.
| This is absolutely groundbreaking, in my humble opinion, for single pull
| logic. Currently is set up to tell you how many MOBs are within 200 feet
| of Orc_1 in East Commonlands. Test it out!
|
| If you find something great to do with this code, please post it!
|
Sub Main
/declare MobID array
/declare CountID global
/declare Count global
/declare ForInc global
/varset Count 0
/alert clear 1
| Prime the Alert with a known target location or use $target(x)
| and $target(y) to get them from your current target.
| I used static numbers in this example to just simplify for now.
/varset CountID $searchspawn(npc,loc:2650:1020,radius:200)
/if n @CountID>0 {
/varset MobID(@Count) @CountID
/varadd Count 1
/alert add 1 id @CountID
}
| Fucking brilliant code here thanks to Gumby
:CheckMore
/varset CountID $searchspawn(npc,loc:2650:1020,radius:200,noalert:1)
/if n @CountID>0 {
/varset MobID(@Count) @CountID
/varadd Count 1
/alert add 1 id @CountID
/goto :CheckMore
}
| Stuff you can do:
| If the array count comes back 1 then it is single pull!
| If the array has a number of MOB IDs, pull the one you want,
| search for a specific spawn or select the monster that is
| closest to all other monsters for AE grouping...and what else?
/echo @Count number of mobs total
| Spit out all entries in array, again, do as you wish with them
/for ForInc 0 to $calc(@Count-1)
/echo Mob number @ForInc has ID @MobID(@ForInc)
/next ForInc
/alert clear 1
/return
