Syntax

integer llGetAgentInfo( key id );

Forced delay: 0.0 seconds. Energy: 10.0.

Parameters

key id
avatar UUID that is in the same region

Return value

Returns a bit field (an integer) containing the agent information about id.

Constants

ConstantValReturned if agent...
AGENT_ALWAYS_RUN0x1000has running ("Always Run") enabled, or is using tap-tap-hold
AGENT_ATTACHMENTS0x0002has attachments
AGENT_AUTOMATED0x4000is marked as a scripted agent/bot
AGENT_AUTOPILOT0x2000is in "autopilot" mode
AGENT_AWAY0x0040is in "away" mode
AGENT_BUSY0x0800is in "busy" mode
AGENT_CROUCHING0x0400is crouching
AGENT_FLOATING_VIA_SCRIPTED_ATTACHMENT0x8000is floating or hovering because of a scripted attachment
AGENT_FLYING0x0001is flying or hovering
AGENT_IN_AIR0x0100is in the air (jumping, flying or falling)
AGENT_MOUSELOOK0x0008is in mouselook
AGENT_ON_OBJECT0x0020is sitting on an object (and linked to it)
AGENT_SCRIPTED0x0004has scripted attachments
AGENT_SITTING0x0010is sitting[1]
AGENT_TYPING0x0200is typing
AGENT_WALKING0x0080is walking, running or crouch walking

Caveats

Examples

default
{
    touch_start(integer buf)
    {
        buf = llGetAgentInfo(llDetectedKey(0));
        string out;
        if(buf & AGENT_FLYING)
            out += "The agent is flying.\n";
        else
            out += "The agent is not flying.\n";
 
        if(buf & AGENT_ATTACHMENTS)
        {
            if(buf & AGENT_SCRIPTED)
                out += "The agent has scripted attachments.\n";
            else
                out += "The agent's attachments are unscripted.\n";
        }
        else
            out += "The agent does not have attachments.\n";
 
        if(buf & AGENT_MOUSELOOK)
            out += "the agent is in mouselook.";
        else
            out += "the agent is in normal camera mode.";
        llWhisper(0, out);
    }
}

Notes

This is not a good way of testing if an avatar is in the region, use llGetAgentSize instead.

See also

Functions

Deep notes

Issues

History

Tests

Footnotes

  1. "Sit down" on the avatar context menu allows ground sits anywhere: atop the terrain, on objects or even in the air, so it is possible to sit "on" an object without linking.
  2. Early release notes were not very accurate or thorough, they sometimes included information about features added in previous releases or failed to include information about features added in that release.