# DATA_ONLINE

*LSL constant*

```lsl
integer DATA_ONLINE = 1;
```

Constant groups: [AgentData](/constants/groups/AgentData/)

Used with [llRequestAgentData](/functions/llRequestAgentData/) to return a string that contains the integer boolean for if the user is online (or not). [TRUE](/constants/TRUE/) if online, [FALSE](/constants/FALSE/) if offline.

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-5, 11-33}
key queryID; // the id key

default
{
    state_entry()
    {
        key id = llGetOwner(); // get the owner key
        queryID = llRequestAgentData( id, DATA_ONLINE ); // returns if the owner is online or not
    }

    dataserver( key query, string info )
    {
        // find the correct query id
        if( query == queryID )
        {
            string message;

            // convert the info to an actual message
            if( info == "1" )
            {
                message = "Online";
            }

            else if( info == "0" )
            {
                message = "Offline";
            }

            // display that they are online or offline in owner say.
            llOwnerSay( "The owner of this object is: " + message );
        }
    }
}
```

</details>

## Known issues

From the issue templates included by the wiki article:

- SVC-6831 (bug): llRequestAgentData with DATA_ONLINE parameter has a delay of up to 10 minutes in reporting offline status

## See also

### Constants

|

<table>
	<tr>
		<td>[DATA_ONLINE](/constants/DATA_ONLINE/)</td>
		<td>1</td>
		<td>([integer](https://wiki.secondlife.com/wiki/integer)) boolean</td>
		<td colspan="4">If the requested agent is online</td>
	</tr>
	<tr>
		<td>[DATA_NAME](/constants/DATA_NAME/)</td>
		<td>2</td>
		<td>[string](https://wiki.secondlife.com/wiki/string)</td>
		<td colspan="4">The requested agent's [legacy name](https://wiki.secondlife.com/wiki/Category:LSL_Avatar/Name)</td>
	</tr>
	<tr>
		<td>[DATA_BORN](/constants/DATA_BORN/)</td>
		<td>3</td>
		<td>[string](https://wiki.secondlife.com/wiki/string)</td>
		<td colspan="4">The account creation/"born on" date as a string in an ISO 8601 format of YYYY-MM-DD.</td>
	</tr>
	<tr>
		<td>[DATA_RATING](/constants/DATA_RATING/)</td>
		<td>4</td>
		<td>[llCSV2List](/functions/llCSV2List/)()</td>
		<td colspan="4">**Deprecated**: Returns \[0, 0, 0, 0, 0, 0\]<br />Used to return: \[pos_behavior, neg_behavior, pos_appearance, neg_appearance, pos_building, neg_building\]</td>
	</tr>
	<tr>
		<td rowspan="3">[DATA_PAYINFO](/constants/DATA_PAYINFO/)</td>
		<td rowspan="3">8</td>
		<td rowspan="3">([integer](https://wiki.secondlife.com/wiki/integer)) mask</td>
		<th colspan="3">Flag</th>
		<th>Description</th>
	</tr>
	<tr>
		<td colspan="2">[PAYMENT_INFO_ON_FILE](/constants/PAYMENT_INFO_ON_FILE/)</td>
		<td>0x1</td>
		<td>If payment info is on file.</td>
	</tr>
	<tr>
		<td colspan="2">[PAYMENT_INFO_USED](/constants/PAYMENT_INFO_USED/)</td>
		<td>0x2</td>
		<td>If payment info has been used.</td>
	</tr>
</table>

### Functions

- [llRequestAgentData](/functions/llRequestAgentData/)

### Events

- [dataserver](/events/dataserver/)

---

*Source: [DATA ONLINE](https://wiki.secondlife.com/wiki/DATA_ONLINE) on the Second Life Wiki. Content from the Second Life Wiki articles DATA ONLINE (revision 1194636, 2015-01-23), Template:LSL Constants/llRequestAgentData (revision 1167410, 2012-05-17) and Template:Issues/SVC-6831 (revision 1157344, 2011-11-06), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/constants/DATA_ONLINE/
