• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

Finding out if a group member isn't present (1 Viewer)

Redbot

🖥️💖
Moderator
Joined
Oct 15, 2004
RedCents
88,670¢
Pronouns
He/Him
How can I find out if one of my group members isn't present?

This is what I have so far, but it's untested and I doubt it's going to do what I want:

Rich (BB code):
	/if (${Ini[GTFO.ini,settings,groupsize]<[${Group}]})
	  {
	  	/echo looks like we've lost a buddy!
	        /call exit
		/return
	  }

Ideally I'd know if everyone is within a certain radius, and if it all checks out, continue the macro.


edit: new solution here

http://www.redguides.com/community/showthread.php/39333-AnyoneMissing
 
Last edited:
If it's just checking for distance, you could loop through the group, and if one's distance exceeds your radius, quit.

Rich (BB code):
/declare g int local
/for g 1 to ${Me.GroupSize}
  /if (${Spawn[${Group.Member[${g}]}].Distance} > ${MaxDistanceVariable}) {
    /echo Someone's out of range
    /call exit
    /return
  }
/next g

Is this sort of what you're thinking? Or do you need to check for LD, out of zone, etc as well?
 
The loop is there to check each group member one at a time. I don't think there's an easier way of accessing the Spawn class for each group member than by checking each by index, but maybe there is?

Updated Code:
Rich (BB code):
/declare g int local
| Do this once for each group member
| Group.Member[0] is me, so loop through members 1 - (GroupSize-1)
/for g 1 to ${Me.GroupSize}-1
  | Declare a temporary variable of type spawn that represents the current group member being checked
  /declare temp spawn local
  /vardata temp Spawn[${Group.Member[${g}]}]

  | If the spawn is null, the group member is not in zone - check logic/syntax, not sure on this one
  /if (${temp}==NULL) {
    /echo ${Group.Member[${g}]} is not in zone
    /call exit
    /return
  }

  | If the spawn is a certain distance away from this character
  /if (${temp}.Distance} > ${MaxDistanceVariable}) {
    /echo ${temp} is out of range
    /call exit
    /return
  }

  | If the spawn is linkdead
  /if (${temp}.Linkdead) {
    /echo ${temp} has gone linkdead
    /call exit
    /return
  }
  | Clean up local variable
  /deletevar temp
/next g
| Clean up local variable
/deletevar g

Edit: A couple edits to the code.
 
Last edited:
Looks good, but we hit a snag: Group.Member doesn't tell you if they're in the zone or not, it always returns the character name.

I'm not even sure if it's possible for MQ2 to tell us if a group member is in the zone.
 
Looks good, but we hit a snag: Group.Member doesn't tell you if they're in the zone or not, it always returns the character name.

I'm not even sure if it's possible for MQ2 to tell us if a group member is in the zone.

Hmm, my thinking was to get the group member as a spawn type by setting ${temp} to Spawn[GroupMemberName]. If ${temp} is null, that would indicate that the group member is not in zone or offline.

Edit:
Try changing that statement to
Rich (BB code):
| If in zone, ID is the group member's ID. If out of zone, ID is null, and the statement gets executed
/if (!${Spawn[${Group.Member[${g}]}].ID}) {
    /echo ${Group.Member[${g}]} is not in zone
    /call exit
    /return
  }

Edit:
There may be some issues with the ${temp} variable, I haven't written macros much, and don't have experience with them. Assuming ${temp} is a spawn type, would distance be ${temp.Distance} or ${temp}.Distance or ${${temp}.distance}? Not knowing myself, I would try all and see what works.
 
Last edited:
You did it! Thank you so much Max.

The only issue that came up was a weird one: ${Group.Member[$0]} starts at zero, and ${Me.GroupSize} starts at 1, leaving "6" as a disagreement between the two.

Here's the finished zone check, tested as working:

Rich (BB code):
	| Is everyone in the zone? - thanks Maxranor

	/declare g int local
	/declare gsize int local
	/varcalc gsize ${Me.GroupSize} -1

	| Do this once for each group member
	/for g 1 to ${gsize}
        | If the spawn is null, the group member is not in zone - check logic/syntax, not sure on this one
	/if (!${Spawn[${Group.Member[${g}]}].ID}) {
		/echo ${Group.Member[${g}]} is not in zone
		/call exit
		/return
        }
	/next g

	| Clean up local variables
	/deletevar g
	/deletevar gsize

	| end groupcheck
 
Nice, glad it's working! I noticed the 0 index thing for Group.Member a little late and edited one of my earlier posts, glad you caught it. Looking at the TLO's, you could get rid of ${gsize}, and instead use ${Group.Members}, which returns the count of other people in group.
 
Finding out if a group member isn't present

Users who are viewing this thread

Back
Top