Jump to content

LlGetAgentInfo: Difference between revisions

From OSgrid Wiki
Created page with "==Function: integer llGetAgentInfo( key id );== Returns an integer bitfield containing the agent information about id. <br> • key id – avatar UUID that is in the same r..."
 
No edit summary
 
Line 23: Line 23:
| style="text-align:left" | [[AGENT_ON_OBJECT]] || 0x0020 || style="text-align:left" | is sitting on an object  
| style="text-align:left" | [[AGENT_ON_OBJECT]] || 0x0020 || style="text-align:left" | is sitting on an object  
|-
|-
| style="text-align:left" | [[AGENT_SCRIPTED]] || 0x0004 || style="text-align:left" | has scripted attachments
|-
| style="text-align:left" | [[AGENT_SITTING]] || 0x0010 || style="text-align:left" | is sitting
|-
| style="text-align:left" | [[AGENT_TYPING]] || 0x0200 || style="text-align:left" | is typing
|-
| style="text-align:left" | [[AGENT_WALKING]] || 0x0080 || style="text-align:left" | is walking
|}
'''Caveats''' <br>
• [[AGENT_BUSY]] indicates that the "busy" internal animation is playing, even if the user is not truly in busy mode. <br>
• [[AGENT_TYPING]] indicates that the "typing" internal animation is playing, it will not be set if the user disables PlayTypingAnim. <br>
• This function does not return reliable information immediately after a border crossing. Use [[llGetAnimation]] instead, if you can. SVC-3177[c]  <br> <br>
'''Examples''' <br>
{|border="1" cellpadding="5" cellspacing="0"
|<source lang="lsl">
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);
    }
}
</source>
|}
<br>
'''Notes''' <br>
This is not a good way of testing if an avatar is in the region, use [[llGetAgentSize]] instead. <br> <br>
See Also <br>
'''Functions''' <br>
•  [[llRequestAgentData]] <br>
•  [[llGetAnimation]] <br>
•  [[llGetAnimationList]] <br> <br>

Latest revision as of 21:56, 31 December 2017

Function: integer llGetAgentInfo( key id );

Returns an integer bitfield containing the agent information about id.
• key id – avatar UUID that is in the same region

Constant Val Returned if agent...
AGENT_ALWAYS_RUN 0x1000 has running ("Always Run") enabled, or is using tap-tap-hold
AGENT_ATTACHMENTS 0x0002 has attachments
AGENT_AWAY 0x0040 is in "away" mode
AGENT_BUSY 0x0800 is in "busy" mode
AGENT_CROUCHING 0x0400 is crouching
AGENT_FLYING 0x0001 is flying
AGENT_IN_AIR 0x0100 is in the air (hovering)
AGENT_MOUSELOOK 0x0008 is in mouselook
AGENT_ON_OBJECT 0x0020 is sitting on an object
AGENT_SCRIPTED 0x0004 has scripted attachments
AGENT_SITTING 0x0010 is sitting
AGENT_TYPING 0x0200 is typing
AGENT_WALKING 0x0080 is walking

Caveats
• AGENT_BUSY indicates that the "busy" internal animation is playing, even if the user is not truly in busy mode.
• AGENT_TYPING indicates that the "typing" internal animation is playing, it will not be set if the user disables PlayTypingAnim.
• This function does not return reliable information immediately after a border crossing. Use llGetAnimation instead, if you can. SVC-3177[c]

Examples

<source lang="lsl">

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);
   }

} </source>


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

See Also
Functions
• llRequestAgentData
• llGetAnimation
• llGetAnimationList