Answering Machine

Expired

Needs a menu script to work.

 

// This script keeps a list of messages.
// The owner can play the messages back and erase them.
 

// Retrieved from Free SL Scripts: http://www.gendersquare.org/sl

// Global variables
list message_list;
integer listen_id = -1;  // Lets us turn off listening when we need to
string current_speaker_name = "";  // Who is currently recording a message

readList()
{
    integer i;

    integer count = llGetListLength( message_list );
    llSay( 0, "You have " + (string) count + " messages:" );
    for( i = 0; i , key=, "
        
        // Convert comma-separated-values into a list
        list msg_list = llCSV2List( message );
        if( llList2String( msg_list, 0) == "Button Message" )
        {
        
            string sender_name = llList2String( msg_list, 1);
            key user_key = llList2Key( msg_list, 2);
            string user_name = llList2String( msg_list, 3);
            
            if( sender_name == "leave_message_btn" )
            {
                current_speaker_name = user_name;
                if( listen_id != -1 )
                {
                    llListenRemove( listen_id );
                }
                
                listen_id = llListen( 0, user_name, "", "" );
                llSay(0, "Leave a one-line message after the beep...BEEP!" );
            }
            else
            if( sender_name == "play_messages_btn" )
            {
                if( user_key == llGetOwner() )
                {
                    readList();
                }
            }
            else
            if( sender_name == "erase_messages_btn" )
            {
                if( user_key == llGetOwner() )
                {
                    resetList();
                }
            }
        }
   }   
} 

 

 

 

Group Key Finder

Expired

Touch to get the object's Group Key.

 

default
{
    state_entry()
    {
       llSetText("Touch to learn\nGroup Key", <1 ,1,1>, 1);
    }

    touch_start(integer total_number)
    {
        list a = llGetObjectDetails(llGetKey(), [OBJECT_GROUP]);
        string b = llList2String(a,0);
        if (b == "00000000-0000-0000-0000-000000000000")
        {
            llWhisper(0, "Please set the Group for this object in EDIT under the GENERAL tab first.");
        }
        else
        {
            llWhisper(0, "This object's Group Key is: " + b);
        }
    }
}

 

Get SLurl

Expired

Returns exact SLurl link for object. 

Can be very useful for an object to tell owner where it is by IM. Then you could click the SLurl link from local chat history to go to object.

 

 

string escape(string msg)
{
    return llDumpList2String(llParseString2List(msg, [" "], []), "%20");
}

default
{
    state_entry()
    {
        llSetText("Touch for a SLurl", <1 .00, 0.25, 0.74>, 1);
        vector pos = llGetPos();
        llWhisper(0, "http://slurl.com/secondlife/" + escape(llGetRegionName()) + "/" + (string)llRound(pos.x) + "/" + (string)llRound(pos.y) + "/" + (string)llRound(pos.z) + "/");
    }

    touch_start(integer total_number)
    {
        vector pos = llGetPos();
        llWhisper(0, "http://slurl.com/secondlife/" + escape(llGetRegionName()) + "/" + (string)llRound(pos.x) + "/" + (string)llRound(pos.y) + "/" + (string)llRound(pos.z) + "/");
    }
}

 

 

 

Get Region Map

Expired

Displays map image of current sim on prim & updates every 24 hours.

 

integer time = 86400; //update every 24 hours

key httpRequestId;
string mapTexture;
string URL = "http://www.subnova.com/secondlife/api/map.php";
 
default 
{
    on_rez( integer sparam )
    {
        llResetScript();
    }
    
    state_entry() 
    {
        llSetTimerEvent(time);
        httpRequestId = llHTTPRequest(URL + "?" + "sim" + "=" + llEscapeURL(llGetRegionName()),[], "");
    }
    
    http_response(key request_id, integer status, list metadata, string body)
    {
        if (request_id == httpRequestId) 
        {
            mapTexture = body;
            llSetTexture(mapTexture, ALL_SIDES); //you can replace ALL_SIDES with a side number instead
        }
    }
    
    timer() 
    {
        httpRequestId = llHTTPRequest(URL + "?" + "sim" + "=" + llEscapeURL(llGetRegionName()),[], "");
    }
}