Skip to content

Group

Your group roster.

Forms

roster Group

Returns your group as a roster, whose members are rostermember values. Maximum 6.

Usage

if mq.TLO.Group.Available() then
  for _, m in ipairs(mq.TLO.Group.Members()) do
    eq2.print(("%d: %s %d%% hp"):format(m.Index(), m.Name(), m.PctHP()))
  end
end

Check Available() first

When the group manager isn't resolvable, every member returns its fail-soft zero value — Count() is 0, Members() is empty — so an unguarded loop does nothing at all and looks identical to "not grouped". Available() is what tells the two apart.

Group carries the cure data

Group members expose the five per-cure-class counters and their Has*() predicates. This is the data a healer rotation runs on, and it is Group-only — see Raid.

for _, m in ipairs(mq.TLO.Group.Members()) do
  if m.HasCurableDetriment() then
    eq2.cmdf("/target %s", m.Name())
    eq2.delay(100)
    eq2.cmd('/useability "Cure"')
    break
  end
end

Remember the counters are signed: -1 means present but incurable. The Has*() predicates already test > 0 for you, which is why they are the right thing to gate on.

Roster members are not actors

A rostermember has no position, no effects, and no encounter data — but it is readable for group members who are out of range and have no loaded actor. To get the full actor for a nearby member, look up its id:

for _, m in ipairs(mq.TLO.Group.Members()) do
  local a = mq.TLO.Spawn[m.ID()]
  if a and a.ID() ~= 0 then
    local d = a.Distance()
    if d > 0 and d > 30 then eq2.print(m.Name() .. " is falling behind") end
  end
end

Are you in the group?

You are. Your own character occupies a slot, so Count() includes you and Members() iterates over you as well. Filter on ID() against Me.ID() if you want everyone but yourself.

See also