Don't click here unless you want to be banned.

LSL Wiki : llRequestAgentData

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
key llRequestAgentData(key id, integer data)

This function requests information of type data (see constants below) about agent id. The information is returned via the dataserver event. The key returned by this function is the query id for the dataserver event.

id must be a valid agent key. Passing the key of an object or group will not trigger the dataserver event. To determine if a given key points to an agent, one could use a timer to function as a timeout after several seconds had passed, though this would hardly be 100% reliable.

Valid values of data and what each will return in the dataserver event:
Constant Value Returns
DATA_ONLINE 1 (cast returned data to integer); determines if agent is online (TRUE/FALSE)
DATA_NAME 2 gets full agent name (excluding any group titles); compare with llKey2Name
DATA_BORN 3 gets account creation/"born on" date as a string in ISO 8601 format of YYYY-MM-DD.
DATA_RATING 4 returns the agent's ratings as a comma-separated string of six integers:
  • 1. Zero (formerly positive-rated behavior)
  • 2. Zero (formerly negative-rated behavior)
  • 3. Zero (formerly positive-rated appearance)
  • 4. Zero (formerly negative-rated appearance)
  • 5. Zero (formerly positive-rated building)
  • 6. Zero (formerly negative-rated building)
  • (Note: negative ratings no longer exist.)
    as of 1.15.0(2) the rating system was removed and this will now return 0,0,0,0,0,0
DATA_PAYINFO 8 returns the account type bitfield (an integer, cast as a string);
  • Bit 0: PAYMENT_INFO_ON_FILE Payment info on file
  • Bit 1: PAYMENT_INFO_USED Payment info used.

  • No Payment Info on File: 0
  • Payment Info on File: 1
  • No Payment Info on File AND Payment Info Used: 2 (Only Beta/Lifetime users fall under this status)
  • Payment Info on File AND Payment Info Used: 3

Attempting to give llRequestAgentData a combined data integer (as in llSensor) in an attempt to get the dataserver event to return two or more values simulaneously won't work. (1 + 2 = 3, and 1 + 3 = 4, which are clearly marked as DATA_BORN and DATA_RATING respectively.) Even if it did work, there's no way for the dataserver event to return two things, anyway.

Unfortunately, there isn't a way to return either the active or inactive groups a given agent is in. Passing llRequestAgentData the key of a group or object will not trigger the dataserver event, or return an error message. The best option is to try llSameGroup. Depending on what is trying to be accomplished, it may work.

Note: This function delays the script for 0.1 seconds.
Note: The length of the event queue is limited to 64 events. This sets an upper limit of 64 requests. If the queue overflows, the new events are silently discarded.

Example:
default 
{
    touch_start(integer num_detected) 
    {
        llRequestAgentData(llDetectedKey(0), DATA_BORN); // request creation date
    }
    dataserver(key queryid, string data) 
    {
        llSay(0, "You were born on: " + data);
    }
}

There is a gap in the constant values because the DATA_* namespace is shared with llRequestSimulatorData.

See also llKey2Name for a fast way to get an avatar's name.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | dataserver
There are 12 comments on this page. [Display comments/form]