SmartBots (SmartBots2Life)

Second Life group direct invitation bots


Support Managers

QuincyJohnes online
English, Russian
Cybergothdragon offline
English, German
show offline managers
Dutch, English, Japanese, Russian

SSTI API Example

The following script is being used as SSTI API testing suite. It provides the easy way to understand and test the API.

// SmartShare Tenant Inviter example plugin
// (C) Advers Inc, 2013
// This script demonstrates the API usage and interaction with SSTI. Feel free to
// modify and distribute.
// CONSTANTS: Copy them to your script to call SSTI API
// See for details
// Messages to SSTI (commands):
integer SSTI_API_GET_GUESTS=-45030001;
integer SSTI_API_CUSTOM_BUTTON=-45030002;
// Replies from SSTI (events):
integer SSTI_EVENT_INITIALIZED=-45040001;
integer SSTI_EVENT_GUESTS=-45040002;
integer SSTI_EVENT_CUSTOM_BUTTON=-45040003;
integer SSTI_EVENT_NEW_TENANT=-45040004;
integer CHANNEL=-123456;
integer touch_started=0;
string STR_TEST_GUESTS="Get guests";
string STR_TEST_BUTTON="Custom btn";
default {
    state_entry() {
    // Click and hold for API test menu
    touch_start(integer total_number) {
        llWhisper(0,"SSTI API test suite: keep pressing for 2 seconds to open debug menu");
    touch(integer total_number) {
        if(touch_started<llGetUnixTime()-1) {
            llDialog(llDetectedKey(0),"Choose the test function:",
    // This function does the calls to SSTI
    listen(integer channel, string name, key id, string msg) {
        if(msg==STR_TEST_GUESTS) {
            llWhisper(0,"Calling SSTI_API_GET_GUESTS...");
        if(msg==STR_TEST_BUTTON) {
            llWhisper(0,"Calling SSTI_API_CUSTOM_BUTTON");
            llMessageLinked(LINK_SET,SSTI_API_CUSTOM_BUTTON,"API test",NULL_KEY);
    // This function processes the replies from SSTI
    link_message(integer sender, integer cmd, string str, key id) {
        // React on initialization
        if(cmd==SSTI_EVENT_INITIALIZED) {
            llWhisper(0,"SSTI API: initialization complete, group name: "+
        // React on guests reply
        if(cmd==SSTI_EVENT_GUESTS) {
            // Parse reply to guests list. This code is given as a code
            // template for your scripts:
            list guestNames; // Store names here
            list guestKeys; // Store keys here
            list guestType; // Type: G for guest, P for partner
            list source=llParseString2List(str,["&"],[]);
            integer i;
            for(i=0;i<llGetListLength(source);i+=3) {
            // Compose the readable guests list
            string result="";
            for(i=0;i<llGetListLength(guestKeys);i++) {
                result+=llList2String(guestType,i)+" "+
                    llList2String(guestKeys,i)+" "+
            llWhisper(0,"SSTI API:\n"+
                "tenant UUID: "+(string)id+"\n"+
                "guests list:\n"+result);
        // React on custom button press
        if(cmd==SSTI_EVENT_CUSTOM_BUTTON) {
            llWhisper(0,"SSTI API: custom button pressed by "+(string)id);
        // React on new tenant event
        if(cmd==SSTI_EVENT_NEW_TENANT) {
            llWhisper(0,"SSTI API: new tenant "+str+" ("+(string)id+")");

Questions, wishes and discussion