Anti Spam Greeter ( V1 )

Expired

As the name suggests...This is a low spam greeter for use in medium to kinda high traffic areas. To use it place a plain prim in the entrance way of the area being visited. Drop this script onto it. The prim will turn transparent and a type of phantom called "VolumeDetect" which means avatars will pass through it. As they pass through it (even if just a foot dips into it) the script will issue various messages depending on the settings. It can also be used to give a folder of stuff (if wanted) to the visitor. Just add the stuff (LM's, NC's, Freebies etc.) to the prim contents. You can change the contents at any time without needing to do anything to the script (unless you want the messages to change too).

 

 

// V1 //
 
// Edit the strings below to set up the messaging.
 
string personalize = "Welcome to to my shop"; // If empty ( "" ) no personalisation will be used.
// If not empty the personalization will prepend the first name of the visitor and the whole will prepend...
// ..."IM" and/or "DM" if used. E.g. "Welcome to to my shop Fred." would be chatted to me prepending the IM.
// If used, this messages byte count will be added to those of "IM" and "DM".
 
string IM = "This text will be instant messaged to the visitor.";
// If empty ( "" ) no IM will be sent.
// This MUST be limited to less than 1024 bytes ( around 300 characters ).
// If used, this messages byte count will be added to those of "personalize".
 
string DM = "This text will appear on the dialog ( blue dropdown with buttons ).";
// If empty ( "" ) no Dialog will be sent ( unless there are gifts ).
// This MUST be limited to less than 512 bytes ( around 150 characters ).
// If used, this messages byte count will be added to those of "personalize".
 
string GM = "\nSince you're here I wonder if you would like a gift?"; // If there are gifts in the contents...
// ...this will append "DM" ( it can be empty ( "" )). If used this will add to the byte count of "DM".
 
string folder_name = "Folder of Joy!"; // This will be the name of the folder if a gift pack is given.
 
string notification = "has entered your shop.";
// This message with the full name of the visitor prepended will be IMed to you if it is not empty ( "" ).
 
//////////////////////////////////////////////////////////////////////////////////////////////
//////YOU KNOW THE DRILL...DON'T EDIT ANYTHING BELOW UNLESS YOU KNOW WHAT YOU'RE DOING.///////
//////////////////////////////////////////////////////////////////////////////////////////////
 
key owner;
 
list visitors;
 
list DB = ["OK"];
 
list lises;
 
list inventory;
 
integer gifts;
 
integer lis;
 
integer DC;
 
RemoveListens(key k)
{
    if(k != NULL_KEY)
    {
        integer index = llListFindList(lises, [k]);
        if(index != -1)
        {
            llListenRemove(llList2Integer(lises, (index + 1)));
            lises = llDeleteSubList(lises, index, (index + 1));
        }
    }
    else
    {
        llListenRemove(llList2Integer(lises, 1));
        lises = llDeleteSubList(lises, 0, 1);
    }
    if(!llGetListLength(lises))
    {
        llSetTimerEvent(0.0);
        DC = (llRound(llFrand(-91746382)) - 10000);
    }
}
 
default
{
    state_entry()
    {
        owner = llGetOwner();
        llVolumeDetect(TRUE);
        llSetAlpha(0.0, -1);
        DC = (llRound(llFrand(-91746382)) - 10000);
        integer NOI = llGetInventoryNumber(INVENTORY_ALL);
        if(NOI > 1)
        {
            gifts = TRUE;
            DB = ["Gift Pack", "No Thanks"];
            DM += ("\n" + GM);
            string me = llGetScriptName();
            integer count;
            string name;
            do
            {
                name = llGetInventoryName(INVENTORY_ALL, count);
                if(name != me)
                inventory += [name];
            }
            while((++count)  200)
                    visitors = llDeleteSubList(visitors, 0, 50);
                    visitors += [id];
                    if(DM != "")
                    {
                        if(gifts)
                        {
                            llSetTimerEvent(60.0);
                            lis = llListen((++DC), name, id, "");
                            lises += [id, lis];
                        }
                        llDialog(id, (PM + DM), DB, DC);
                    }
                    if(IM != "")
                    llInstantMessage(id, (PM + IM));
                    if(notification != "")
                    llInstantMessage(owner, (name + " " + notification));
                }
            }
            while((++count) 

 

 

 

Online Status Display & Pager ( V1 )

Expired

This will display the owners profile picture and a color coded and text texture sign that changes depending on the owners online status.

 

Just drop the script into a fresh prim.

 

// V1 //
 
key owner_id; // Use to store the UUID of the owner to save having to keep asking.
 
string owner_name; // Use to store the name of the owner to save having to keep asking.
 
// This a UUID of a texture I created to show either the word "ONLINE" or "OFFLINE".
key ON_OFF_line = "124cfcec-6b8d-552c-42b8-6a1179884e74";
 
// This is added to the owner UUID to make an HTTP request for the owners profile image UUID.
string profile_url = "http://world.secondlife.com/resident/";
 
key name_id; // This key is used to recognize the dataserver request if it is for the name of the owner.
 
key online_id; // This key is used to recognize the dataserver request if it is made automatically.
 
key touch_request_id; // This key is used to recognize the dataserver request if it is made by a user.
 
key update_id; // Used to verify that the HTTP request is for an update of the profile texture.
 
integer lis; // This is used to store the value of a listen and to remove it when not needed.
 
integer channel; // This is used to store the value of the listen channel.
 
key requester; // This is used to store the name of a user who asks to page the owner.
 
string date; // Used to store the date (just in case you couldn't guess).
 
OnlineStatus(integer ol, integer tr) // This function carries two integer type pieces of info.
{ // integer ol is the the boolean online data. 1 for online and zero for offline.
  // integer tr is also boolean. It carries whether the function is being called by a user or automatically.
    list ol_params = []; // This is a local list creation.
    if(ol) // If the owner is online...
    ol_params = [17, 5, ON_OFF_line, <1 .4,0.25,0.0>, <0.0,0.375,0.0>, (90*DEG_TO_RAD), // ..list the object parameters for displaying ONLINE.
                 18, 5, <0.0,1.0,0.0>, 1.0,
                 18, 6, <1 .0,1.0,1.0>, 1.0];
    else // If not...
    ol_params = [17, 5, ON_OFF_line, <1 .4,0.25,0.0>, <0.0,0.625,0.0>, (90*DEG_TO_RAD), // ..list the object parameters for displaying OFFLINE.
                 18, 5, <1 .0,0.0,0.0>, 1.0,
                 18, 6, <0.5,0.5,0.5>, 1.0];
    llSetPrimitiveParams(ol_params); // Set the object parameters to show whatever the list is.
    if(tr) // If this was a touch request...
    {
        llSetTimerEvent(30.0); // Prepare to be ignored (we need to switch the listen off if we are ignored).
        if(ol) // If the owner is online...
        {
            lis = llListen(channel, "", requester, ""); // Open a listen for the user who made the request.
            llDialog(requester, ("\nWould you like to page " + owner_name + "?"), ["YES", "NO"], channel); // Send them a dialog.
        }
        else // If not...
        llInstantMessage(requester, (owner_name + " is currently offline.")); // Send a message explaining that the owner is offline.
    }
}
 
default // Create an area for the events to play in. This is called a "state".
{
    state_entry() // On state entry...
    {
        owner_id = llGetOwner(); // Get the owner UUID (key) and store it.
        name_id = llRequestAgentData(owner_id, DATA_NAME); // Make a request for the owners name.
        channel = -5647; // Set a channel to use for the dialog.
    }
    dataserver(key q, string data) // Triggered when a reply to a data request is recieved.
    {
        if(q == name_id) // Check the id of the request.
        {
            owner_name = data; // Store the result.
            llSetObjectName(owner_name + "'s Online Status"); // Set the name of the object to the owner name + "'s Online Status".
            llHTTPRequest((profile_url + ((string)owner_id)), [], ""); // Request the UUID of the owners profile.
        }
        else if(q == online_id) // Check the id of the request.
        OnlineStatus(((integer)data), FALSE); // Call the OnlineStatus function for an automatic return.
        else if(q == touch_request_id) // Check the id of the request.
        OnlineStatus(((integer)data), TRUE); // Call the OnlineStatus function for a touch-by-user return.
    }
    http_response(key q, integer status, list metadata, string body) // Triggered when a response for an HTTP request is recieved.
    {
        integer tex_key_start = (llSubStringIndex(body, "imageid") + 18); // Establish the point where the image UUID is written in the page.
        integer tex_key_end = (tex_key_start + 35); // Establish the point where the image UUID ends.
        key profile_image = ((key)llGetSubString(body, tex_key_start, tex_key_end)); // Store the the profile image UUID found.
        if(q != update_id) // Check the source of the request.
        {
            llSetPrimitiveParams([9, 0, 0, <0.6,0.875,0.0>, 0.02, ZERO_VECTOR, <1 .0,1.0,0.0>, ZERO_VECTOR, // Shape the object...
                                  8, llEuler2Rot(<0.0,90.0,0.0>*DEG_TO_RAD),
                                  7, <0.85,0.01,0.6>,
                                  17, -1, TEXTURE_BLANK, <1 .0,1.0,0.0>, ZERO_VECTOR, 0.0,
                                  18, -1, ZERO_VECTOR, 1.0]); // ...and texture it with the owners profile image and...
            llSetPrimitiveParams([17, 6, profile_image, <1 .0,1.0,0.0>, ZERO_VECTOR, (90*DEG_TO_RAD),
                                  17, 5, ON_OFF_line, <1 .4,0.25,0.0>, <0.0,0.375,0.0>, (90*DEG_TO_RAD), // the ON/OFFline texture.
                                  19, 5, 0, 1,
                                  18, 6, <1 .0,1.0,1.0>, 1.0,
                                  18, 5, <0.0,1.0,0.0>, 1.0,
                                  20, 5, 1,
                                  20, 6, 1]);
            llSetTimerEvent(0.1); // Move to the timer quickly to run the first OnlineStatus check.
        }
        else
        llSetPrimitiveParams([17, 6, profile_image, <1 .0,1.0,0.0>, ZERO_VECTOR, (90*DEG_TO_RAD)]); // Apply the updated profile texture.
    }
    timer() // Triggered if a timer event is set to a non zero amount.
    {
        llSetTimerEvent(10.0); // Reset the timer event to trigger every 10 seconds.
        llListenRemove(lis); // Always remove any listen we have open.
        online_id = llRequestAgentData(owner_id, DATA_ONLINE); // So every 10 seconds we check if the owner is online.
        string t_date = llGetDate(); // Find out what the date is.
        if(t_date != date) // Check if the date has changed. If it has...
        {
            date = t_date; // ...store the date so the next check to return true will be roughly 24 hours later.
            update_id = llHTTPRequest((profile_url + ((string)owner_id)), [], ""); // Request an update of the UUID of the owners profile.
        }
    }
    touch_start(integer nd) // Triggered on clicking the object that contains the script.
    {
        llSetTimerEvent(0.0); // Stop the timer.
        requester = llDetectedKey(0); // Store the UUID of the person who touched us.
        touch_request_id = llRequestAgentData(owner_id, DATA_ONLINE); // Request the online status of the owner before issuing any dialogs.
    } // We do this becuse if the owner went offline 9 seconds ago we wouldn't know.
    listen(integer chan, string name, key id, string msg) // Triggered when all the specified info is recieved by the script if it has a listen open.
    {
        llListenRemove(lis); // Remove the listen.
        llSetTimerEvent(10.0); // Set the timer to run automatically.
        if(msg == "YES") // If the toucher wants to page the owner (the owner must be online)...
        { // Instant message the owner with a link that when clicked will bring up the touchers profile. This saves searching for the touchers profile.
            llInstantMessage(owner_id, ("secondlife:///app/agent/" + ((string)requester) + "/about has requested to message you."));
            llInstantMessage(requester, owner_name + " has been paged."); // Inform the toucher that the owner has been paged.
        }
    }
}

 

Percentage Paying (optional) Tip Jar ( V2 )

Expired

Pays the percentage (if chosen) to the founder of the group you set the object to.

 

UNDER CERTAIN CONDITIONS (That you set and agree to) THIS SCRIPT WILL TAKE MONEY FROM YOUR ACCOUNT.

 

 

// V2 //
 
key owner;
 
integer debit_perms = FALSE;
 
integer pay_price = 0;
 
list pay_buttons = [20, 50, 100, 250];
 
integer percentage = 50; // Percentage to pay to the founder of the group the object is set to.
 
key beneficiary;
 
string default_message = "/me is very grateful for the generous contribution from ";
 
string beneficiary_message = "% of which has been paid to the founder of ";
 
key group_key;
 
string group_name;
 
default
{
    on_rez(integer param) {
        llResetScript();
    }
    state_entry() {
        owner = llGetOwner();
        llSetObjectName(llKey2Name(owner) + "'s Money Box");
        llSetPayPrice(pay_price, pay_buttons);
        if (percentage) {
            llRequestPermissions(owner, PERMISSION_DEBIT);
        }
    }
    run_time_permissions(integer perms) {
        if (perms & PERMISSION_DEBIT) {
            debit_perms = TRUE;
            group_key = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);
            if (group_key != NULL_KEY) {
                llHTTPRequest("http://world.secondlife.com/group/" + ((string)group_key), [], "");
            }
        } else {
            llOwnerSay("Permissions must be granted for this script to function.");
            llRequestPermissions(owner, PERMISSION_DEBIT);
        }
    }
    http_response(key q, integer status, list metadata, string body) {
        if(status == 200) {
            integer name_start = (llSubStringIndex(body, "") + 7);
            integer name_end = (llSubStringIndex(body, "") - 1);
            integer founder_key_start = (llSubStringIndex(body, "founderid") + 20);
            integer founder_key_end = (founder_key_start + 35);
            beneficiary = llGetSubString(body, founder_key_start, founder_key_end);
            group_name = llGetSubString(body, name_start, name_end);
        } else if (status != 404) {
            llOwnerSay("There is a problem O.o");
            llSleep(10.0);
            llHTTPRequest("http://world.secondlife.com/group/" + ((string)group_key), [], "");
        } else {
            llOwnerSay("Catastrophic failure! Run for you life!!");
        }
    }
    money(key id, integer amount)
    {
        string message = "";
        integer dividend;
        string payer = llKey2Name(id);
        if (!percentage) {
            message = (default_message + payer);
        } else {
            dividend = llFloor((((float)amount)/100.0) * ((float)percentage));
            if (dividend) {
                if (debit_perms) {
                    message = (default_message + payer + ".\n" + ((string)percentage) + beneficiary_message + group_name);
                    llGiveMoney(beneficiary, dividend);
                } else {
                    message = (default_message + payer);
                }
            }
        }
        llSay(PUBLIC_CHANNEL, message);
        // OR llInstantMessage(id, message);
    }
}
[edit]

 

Auto Set Group Joiner ( V2 )

Expired

// V2 //
 
key group_key;
 
Function()
{
    group_key = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);
    if(group_key != NULL_KEY)
    llHTTPRequest("http://world.secondlife.com/group/" + ((string)group_key), [], "");
    else
    {
        llSay(0, "\nSince you are not wearing a group tag I am not set to any group." +
                 "\nWear a group tag and try again." +
                 "\nThis script will self delete.");
        llRemoveInventory(llGetScriptName());
    }
}
 
default
{
    state_entry()
    {
        Function();
    }
    on_rez(integer param)
    {
        Function();
    }
    http_response(key q, integer status, list metadata, string body)
    {
        if(status == 200)
        {
            integer name_start = (llSubStringIndex(body, "") + 7);
            integer name_end = (llSubStringIndex(body, "") - 1);
            integer tex_key_start = (llSubStringIndex(body, "imageid") + 18);
            integer tex_key_end = (tex_key_start + 35);
            string group_name = llGetSubString(body, name_start, name_end);
            llSetObjectName("Join " + group_name);
            key group_tex = llGetSubString(body, tex_key_start, tex_key_end);
            if(group_tex != NULL_KEY)
            llSetTexture(group_tex, ALL_SIDES);
            else
            llSetTexture(TEXTURE_BLANK, ALL_SIDES);
        }
        else
        {
            llOwnerSay("HTTP Request failed. Trying again in 60 seconds. Please wait.");
            llSleep(60.0);
            llHTTPRequest("http://world.secondlife.com/group/" + ((string)group_key), [], "");
        }
    }
    touch_start(integer nd)
    {
        llSay(0, "/me by clicking this link\nsecondlife:///app/group/" + ((string)group_key) + "/about");
    }
}