Skip to content

zone

The zone you are currently in.

Returned by mq.TLO.Zone.

eq2.print("in " .. mq.TLO.Zone.Name())

Members

string Name

Current zone name (internal short name). "" before you are in the world.

The same value is available on every actor as Zone() — it is world-global, so which actor you ask makes no difference.

string ShortName

Internal zone identifier. Currently returns the same value as Name().

Intended as the stable identity key — once Name() is flipped to the display name, ShortName() will still return the internal string. Use ShortName() in any code that keys on zone identity (config files, per-zone tables, peer-mesh zone scoping).

Detecting a zone change

There is no zone-change event yet. Poll the name:

local last = mq.TLO.Zone.Name()
while true do
  local now = mq.TLO.Zone.Name()
  if now ~= "" and now ~= last then
    eq2.print("zoned into " .. now)
    last = now
  end
  eq2.delay(500)
end

Guard on now ~= "" — the empty string is what you get mid-zone and at character select, and treating it as a real zone name will fire a spurious change on the way in and again on the way out.

See also