V2 API

= ATLust V2 API Information =

The API for ATLust V2 has two major parts. The "Command" part, where your script sends commands to ATLust. And the "Signal" part (AKA, Notifications), in which ATLust notifies your script that something has happened. The API also has multiple levels. Level 1 being the public API which everyone can use, higher levels require an API Key.

See the API Example script included with the HUD for more information on how to interact with the ATLust API.

API Commands
LSL Name: The constant name for the command ID

ID: The value that identifies the command to the server.

Description: A description of what the command does.

Requires: Values that are required to complete the command. (JSON Object)

Returns: The values that the command returns. (Most are returned as a JSON Object).

All returned values may be strings starting with "ERR/" if there was an error while processing the command. The text following "ERR/" will explain the error (IE: Missing required parameters). The entire response message from the HUD may also start with "ERR/" in the case of major errors.

Signals
API Signals (Or notifications) are sent out when something happens, such as the player using an item, or starting sex. All level 1 signals are sent automatically without the need to register, but they are only sent to scripts attached to the player. If you need to receive signals on a non-attached script, you will need to register (atl_api_register_notifications).

All parameters of the signal are in a JSON object form.

Organ Info
Each organ has its own unique properties. The ones accessible to the API are listed below. Every organ will return at least the "name" property. If the user didn't specify a unique name, the default of "OrganName:Index" will be used (IE: "Penis:0").

Species Objects
Species into is returned in a JSON Array of JSON Objects form. If the array is too long to fit into the message, it will be returned as the string: ERR/Too long

classification: (String, The class that the species belongs to)

family: (String, The family within the classification that the species belongs to)

species: (String, The species within the family)

variation: (String, The variation of the species)

percent: (Float, How much of this species does the character contain)

Example Script
This script was created using the LSL Pre-processor. If your viewer or ID does not support the pre-processor, you must manually specify the constants. (Viewers such as Firestorm support the Pre-processor).

Polling the server
The server updates data once a minute, so polling for new data more than once every 60 seconds is mostly pointless. Some values such as arousal and lust are changed immediately when players perform actions, but all other stats are not changed until the next server tick. Each server tick happens on the minute. It is recommended to synchronize your scripts polling timer so that it polls the server shortly after the minute changes. This will help ensure your script has the latest data as soon as it's available.