For IkIk

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

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

For IkIk

Post by ml2517 » Fri Apr 09, 2004 7:54 pm

Not sure if you visit the boards but you were looking for a way to ignore just your group members from $searchspawn. This should work for what you need.

Code: Select all

#turbo 50

Sub Main
/declare GroupCount global
/declare AlertNumber global
/call AvoidGroupMembers

| This is the Alert List Number
/varset AlertNumber 99


:MainLoop
/if n @GroupCount!=$calc($group(count)-1) /call AvoidGroupMembers

| Then in your $searchspawn you would have something like this: $searchspawn(pc,radius:300,noalert:99) 
| This would match all pc's in a radius of 300 while avoiding any of your group members.  If your group changes at all 
| It will reload the list with the current group members. 
|
| If you wanted all pc's,npc's or whatever you could do something like this: $searchspawn(radius:300,noalert:99) 


/delay 1
/goto :MainLoop
/return


Sub AvoidGroupMembers
/declare a local
/varset GroupCount $calc($group(count)-1)
/alert clear @AlertNumber
/alert add @AlertNumber avoidgroupmembers
/alert add @AlertNumber PC "$char(name)"
/if n $group(count)>1 {
    /for a 1 to @GroupCount
        /alert add @AlertNumber PC "$spawn($group(@a),name)"
    /next a
}
/return