Skip to content

Me

Your own character.

Forms

character Me

Returns your character.

mq.TLO.Me is a character, which is an actor plus self-only members — afflictions, maintained buffs, your ability book, casting state, free inventory. Everything on actor works on Me too.

Usage

local me = mq.TLO.Me
eq2.print(("%s -- lvl %d %s -- %d%% hp / %d%% power")
  :format(me.Name(), me.Level(), me.Class(), me.PctHP(), me.PctPower()))

Me is always safe to call

Unlike Target, Me is never nil — it is a table of functions built fresh each access, and the resolution happens inside each member. Out of world, Me.Name() is "" and Me.ID() is 0.

if mq.TLO.Me.ID() ~= 0 then    -- "am I actually in the world"
  ...
end

PctHP() while dead

While you are dead, Me.PctHP() reads as -99-as-unsigned, not 0 — a very large positive number. Any PctHP() < threshold heal or flee gate silently stops firing at exactly the moment it matters.

Test death separately rather than inferring it from health.

Common patterns

Cure gate — note this is HasCurableDetriment(), not DetrimentCount() > 0:

if mq.TLO.Me.HasCurableDetriment() then
  local a = mq.TLO.Me.Afflictions()
  if a.Trauma > 0 then eq2.cmd('/useability "Cure"') end
end

Cast gate:

local me = mq.TLO.Me
if not me.CastingSpell() then
  local ab = me.Ability("Fireball")
  if ab and ab.IsReady() then eq2.cmd('/useability "Fireball"') end
end

Buff upkeep:

if not mq.TLO.Me.Buff("Aura of Void") then
  eq2.cmd('/useability "Aura of Void"')
end

See also