Commands › Inventory
script_create
Create and compile an LSL script
Usage
curl -X POST "https://api.lifebots.cloud/api/bot.html" \
-H "Content-Type: application/json" \
-d '{
"action": "script_create",
"apikey": "YOUR_API_KEY",
"botname": "Joe Resident",
"secret": "bot-secret-123",
"name": "Greeter",
"text": "default { state_entry() { llSay(0, \"Hi\"); } }",
"dataType": "json"
}' Every request also needs apikey, botname and secret — see Authentication.
Parameters
| Name | Required | Description |
|---|---|---|
namestring | yes | Script name. |
textstring | yes | LSL source code. |
descriptionstring | no | Item description. |
folderUUID | no | Folder to create it in. Default: Scripts. |
copystring | no | Send false to stop the next owner copying. Default: true |
modifystring | no | Send false to stop the next owner modifying. Default: true |
transferstring | no | Send false to stop the next owner transferring. Default: true |
Returns
| Field | Type | Description |
|---|---|---|
compiled | boolean | false if the script was saved but has compile errors. |
Example response
{
"success": true,
"result": "OK",
"uuid": "5d2d7a1d-0e8e-4f5d-a678-000000000000",
"assetId": "a9b8c7d6-0000-4000-8000-000000000006",
"compiled": true
} With dataType=json. A failure has result: "FAIL" and the reason in resulttext — see Responses & errors.
Good to know
- Check compiled — the call answers OK even when the code does not compile.
- Permission flags are only switched off by the exact word false; 0 leaves them on.