Difference between revisions of "User:Fred Gandt/Scripts/Continued 4"

From Second Life Wiki
Jump to navigation Jump to search
m (Need to add notes but have an annoying ear ache and want to save this now.)
Line 31: Line 31:
== Free Scripts ==
== Free Scripts ==


=== Campsite ===


'''Notes'''


==== Campsite Builder ====
'''Notes'''
<lsl>default
{
    state_entry()
    {
        llSetPrimitiveParams([7,<4.0, 0.01, 2.0>,
                              9,0,0,<0.375, 0.875, 0.0>,0.0,<0.0, 0.0, 0.0>,<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,
                              17,0,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,1,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,2,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,3,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,4,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,5,"f0863bb8-141a-e705-7fe1-3ac3212b503e",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,6,"e81341cc-5673-10ff-cc11-0e34d6674fcb",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              18,0,<0.0, 0.0, 0.0>,1.0,
                              18,1,<0.0, 0.0, 0.0>,1.0,
                              18,2,<0.0, 0.0, 0.0>,1.0,
                              18,3,<0.0, 0.0, 0.0>,1.0,
                              18,4,<0.0, 0.0, 0.0>,1.0,
                              18,5,<0.04, 0.16, 1.0>,1.0,
                              18,6,<1.0, 1.0, 1.0>,1.0,
                              20,0,0,
                              20,1,0,
                              20,2,0,
                              20,3,0,
                              20,4,0,
                              20,5,1,
                              20,6,1]);
        llRemoveInventory(llGetScriptName());
    }
}</lsl>
==== Messaging ====
'''Notes'''
<lsl>default
{
    link_message(integer sender, integer num, string str, key id)
    {
        if(num == 2468)
        llInstantMessage(id, str);
    }
}</lsl>
==== Campsite ====
'''Notes'''
<lsl>integer max_campers = 1;
integer lindens_per_5_mins = 0;
string e_master = "my_email_address@my_email_service.com";
////////////////////////////////////////////////////////////
string vacancy = "/me  **    A vacancy has opened up!  **";
key WS_UUID = "f0863bb8-141a-e705-7fe1-3ac3212b503e";
integer tracking;
integer perms;
integer open;
integer lis;
integer RTC;
string parcel;
vector where;
key owner;
list logged;
integer InRange(key id)
{
    if(llGetAgentSize(id) != ZERO_VECTOR)
    {
        if(llList2String(llGetParcelDetails(llList2Vector(llGetObjectDetails(id, [OBJECT_POS]), 0), [PARCEL_DETAILS_NAME]), 0) == parcel)
        {
            if(llOverMyLand(id))
            return TRUE;
        }
    }
    return FALSE;
}
LogOut(key id, integer i)
{
    integer time = llList2Integer(logged, (i + 1));
    integer earned = (llFloor(((float)(time / 5))) * lindens_per_5_mins);
    if(earned)
    {
        if(perms)
        llGiveMoney(id, earned);
        else
        {
            llMessageLinked(-1, 2468, "\nLOSS OF PERMISSIONS *shrugs*\nYou owe secondlife:///app/agent/" +
            ((string)id) + "/about - L$" + ((string)earned), owner);
            ShutDown(FALSE);
            return;
        }
    }
    logged = llDeleteSubList(logged, i, (i + 2));
    if(!llGetListLength(logged))
    {
        tracking = FALSE;
        llSetTimerEvent(30.0);
    }
    llMessageLinked(-1, 36912, "", id);
    llMessageLinked(-1, 2468, "\nYou have stopped camping!" +
    "\nAs agreed you are being paid " + ((string)earned) + "L$ for " + ((string)time) + " minutes camping." +
    "\nPlease come again soon!", id);
    --RTC;
    llSay(0, vacancy);
}
ShutDown(integer e)
{
    open = FALSE;
    RTC = max_campers;
    tracking = FALSE;
    llSetTimerEvent(0.0);
    llResetOtherScript("Wordsearch");
    while(llGetListLength(logged))
    {
        key id = llList2Key(logged, 0);
        if(id)
        {
            integer time = llList2Integer(logged, 1);
            integer earned = (llFloor(((float)(time / 5))) * lindens_per_5_mins);
            if(earned)
            {
                if(perms)
                llGiveMoney(id, earned);
                else
                llMessageLinked(-1, 2468, "\nLOSS OF PERMISSIONS *shrugs*\nYou owe secondlife:///app/agent/" +
                ((string)id) + "/about - L$" + ((string)earned), owner);
            }
            logged = llDeleteSubList(logged, 0, 2);
            llMessageLinked(-1, 2468, "\nThe owner has shut the campsite." +
            "\nAs agreed you are being paid " + ((string)earned) + "L$ for " + ((string)time) + " minutes camping." +
            "\nPlease come again soon!", id);
        }
    }
    if(e)
    llEmail(e_master, "ShutDown Complete!", "");
    else
    llMessageLinked(-1, 2468, "\nShutDown Complete!", owner);
    llSetTimerEvent(30.0);
}
StartUp(integer e)
{
    open = TRUE;
    RTC = 0;
    if(e)
    llEmail(e_master, "StartUp Complete!", "");
    else
    llMessageLinked(-1, 2468, "\nStartUp Complete!", owner);
    llSay(0, vacancy);
}
Track()
{
    integer count;
    integer to_track = llGetListLength(logged);
    do
    {
        key agent = llList2Key(logged, count);
        integer index = llListFindList(logged, [agent]);
        if(!InRange(agent))
        LogOut(agent, index);
        else
        {
            integer min = llAbs((integer)llGetSubString(llGetTimestamp(), 14, 15));
            integer last = llList2Integer(logged, (index + 2));
            integer extra = (min - last);
            if(extra == -59)
            extra = 1;
            integer total = llList2Integer(logged, (index + 1));
            logged = llListReplaceList(logged, [(total + extra), min], (index + 1), (index + 2));
            if((extra) && (!(total % 5)) && (total != 0))
            llMessageLinked(-1, 0, "foo", agent);
        }
        count = (count + 3);
    }
    while(count < to_track);
}
default
{
    on_rez(integer param)
    {
        llResetScript();
    }
    state_entry()
    {
        owner = llGetOwner();
        where = llGetPos();
        parcel = llList2String(llGetParcelDetails(where, [PARCEL_DETAILS_NAME]), 0);
        llRequestPermissions(owner, PERMISSION_DEBIT);
    }
    run_time_permissions(integer p)
    {
        if(p & PERMISSION_DEBIT)
        {
            perms = TRUE;
            open = TRUE;
            llMessageLinked(-1, 2468, "\nMy email address is - " + ((string)llGetKey()) + "@lsl.secondlife.com", owner);
            llSetTimerEvent(30.0);
        }
        else
        {
            llMessageLinked(-1, 2468, "\nPermissions to debit your account MUST be granted for this script to function.", owner);
            llRequestPermissions(owner, PERMISSION_DEBIT);
        }
    }
    touch_start(integer nd)
    {
        if(llDetectedTouchFace(0) != 5)
        {
            integer count;
            do
            {
                key id = llDetectedKey(count);
                if(id != owner)
                {
                    if(InRange(id))
                    {
                        integer index = llListFindList(logged, [id]);
                        if(index != -1)
                        {
                            integer time = llList2Integer(logged, (index + 1));
                            integer earned = (llFloor(((float)(time / 5))) * lindens_per_5_mins);
                            llMessageLinked(-1, 2468, "\nYou have clocked " + ((string)time) + " minutes." +
                            "\nYou would be paid " + ((string)earned) + "L$ if you left now.", id);
                        }
                        else
                        {
                            if(((++RTC) <= max_campers) && perms)
                            llMessageLinked(-1, 0, "foo", id);
                            else
                            {
                                --RTC;
                                llMessageLinked(-1, 2468, "\nThere are no camping slots available at this time.", id);
                            }
                        }
                    }
                    else
                    llMessageLinked(-1, 2468, "\nYou must be within \"" + parcel + "\" to log in.", id);
                }
                else
                {
                    list buttons = ["Nothing"];
                    lis = llListen(-8365583, llKey2Name(owner), owner, "");
                    if(open)
                    buttons += ["ShutDown"];
                    else
                    buttons += ["StartUp"];
                    llDialog(owner, "\n\nWhat is your bidding?", buttons, -8365583);
                }
            }
            while((++count) < nd);
        }
    }
    listen(integer chan, string name, key id, string msg)
    {
        llListenRemove(lis);
        if(msg != "Nothing")
        {
            if(msg == "ShutDown")
            ShutDown(FALSE);
            else if(msg == "StartUp")
            StartUp(FALSE);
        }
    }
    email(string t, string a, string s, string m, integer n)
    {
        if(a == e_master)
        {
            if(llToLower(s) == "shutdown")
            {
                if(open)
                ShutDown(TRUE);
                else
                llEmail(e_master, "Allready ShutDown. Other option is \"StartUp\"", "");
            }
            else if(llToLower(s) == "startup")
            {
                if(!open)
                StartUp(TRUE);
                else
                llEmail(e_master, "Allready StartedUp. Other option is \"ShutDown\"", "");
            }
        }
    }
    link_message(integer sender, integer num, string str, key id)
    {
        if((str != "foo") && (num != 2468) && (num != 36912) && (str != "oof"))
        {
            if(!num)
            {
                integer index = llListFindList(logged, [id]);
                if(index != -1)
                LogOut(id, index);
                else
                {
                    --RTC;
                    llMessageLinked(-1, 2468, "\nYou have failed to pass the test." +
                    "\nYou are not logged in to camp.\nTry again?", id);
                    llSay(0, vacancy);
                }
            }
            else
            {
                integer index = llListFindList(logged, [id]);
                if(index == -1)
                {
                    logged += [id, -1, llAbs((integer)llGetSubString(llGetTimestamp(), 14, 15))];
                    llMessageLinked(-1, 2468, "\nYou have begun camping!" +
                    "\nYou must remain within the parcel - \"" + parcel + "\".\nYou will be paid " +
                    ((string)lindens_per_5_mins) + "L$ for every full " +
                    "5 minutes you are on-site.\nThere will be intermittent re-tests.", id);
                }
                else
                llMessageLinked(-1, 2468, "\nYou have passed this test!", id);
                if(!tracking)
                {
                    tracking = TRUE;
                    llSetTimerEvent(10.0);
                }
            }
        }
    }
    changed(integer change)
    {
        if(change & CHANGED_OWNER)
        llResetScript();
        if(change & CHANGED_TEXTURE)
        {
            if(llList2Key(llGetPrimitiveParams([17, 5]), 0) != WS_UUID)
            {
                if(open)
                ShutDown(FALSE);
                llSleep(0.2);
                llMessageLinked(-1, 0, "oof", owner);
            }
        }
    }
    timer()
    {
        if(tracking)
        Track();
        llGetNextEmail(e_master, "");
    }
}</lsl>
==== Wordsearcher ====
'''Notes'''
<lsl>list words = [
"ANIMATION",
"59,58,57,56,55,54,53,52,51,",
"TELEPORT",
"2,12,22,32,42,52,62,72,",
"LANDMARK",
"71,61,51,41,31,21,11,1,",
"MEGAPRIM",
"10,20,30,40,50,60,70,80,",
"CAMPING",
"34,45,56,67,78,89,100,",
"TEXTURE",
"87,86,85,84,83,82,81,",
"AVATAR",
"92,93,94,95,96,97,",
"REGION",
"4,5,6,7,8,9,",
"OBJECT",
"24,25,26,27,28,29,",
"SCRIPT",
"14,15,16,17,18,19,",
"LINDEN",
"79,78,77,76,75,74,",
"PARCEL",
"44,45,46,47,48,49,",
"FURRY",
"43,33,23,13,3,",
"GROUP",
"39,38,37,36,35,"
];
////////////////////////////
list agents;
list plot_list;
key owner;
string owner_name;
integer lis;
integer coord_count = 0;
string new_coords;
integer lis_by_2;
integer channel = 888;
integer string_length;
TimerControl(float tn)
{
    if(!llGetListLength(agents))
    llSetTimerEvent(0.0);
    else
    {
        float nt = llList2Float(agents, 4);
        if(tn < nt)
        llSetTimerEvent((60.0 - ((60.0 - nt) + tn)));
        else
        llSetTimerEvent((60.0 - (tn - nt)));
    }
}
default
{
    on_rez(integer param)
    {
        llResetScript();
    }
    changed(integer change)
    {
        if(change & CHANGED_OWNER)
        llResetScript();
    }
    state_entry()
    {
        owner = llGetOwner();
        owner_name = llKey2Name(owner);
    }
    link_message(integer sender, integer num, string str, key id)
    {
        if(str == "foo")
        {
            if(llListFindList(agents, [id]) == -1)
            {
                agents += [id];
                list strided = llList2ListStrided(words, 0, -1, 2);
                integer index = (llRound(llFrand(((float)(llGetListLength(strided) - 1)))));
                string word = llList2String(strided, index);
                index = (llListFindList(words, [word]) + 1);
                string coords = llList2String(words, index);
                agents += [coords, "", 0];
                llMessageLinked(-1, 2468, "\nPlease click on each letter (in correct spelling order) of the word \"" +
                word + "\" within the next 60 seconds.", id);
                agents += [((float)llGetSubString(llGetTimestamp(), -10, -2))];
                if(llGetListLength(agents) == 5)
                llSetTimerEvent(60.0);
            }
        }
        else if(num == 36912)
        {
            integer index = llListFindList(agents, [id]);
            if(index != -1)
            {
                agents = llDeleteSubList(agents, index, (index + 4));
                TimerControl(((float)llGetSubString(llGetTimestamp(), -10, -2)));
            }
        }
        else if(str == "oof")
        {
            lis = llListen(channel, owner_name, owner, "");
            lis_by_2 = llListen((channel * 2), owner_name, owner, "DONE");
            llMessageLinked(-1, 2468, ("\nPlease say the first word you want to plot on channel " + ((string)channel)), owner);
        }
    }
    listen(integer chan, string name, key id, string msg)
    {
        if(chan == channel)
        {
            if(!llGetListLength(plot_list))
            {
                plot_list = ["list words = ["];
                llDialog(owner, "\nClick \"DONE\" when you have FINISHED plotting ALL OF the new Wordsearch", ["DONE"], (channel * 2));
            }
            plot_list += [("\"" + llStringTrim(msg, STRING_TRIM) + "\"")];
            string_length = llStringLength(llStringTrim(msg, STRING_TRIM));
            llMessageLinked(-1, 2468, ("\nNow click each letter (in correct spelling order) of \"" +
            llStringTrim(msg, STRING_TRIM)) + "\".", owner);
        }
        else if((chan == (channel * 2)) && (msg == "DONE"))
        {
            llListenRemove(lis);
            llListenRemove(lis_by_2);
            plot_list += ["];"];
            llMessageLinked(-1, 2468, ("\nPlease paste this list into this script to replace the \"words\" list and click \"Save\".\n\n" +
            llList2String(plot_list, 0) + "\n" + llDumpList2String(llList2List(plot_list, 1, -1), ",\n") + "\n"), owner);
            plot_list = [];
            llMessageLinked(-1, 2468, ("\nPlease paste this to replace the WS_UUID in the \"Campsite\" script and click \"Save\".\n\n" +
            "key WS_UUID = \"" + ((string)llList2Key(llGetPrimitiveParams([17, 5]), 0)) + "\";\n"), owner);
        }
    }
    touch_start(integer nd)
    {
        integer count;
        do
        {
            if(llDetectedTouchFace(count) == 5)
            {
                if(!llGetListLength(plot_list))
                {
                    integer index = llListFindList(agents, [llDetectedKey(count)]);
                    if(index != -1)
                    {
                        vector v = llDetectedTouchUV(0);
                        integer coord = ((llFloor(v.x * 10.0) * 10) + llFloor(v.y * 10.0) + 1);
                        string coord_so_far = (llList2String(agents, (index + 2)) + (((string)coord) + ","));
                        agents = llListReplaceList(agents, [coord_so_far], (index + 2), (index + 2));
                        if(coord_so_far == llList2String(agents, (index + 1)))
                        {
                            llMessageLinked(-1, 1, "", llList2Key(agents, index));
                            agents = llDeleteSubList(agents, index, (index + 4));
                            TimerControl(((float)llGetSubString(llGetTimestamp(), -10, -2)));
                        }
                    }
                }
                else
                {
                    if(llDetectedKey(count) == owner)
                    {
                        vector v = llDetectedTouchUV(0);
                        integer coord = ((llFloor(v.x * 10.0) * 10) + llFloor(v.y * 10.0) + 1);
                        new_coords += (((string)coord) + ",");
                        if((++coord_count) == string_length)
                        {
                            coord_count = 0;
                            plot_list += ["\"" + new_coords + "\""];
                            new_coords = "";
                            llMessageLinked(-1, 2468, "\nSay the next word on 888 OR click \"DONE\" if finished.", owner);
                        }
                    }
                }
            }
        }
        while((++count) < nd);
    }
    timer()
    {
        key agent = llList2Key(agents, 0);
        integer index = llListFindList(agents, [agent]);
        if(!llList2Integer(agents, (index + 3)))
        {
            list entry = llListReplaceList(llList2List(agents, index, (index + 4)), ["", 1], 2, 3);
            agents = llDeleteSubList(agents, index, (index + 4));
            agents += entry;
            llMessageLinked(-1, 2468, "\nYou have not entered the correct word." +
            "\nYou have 1 more chance." +
            "\nYou have 60 more seconds.", agent);
        }
        else
        {
            llMessageLinked(-1, 0, "", agent);
            agents = llDeleteSubList(agents, index, (index + 4));
        }
        TimerControl(((float)llGetSubString(llGetTimestamp(), -10, -2)));
    }
}</lsl>


== More Scripts... ==
== More Scripts... ==

Revision as of 20:42, 26 March 2010

FG jpg.jpg

My Contributions

I have implemented a V# system to make it more obvious if a script is updated. The V# forms part of the title of each script.

If you have any comments about the content of this page please post them HERE

More Pages

Free Scripts (content constantly updating)

More Free Scripts (content constantly updating)

Even More Free Scripts (content constantly updating)

Even More More Free Scripts (content constantly updating)

Legal Stuff

The legal stuff about contributing to this wiki (worth reading).

Tuition

Tuition scripts, notes, videos and screenshots etc. (hardly any content yet)

Free Scripts

Campsite

Notes

Campsite Builder

Notes

<lsl>default {

   state_entry()
   {
       llSetPrimitiveParams([7,<4.0, 0.01, 2.0>,
                              9,0,0,<0.375, 0.875, 0.0>,0.0,<0.0, 0.0, 0.0>,<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,
                              17,0,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,1,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,2,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,3,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,4,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,5,"f0863bb8-141a-e705-7fe1-3ac3212b503e",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              17,6,"e81341cc-5673-10ff-cc11-0e34d6674fcb",<1.0, 1.0, 0.0>,<0.0, 0.0, 0.0>,0.0,
                              18,0,<0.0, 0.0, 0.0>,1.0,
                              18,1,<0.0, 0.0, 0.0>,1.0,
                              18,2,<0.0, 0.0, 0.0>,1.0,
                              18,3,<0.0, 0.0, 0.0>,1.0,
                              18,4,<0.0, 0.0, 0.0>,1.0,
                              18,5,<0.04, 0.16, 1.0>,1.0,
                              18,6,<1.0, 1.0, 1.0>,1.0,
                              20,0,0,
                              20,1,0,
                              20,2,0,
                              20,3,0,
                              20,4,0,
                              20,5,1,
                              20,6,1]);
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

Messaging

Notes

<lsl>default {

   link_message(integer sender, integer num, string str, key id)
   {
       if(num == 2468)
       llInstantMessage(id, str);
   }

}</lsl>

Campsite

Notes

<lsl>integer max_campers = 1;

integer lindens_per_5_mins = 0;

string e_master = "my_email_address@my_email_service.com";

////////////////////////////////////////////////////////////

string vacancy = "/me ** A vacancy has opened up! **";

key WS_UUID = "f0863bb8-141a-e705-7fe1-3ac3212b503e";

integer tracking;

integer perms;

integer open;

integer lis;

integer RTC;

string parcel;

vector where;

key owner;

list logged;

integer InRange(key id) {

   if(llGetAgentSize(id) != ZERO_VECTOR)
   {
       if(llList2String(llGetParcelDetails(llList2Vector(llGetObjectDetails(id, [OBJECT_POS]), 0), [PARCEL_DETAILS_NAME]), 0) == parcel)
       {
           if(llOverMyLand(id))
           return TRUE;
       }
   }
   return FALSE;

}

LogOut(key id, integer i) {

   integer time = llList2Integer(logged, (i + 1));
   integer earned = (llFloor(((float)(time / 5))) * lindens_per_5_mins);
   if(earned)
   {
       if(perms)
       llGiveMoney(id, earned);
       else
       {
           llMessageLinked(-1, 2468, "\nLOSS OF PERMISSIONS *shrugs*\nYou owe secondlife:///app/agent/" +
           ((string)id) + "/about - L$" + ((string)earned), owner);
           ShutDown(FALSE);
           return;
       }
   }
   logged = llDeleteSubList(logged, i, (i + 2));
   if(!llGetListLength(logged))
   {
       tracking = FALSE;
       llSetTimerEvent(30.0);
   }
   llMessageLinked(-1, 36912, "", id);
   llMessageLinked(-1, 2468, "\nYou have stopped camping!" +
   "\nAs agreed you are being paid " + ((string)earned) + "L$ for " + ((string)time) + " minutes camping." +
   "\nPlease come again soon!", id);
   --RTC;
   llSay(0, vacancy);

}

ShutDown(integer e) {

   open = FALSE;
   RTC = max_campers;
   tracking = FALSE;
   llSetTimerEvent(0.0);
   llResetOtherScript("Wordsearch");
   while(llGetListLength(logged))
   {
       key id = llList2Key(logged, 0);
       if(id)
       {
           integer time = llList2Integer(logged, 1);
           integer earned = (llFloor(((float)(time / 5))) * lindens_per_5_mins);
           if(earned)
           {
               if(perms)
               llGiveMoney(id, earned);
               else
               llMessageLinked(-1, 2468, "\nLOSS OF PERMISSIONS *shrugs*\nYou owe secondlife:///app/agent/" +
               ((string)id) + "/about - L$" + ((string)earned), owner);
           }
           logged = llDeleteSubList(logged, 0, 2);
           llMessageLinked(-1, 2468, "\nThe owner has shut the campsite." +
           "\nAs agreed you are being paid " + ((string)earned) + "L$ for " + ((string)time) + " minutes camping." +
           "\nPlease come again soon!", id);
       }
   }
   if(e)
   llEmail(e_master, "ShutDown Complete!", "");
   else
   llMessageLinked(-1, 2468, "\nShutDown Complete!", owner);
   llSetTimerEvent(30.0);

}

StartUp(integer e) {

   open = TRUE;
   RTC = 0;
   if(e)
   llEmail(e_master, "StartUp Complete!", "");
   else
   llMessageLinked(-1, 2468, "\nStartUp Complete!", owner);
   llSay(0, vacancy);

}

Track() {

   integer count;
   integer to_track = llGetListLength(logged);
   do
   {
       key agent = llList2Key(logged, count);
       integer index = llListFindList(logged, [agent]);
       if(!InRange(agent))
       LogOut(agent, index);
       else
       {
           integer min = llAbs((integer)llGetSubString(llGetTimestamp(), 14, 15));
           integer last = llList2Integer(logged, (index + 2));
           integer extra = (min - last);
           if(extra == -59)
           extra = 1;
           integer total = llList2Integer(logged, (index + 1));
           logged = llListReplaceList(logged, [(total + extra), min], (index + 1), (index + 2));
           if((extra) && (!(total % 5)) && (total != 0))
           llMessageLinked(-1, 0, "foo", agent);
       }
       count = (count + 3);
   }
   while(count < to_track);

}

default {

   on_rez(integer param)
   {
       llResetScript();
   }
   state_entry()
   {
       owner = llGetOwner();
       where = llGetPos();
       parcel = llList2String(llGetParcelDetails(where, [PARCEL_DETAILS_NAME]), 0);
       llRequestPermissions(owner, PERMISSION_DEBIT);
   }
   run_time_permissions(integer p)
   {
       if(p & PERMISSION_DEBIT)
       {
           perms = TRUE;
           open = TRUE;
           llMessageLinked(-1, 2468, "\nMy email address is - " + ((string)llGetKey()) + "@lsl.secondlife.com", owner);
           llSetTimerEvent(30.0);
       }
       else
       {
           llMessageLinked(-1, 2468, "\nPermissions to debit your account MUST be granted for this script to function.", owner);
           llRequestPermissions(owner, PERMISSION_DEBIT);
       }
   }
   touch_start(integer nd)
   {
       if(llDetectedTouchFace(0) != 5)
       {
           integer count;
           do
           {
               key id = llDetectedKey(count);
               if(id != owner)
               {
                   if(InRange(id))
                   {
                       integer index = llListFindList(logged, [id]);
                       if(index != -1)
                       {
                           integer time = llList2Integer(logged, (index + 1));
                           integer earned = (llFloor(((float)(time / 5))) * lindens_per_5_mins);
                           llMessageLinked(-1, 2468, "\nYou have clocked " + ((string)time) + " minutes." + 
                           "\nYou would be paid " + ((string)earned) + "L$ if you left now.", id);
                       }
                       else
                       {
                           if(((++RTC) <= max_campers) && perms)
                           llMessageLinked(-1, 0, "foo", id);
                           else
                           {
                               --RTC;
                               llMessageLinked(-1, 2468, "\nThere are no camping slots available at this time.", id);
                           }
                       }
                   }
                   else
                   llMessageLinked(-1, 2468, "\nYou must be within \"" + parcel + "\" to log in.", id);
               }
               else
               {
                   list buttons = ["Nothing"];
                   lis = llListen(-8365583, llKey2Name(owner), owner, "");
                   if(open)
                   buttons += ["ShutDown"];
                   else
                   buttons += ["StartUp"];
                   llDialog(owner, "\n\nWhat is your bidding?", buttons, -8365583);
               }
           }
           while((++count) < nd);
       }
   }
   listen(integer chan, string name, key id, string msg)
   {
       llListenRemove(lis);
       if(msg != "Nothing")
       {
           if(msg == "ShutDown")
           ShutDown(FALSE);
           else if(msg == "StartUp")
           StartUp(FALSE);
       }
   }
   email(string t, string a, string s, string m, integer n)
   {
       if(a == e_master)
       {
           if(llToLower(s) == "shutdown")
           {
               if(open)
               ShutDown(TRUE);
               else
               llEmail(e_master, "Allready ShutDown. Other option is \"StartUp\"", "");
           }
           else if(llToLower(s) == "startup")
           {
               if(!open)
               StartUp(TRUE);
               else
               llEmail(e_master, "Allready StartedUp. Other option is \"ShutDown\"", "");
           }
       }
   }
   link_message(integer sender, integer num, string str, key id)
   {
       if((str != "foo") && (num != 2468) && (num != 36912) && (str != "oof"))
       {
           if(!num)
           {
               integer index = llListFindList(logged, [id]);
               if(index != -1)
               LogOut(id, index);
               else
               {
                   --RTC;
                   llMessageLinked(-1, 2468, "\nYou have failed to pass the test." +
                   "\nYou are not logged in to camp.\nTry again?", id);
                   llSay(0, vacancy);
               }
           }
           else
           {
               integer index = llListFindList(logged, [id]);
               if(index == -1)
               {
                   logged += [id, -1, llAbs((integer)llGetSubString(llGetTimestamp(), 14, 15))];
                   llMessageLinked(-1, 2468, "\nYou have begun camping!" + 
                   "\nYou must remain within the parcel - \"" + parcel + "\".\nYou will be paid " +
                   ((string)lindens_per_5_mins) + "L$ for every full " +
                   "5 minutes you are on-site.\nThere will be intermittent re-tests.", id);
               }
               else
               llMessageLinked(-1, 2468, "\nYou have passed this test!", id);
               if(!tracking)
               {
                   tracking = TRUE;
                   llSetTimerEvent(10.0);
               }
           }
       }
   }
   changed(integer change)
   {
       if(change & CHANGED_OWNER)
       llResetScript();
       if(change & CHANGED_TEXTURE)
       {
           if(llList2Key(llGetPrimitiveParams([17, 5]), 0) != WS_UUID)
           {
               if(open)
               ShutDown(FALSE);
               llSleep(0.2);
               llMessageLinked(-1, 0, "oof", owner);
           }
       }
   }
   timer()
   {
       if(tracking)
       Track();
       llGetNextEmail(e_master, "");
   }

}</lsl>

Wordsearcher

Notes

<lsl>list words = [ "ANIMATION", "59,58,57,56,55,54,53,52,51,", "TELEPORT", "2,12,22,32,42,52,62,72,", "LANDMARK", "71,61,51,41,31,21,11,1,", "MEGAPRIM", "10,20,30,40,50,60,70,80,", "CAMPING", "34,45,56,67,78,89,100,", "TEXTURE", "87,86,85,84,83,82,81,", "AVATAR", "92,93,94,95,96,97,", "REGION", "4,5,6,7,8,9,", "OBJECT", "24,25,26,27,28,29,", "SCRIPT", "14,15,16,17,18,19,", "LINDEN", "79,78,77,76,75,74,", "PARCEL", "44,45,46,47,48,49,", "FURRY", "43,33,23,13,3,", "GROUP", "39,38,37,36,35," ];

////////////////////////////

list agents;

list plot_list;

key owner;

string owner_name;

integer lis;

integer coord_count = 0;

string new_coords;

integer lis_by_2;

integer channel = 888;

integer string_length;

TimerControl(float tn) {

   if(!llGetListLength(agents))
   llSetTimerEvent(0.0);
   else
   {
       float nt = llList2Float(agents, 4);
       if(tn < nt)
       llSetTimerEvent((60.0 - ((60.0 - nt) + tn)));
       else
       llSetTimerEvent((60.0 - (tn - nt)));
   }

}

default {

   on_rez(integer param)
   {
       llResetScript();
   }
   changed(integer change)
   {
       if(change & CHANGED_OWNER)
       llResetScript();
   }
   state_entry()
   {
       owner = llGetOwner();
       owner_name = llKey2Name(owner);
   }
   link_message(integer sender, integer num, string str, key id)
   {
       if(str == "foo")
       {
           if(llListFindList(agents, [id]) == -1)
           {
               agents += [id];
               list strided = llList2ListStrided(words, 0, -1, 2);
               integer index = (llRound(llFrand(((float)(llGetListLength(strided) - 1)))));
               string word = llList2String(strided, index);
               index = (llListFindList(words, [word]) + 1);
               string coords = llList2String(words, index);
               agents += [coords, "", 0];
               llMessageLinked(-1, 2468, "\nPlease click on each letter (in correct spelling order) of the word \"" +
               word + "\" within the next 60 seconds.", id);
               agents += [((float)llGetSubString(llGetTimestamp(), -10, -2))];
               if(llGetListLength(agents) == 5)
               llSetTimerEvent(60.0);
           }
       }
       else if(num == 36912)
       {
           integer index = llListFindList(agents, [id]);
           if(index != -1)
           {
               agents = llDeleteSubList(agents, index, (index + 4));
               TimerControl(((float)llGetSubString(llGetTimestamp(), -10, -2)));
           }
       }
       else if(str == "oof")
       {
           lis = llListen(channel, owner_name, owner, "");
           lis_by_2 = llListen((channel * 2), owner_name, owner, "DONE");
           llMessageLinked(-1, 2468, ("\nPlease say the first word you want to plot on channel " + ((string)channel)), owner);
       }
   }
   listen(integer chan, string name, key id, string msg)
   {
       if(chan == channel)
       {
           if(!llGetListLength(plot_list))
           {
               plot_list = ["list words = ["];
               llDialog(owner, "\nClick \"DONE\" when you have FINISHED plotting ALL OF the new Wordsearch", ["DONE"], (channel * 2));
           }
           plot_list += [("\"" + llStringTrim(msg, STRING_TRIM) + "\"")];
           string_length = llStringLength(llStringTrim(msg, STRING_TRIM));
           llMessageLinked(-1, 2468, ("\nNow click each letter (in correct spelling order) of \"" +
           llStringTrim(msg, STRING_TRIM)) + "\".", owner);
       }
       else if((chan == (channel * 2)) && (msg == "DONE"))
       {
           llListenRemove(lis);
           llListenRemove(lis_by_2);
           plot_list += ["];"];
           llMessageLinked(-1, 2468, ("\nPlease paste this list into this script to replace the \"words\" list and click \"Save\".\n\n" +
           llList2String(plot_list, 0) + "\n" + llDumpList2String(llList2List(plot_list, 1, -1), ",\n") + "\n"), owner);
           plot_list = [];
           llMessageLinked(-1, 2468, ("\nPlease paste this to replace the WS_UUID in the \"Campsite\" script and click \"Save\".\n\n" +
           "key WS_UUID = \"" + ((string)llList2Key(llGetPrimitiveParams([17, 5]), 0)) + "\";\n"), owner);
       }
   }
   touch_start(integer nd)
   {
       integer count;
       do
       {
           if(llDetectedTouchFace(count) == 5)
           {
               if(!llGetListLength(plot_list))
               {
                   integer index = llListFindList(agents, [llDetectedKey(count)]);
                   if(index != -1)
                   {
                       vector v = llDetectedTouchUV(0);
                       integer coord = ((llFloor(v.x * 10.0) * 10) + llFloor(v.y * 10.0) + 1);
                       string coord_so_far = (llList2String(agents, (index + 2)) + (((string)coord) + ","));
                       agents = llListReplaceList(agents, [coord_so_far], (index + 2), (index + 2));
                       if(coord_so_far == llList2String(agents, (index + 1)))
                       {
                           llMessageLinked(-1, 1, "", llList2Key(agents, index));
                           agents = llDeleteSubList(agents, index, (index + 4));
                           TimerControl(((float)llGetSubString(llGetTimestamp(), -10, -2)));
                       }
                   }
               }
               else
               {
                   if(llDetectedKey(count) == owner)
                   {
                       vector v = llDetectedTouchUV(0);
                       integer coord = ((llFloor(v.x * 10.0) * 10) + llFloor(v.y * 10.0) + 1);
                       new_coords += (((string)coord) + ",");
                       if((++coord_count) == string_length)
                       {
                           coord_count = 0;
                           plot_list += ["\"" + new_coords + "\""];
                           new_coords = "";
                           llMessageLinked(-1, 2468, "\nSay the next word on 888 OR click \"DONE\" if finished.", owner);
                       }
                   }
               }
           }
       }
       while((++count) < nd);
   }
   timer()
   {
       key agent = llList2Key(agents, 0);
       integer index = llListFindList(agents, [agent]);
       if(!llList2Integer(agents, (index + 3)))
       {
           list entry = llListReplaceList(llList2List(agents, index, (index + 4)), ["", 1], 2, 3);
           agents = llDeleteSubList(agents, index, (index + 4));
           agents += entry;
           llMessageLinked(-1, 2468, "\nYou have not entered the correct word." +
           "\nYou have 1 more chance." + 
           "\nYou have 60 more seconds.", agent);
       }
       else
       {
           llMessageLinked(-1, 0, "", agent);
           agents = llDeleteSubList(agents, index, (index + 4));
       }
       TimerControl(((float)llGetSubString(llGetTimestamp(), -10, -2)));
   }

}</lsl>

More Scripts...

Free Scripts

More Free Scripts

Even More Free Scripts

Even More More Free Scripts

If you have any comments about the content of this page please post them HERE