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
