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

From Second Life Wiki
Jump to navigation Jump to search
(Camping is now against ToS? Unregistered bots can still game traffic tho. Registered (responsible) ones don't? LL...not clever.)
m (a little tidying)
 
(76 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{LSL Header}}
{{User:Fred Gandt/Template|content=


{{RightToc|right;}}
== Free Scripts ==
=== Text Scroller ===
A simple text display unit that scrolls text from right to left (like ''those'' LED signs) in a continuous loop.
Touch to start and stop the scrolling. It is not very sophisticated.


[[Image:FG_jpg.jpg|thumb|left]]
==== Create The Object ====
* Create a fresh new prim and drop this script onto/into it. The prim will form the shape needed plus change the texturing etc. (you can do what you like to the texturing afterwards).


== My Contributions ==
<syntaxhighlight lang="lsl2">// V2 //


'''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.'''
default {
    state_entry() {
        llSetPrimitiveParams( [
            7, <0.5, 0.01, 0.25>, // Set the size
            8, <0.0, 0.0, 0.0, 1.0>, // Set to ZERO_ROTATION
            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>, // Shape the prim
            17, -1, "5748decc-f629-461c-9a36-a35a221fe21f", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0, // Apply the blank texture
            18, -1, <1.0, 0.65, 0.1>, 1.0, // Color the prim (kinda orange)
            20, -1, 1, // Make fullbright
            25, -1, 0.05 // Slight glow
        ] );
        llRemoveInventory( llGetScriptName() ); // Remove the script when done
    }
}</syntaxhighlight>


'''If you have any comments about the content of this page please post them [[User_talk:Fred_Gandt/Scripts/Continued_4 | HERE]]'''
* When the script has worked its magic, '''[[How_to_use_the_building_grid_-_Video_Tutorial | Snap the prim to the grid]]''' with a grid size of .5 meters.
* Shift-Drag-Copy the prim, snapping each to the grid positively along the X axis until you have 10 prims in a continuous strip.
You can actually make the object as long or short as you like. 1 prim will work. 100 prims will work (although large linksets have been a problem for [[link_message]]s in the past). Just follow the same basic build plan.
* Select each of the prims from the end that has the greatest X axis position, one at a time (negatively along the X axis) until ALL are selected.


=== More Pages ===
[[Image:Text Scroller How It Should Look jpg.jpg|800px]]


'''[[User:Fred_Gandt/Scripts| Free Scripts]]''' (content constantly updating)
* Link the set.


'''[[User:Fred_Gandt/Scripts/Continued_1| More Free Scripts]]''' (content constantly updating)
==== Display Script ====
* Check "Edit Linked parts" and select one prim at a time, dropping this script in each.
* '''DO NOT CREATE A FRESH SCRIPT IN EACH PRIM. DROP THE SAME SCRIPT FROM YOUR INVENTORY INTO EACH PRIM.'''


'''[[User:Fred_Gandt/Scripts/Continued_2| Even More Free Scripts]]''' (content constantly updating)
<syntaxhighlight lang="lsl2">// V1 //


'''[[User:Fred_Gandt/Scripts/Continued_3| Even More More Free Scripts]]''' (content constantly updating)
string font = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890(){}[]<>|\\/.,;:'!?\"£$%^&*_+-=~#@ ";
// A accurate representation of the characters featured on the texture used to display the text.
vector GetOffset(string s) {
    if ( s == "" ) { // If there is no text
        s = " "; // Use a space
    }
    integer i = llSubStringIndex( font, s ); // Find the character
    if ( i == -1 ) { // If we can't find it
        i = 94; // Use a space
    }
    return <( -0.45 + ( ( i % 10 ) * 0.1 ) ), ( 0.45 - ( llRound( i / 10 ) * 0.1 ) ), 0.0>;
} // Return the offset needed to display the correct section of the texture by doing the mathematics *coughs*
integer me; // Used to store the Link number
integer my_ss_5; // Used to store the index of the feed text we display on face 5
integer my_ss_6; // Used to store the index of the feed text we display on face 6
default {
    state_entry() {
        me = llGetLinkNumber();
        my_ss_6 = ( ( me - 1 ) * 2 ); // Whatever link we are (in a correctly built object) establish the index to grab
        my_ss_5 = ( my_ss_6 + 1 ); // And also grab the next
    }
    link_message( integer sender, integer num, string msg, key id ) {
        llSetLinkPrimitiveParamsFast( me, [
            17, 5, id, <0.1, 0.1, 0.0>, GetOffset( llGetSubString( msg, my_ss_5, my_ss_5 ) ), 0.0,
            17, 6, id, <0.1, 0.1, 0.0>, GetOffset( llGetSubString( msg, my_ss_6, my_ss_6 ) ), 0.0
        ] );
    } // Set the texture to the correct offset to display the correct characters
}</syntaxhighlight>


=== Legal Stuff ===
==== Control Script ====
One possible way amongst many to feed the text to the script is by notecard. That is the way I set this script. As such, you need a notecard in the root containing the text you wish to display. One notecard will be read. If you add more notecards (without altering the script) it will read the first it finds alphabetically.
* There is a [[LlGetNotecardLine#Caveats|caveat]] regarding the length of the lines of text in the notecard. If the line is longer then 255 bytes the [[dataserver]] will return the first 255 bytes of the line.
* This example - taken from one of Shakespeare's Hamlet's soliloquy (To be, or not to be...) is too long by the red lettering -
** "For who would bear the whips and scorns of time, th'oppressor's wrong, the proud man's contumely, the pangs of despised love, the law's delay, the insolence of office, and the spurns that patient merit of th'unworthy takes, when he himself might his quiet<font style="color:red;">us make with a bare bodkin?</font>"
* Add your text notecard to the root.
* Drop this script into the root.


'''[[Project:Contribution Agreement| The legal stuff about contributing to this wiki (worth reading).]]'''
<syntaxhighlight lang="lsl2">// V1 //


== Tuition ==
integer count; // Used to keep track of iterations
integer length; // A measure of string length
string text = "                  "; // Adding this creates a gap between beginning and end of text
integer NCC; // NoteCardCount for tracking which line to read
string NC; // NoteCard name
integer on; // Are we on or off?
default {
    state_entry() {
        NC = llGetInventoryName( INVENTORY_NOTECARD, 0 ); // Establish the name of our NC
        llGetNotecardLine( NC, NCC ); // Ask for the first line
    }
    dataserver( key q, string data ) {
        if ( data != EOF ) { // If the data is useful
            text += ( data + " " ); // Store it
            llGetNotecardLine( NC, ( ++NCC ) ); // And get the next line
        } else { // If not useful we are at the end of the NC
            length = llStringLength( text ); // Establish the length of our text
            // The number 19 is 1 less than the number of faces (2 per prim) that display text. Change that number accordingly if...
            // ...you have a larger or smaller number of prims in your object.
            llMessageLinked( -1, 0, llGetSubString( "Touch start scroll.", count, ( count + 19 ) ), "b6349d2d-56bf-4c18-4859-7db0771990a5" );
        } // Message the display scripts that we are ready to function
    }
    timer() {
        if ( count == length ) { // If we have gone full circle
            count = 0; // Start again
        }
        llMessageLinked( -1, 0, llGetSubString( text, count, ( count + 19 ) ), "b6349d2d-56bf-4c18-4859-7db0771990a5" );
        ++count; // Message the display scripts with a chunk of text
    }
    touch_end( integer nd ) {
        if ( on ) { // Are we running?
            llSetTimerEvent( 0.0 ); // Stop the timer
        } else { // No?
            llSetTimerEvent( 0.15 ); // Start the timer
        }
        on = ( !on ); // Remember what we did
    }
    changed( integer change ) {
        if ( change & CHANGED_INVENTORY ) { // If the inventory has changed the NC may have
            llResetScript(); // So reset the script to read the new card
        }
    }
}</syntaxhighlight>


'''[[User:Fred_Gandt/Tuition| Tuition scripts, notes, videos and screenshots etc.]]''' (hardly any content yet)
It should set the text to read "Touch Start Scroll.". If you get something else, you haven't followed these instructions.


== Free Scripts ==
==== The Charsheet Texture ====
I am a scriptor, not a texturizerer. I created a very simple Charsheet (Character Sheet) to get you going but, it isn't very good *grins*. You will probably want to replace it.
* The texture MUST be 10 characters by 10 characters (you may have empty spaces so, 56 chars is fine so long as the grid is the full 100 spaces).
* Unlike the texture I have supplied...ALL the chars should be perfectly evenly spaced and not spreading into the neighboring spaces.
This is the texture supplied. You don't need to copy this. The script already has the [[UUID]] in it.


=== Campsite ( V1 ) ===
[[Image:Charsheet Mono Black on White jpg.jpg|500px]]


'''Use of these scripts would almost certainly cause you to breach the [http://secondlife.com/corporate/tos.php Terms of Service] of SL. See [https://blogs.secondlife.com/community/land/blog/2009/05/21/further-clarification-on-bots-and-camping HERE]'''
The display scripts contain a string that is in the exact same order the chars are read from top left to bottom right (row by row, not column by column).
* '''HAVING THE SAME ORDER OF CHARS IN THE TEXTURE AND STRING IS VITAL'''
The order you choose is entirely up to you as long as the strings in ALL the display scripts match the order of chars in the texture.
* Don't forget to include a blank grid space on your 10 x 10 texture for a space "character". There also needs to be an empty space (in the correct place) in the scripts.
* In the display script strings there are two characters that must be treated unusually. The \ and the " must have a \ placed before them.
** Example "ABCabc123.,:\"\\/{{!}} " Note the included space and the way the \ and " have a \ before them.


'''THIS IS A FIRST DRAFT....!!EXPECT BUGS!!'''
=== Sell To Group Only ===
This is a simple GROUP ONLY vendor script. It can be used to GIVE FREE items to group only too.
*'''THIS SCRIPT WILL ASK FOR DEBIT PERMISSIONS. THEY MUST BE GRANTED FOR THE SCRIPT TO FUNCTION. L$ WILL BE TAKEN FROM THE OBJECT OWNERS ACCOUNT.'''
**The debit permissions are required for making refunds in the event of an over or under payment or a payment being made by a non group member.


'''TELL ME ABOUT THEM (If they crop up) AND I CAN FIX THEM'''
<syntaxhighlight lang="lsl2">// V2 //
integer cost = 0; // The cost of the contents of this object (A whole round number (No decimal places)).
                  // If this is set to zero, the object will act as a group only freebie giver, however...
                  // ...it will still ask for permissions to debit.
string folder_name = "Folder"; // The Name of the folder in which to give the contents.
integer offer_group_join = TRUE; // Set TRUE or FALSE to offer group membership link on failed purchase attempt.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////// YOU NEED NOT CHANGE ANYTHING BELOW THIS POINT /////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
list contents_list = [];
string group_name;
key group_key;
key owner;
default {
    on_rez( integer param ) {
        llResetScript();
    }
    changed( integer change ) {
        if ( change & ( CHANGED_OWNER | CHANGED_INVENTORY ) ) {
            llResetScript();
        }
    }
    state_entry() {
        llSetClickAction( CLICK_ACTION_TOUCH );
        llRequestPermissions( ( owner = llGetOwner() ), PERMISSION_DEBIT );
    }
    run_time_permissions( integer perm ) {
        if ( perm & PERMISSION_DEBIT ) {
            integer in = llGetInventoryNumber( INVENTORY_ALL );
            integer count;
            string name;
            do {
                if ( ( name = llGetInventoryName( INVENTORY_ALL, count ) ) != llGetScriptName() ) {
                    contents_list += [ name ];
                }
            } while ( ( ++count ) < in );
            if ( llGetListLength( contents_list ) ) {
                if ( ( group_key = llList2Key( llGetObjectDetails( llGetKey(), [ OBJECT_GROUP ] ), 0 ) ) == NULL_KEY ) {
                    llOwnerSay( "You NEED to set this object to a group in order to have it sell contents ONLY to that group." +
                                "\nThis script is resetting. You will need to grant debit permissions again." +
                                "\n!! ONLY DO THAT AFTER SETTING THIS OBJECT TO THE DESIRED GROUP !!" );
                    llResetScript();
                } else {
                    llHTTPRequest( "http://world.secondlife.com/group/" + ( ( string )group_key ), [], "" );
                }
            } else {
                llOwnerSay( "There are no contents. This object cannot sell thin air. There is no air in SL." +
                            "\nPlease add the contents to sell." +
                            "\n!! ONLY RE-GRANT PERMISSIONS WHEN ALL CONTENTS ARE ADDED !!" );
            }
        } else {
            llOwnerSay( "You MUST grant permissions for this script to function." );
            llRequestPermissions( owner, PERMISSION_DEBIT );
        }
    }
    http_response( key q, integer status, list metadata, string body ) {
        if ( status == 200 ) {
            llOwnerSay( "This object is set to the group - " +
                        ( group_name = llGetSubString( body, ( llSubStringIndex( body, "<title>" ) + 7 ),
                                                            ( llSubStringIndex( body, "</title>" ) - 1 ) ) ) +
                        "\nOnly members of that group will be able to buy this objects contents." +
                        "\nContents for sale - \n" + llDumpList2String( contents_list, "\n" ) +
                        "\nPrice is " + ( ( string )cost ) + "L$" );
            if ( cost ) {
                llSetClickAction( CLICK_ACTION_PAY );
                llSetPayPrice( PAY_HIDE, [ cost, PAY_HIDE, PAY_HIDE, PAY_HIDE ] );
                state shoptastic;
            } else {
                state freebietastic;
            }
        } else {
            llOwnerSay( "HTTP Request failed. Trying again in 45 seconds. Please wait." );
            llSleep( 45.0 );
            llHTTPRequest( "http://world.secondlife.com/group/" + ( ( string )group_key ), [], "" );
        }
    }
}
state freebietastic {
    on_rez( integer param ) {
        llResetScript();
    }
    changed( integer change ) {
        if ( change & ( CHANGED_OWNER | CHANGED_INVENTORY ) ) {
            llResetScript();
        }
    }
    touch_start( integer nd ) {
        while( nd ) {
            key id = llDetectedKey( --nd );
            if ( llSameGroup( id ) ) {
                llGiveInventoryList( id, folder_name, contents_list );
            } else {
                string msg = "";
                if ( offer_group_join ) {
                    msg = "\nYou can join this group by clicking this - \nsecondlife:///app/group/" + ( ( string )group_key ) + "/about";
                }
                llRegionSayTo( id, 0, "Sorry, this vendor is set to give only to " + group_name + " group members." + msg );
            }
        }
    }
}
state shoptastic {
    on_rez( integer param ) {
        llResetScript();
    }
    changed( integer change ) {
        if ( change & ( CHANGED_OWNER | CHANGED_INVENTORY ) ) {
            llResetScript();
        }
    }
    money( key id, integer amount ) {
        if ( llSameGroup( id ) ) {
            if ( amount >= cost ) {
                if ( amount > cost ) {
                    llGiveMoney( id, ( amount - cost ) );
                }
                llGiveInventoryList( id, folder_name, contents_list );
            } else if ( amount < cost ) {
                llGiveMoney( id, amount );
                llRegionSayTo( id, 0, "Sorry, you paid to little.\nThe cost is " + ( ( string )cost ) + "L$" );
            }
        } else {
            llGiveMoney( id, amount );
            string msg = "";
            if ( offer_group_join ) {
                msg = "\nYou can join this group by clicking this - \nsecondlife:///app/group/" + ( ( string )group_key ) + "/about";
            }
            llRegionSayTo( id, 0, "Sorry, this vendor is set to sell only to " + group_name + " group members." + msg );
        }
    }
}</syntaxhighlight>


*'''Camping!! A great idea for boosting your traffic scores when just starting out in SL business. Traffic scores are added to by avatars being present on your land for periods of time measured in 5 minute chunks. These scripts will act fairly toward the user and the owner since, every 5 minutes someone is logged on as a camper they will earn the amount the owner specifies for that 5 minute chunk.'''
=== Basic Smooth Sliding Door ===


*'''Registered BOTS (Scripted agents) do not count toward traffic. Unregistered bots will (as far as I know). These scripts issue a test to all logged in campers every 5 minutes that a bot almost certainly could not pass by its self (although it could ask for help from its user). I have included this function because people have come to expect it (not because I think it is a good idea). Genuine bot protection is practically impossible. I enjoyed writing the scripts though so all is well!'''
Sliding door that glides smoothly from closed to open and back with an auto timer.
*'''DO NOT LINK TO HOUSE''' (even though it is quite funny).


*'''The test is issued as a request to interact with the object to highlight a word found in a "Wordsearch" texture. If the camper doesn't respond or gets the answer wrong (2 chances are given per test) they are automatically logged out.'''
<syntaxhighlight lang="lsl2">// V1 //


*'''The camper is paid automatically whenever they are logged out. They will be logged out if they leave the campsite (the whole parcel the scripts are set on) or log out (including crashes) of SL. They will only be paid per FULL 5 minutes as staying an extra 4 minutes wouldn't be counted toward the traffic. Campers are paid from the owner's account balance.
vector target = <1.5, 0.1, 0.0>; // Play about to get the result you want.
// Each of the 3 floats represents X, Y, Z region axis in meters.


==== Campsite Builder ====
float time = 10.0; // Time for auto close. Set to zero to disable.


'''To create the starter object, create a fresh prim and drop this script on it. The script will self delete.'''
//////////////////////////////////////////////////////////////////


<lsl>// V1 //
integer t;


default
integer open;
{
    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 ====
vector pos;


'''This script deals with ALL the instant messaging for the other two scripts (below this). It is short and simple but, absolutely necessary.'''
Door() {
    vector targ;
    if ( !open ) {
        targ = ( pos + target );
        llSetTimerEvent( time );
    } else {
        llSetTimerEvent( 0.0 );
        targ = ( pos );
    }
    open = ( !open );
    t = llTarget( targ, 0.04 );
    llMoveToTarget( targ, 0.75 );
    llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, TRUE);
}


<lsl>// V1 //
default {
 
    on_rez( integer param ) {
default
        llResetScript();
{
    }
     link_message(integer sender, integer num, string str, key id)
    state_entry() {
     {
        llSetStatus( STATUS_BLOCK_GRAB, TRUE );
         if(num == 2468)
        llSetStatus( STATUS_PHYSICS |
         llInstantMessage(id, str);
                    STATUS_ROTATE_X |
                    STATUS_ROTATE_Y |
                    STATUS_ROTATE_Z |
                    STATUS_PHANTOM, FALSE );
        pos = llGetPos();
     }
    touch_start( integer nd ) {
        Door();
    }
    at_target( integer num, vector tpos, vector opos ) {
        llTargetRemove( t );
        llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE );
        llSetPos( tpos );
     }
    timer() {
         llSetTimerEvent( 0.0 );
         Door();
     }
     }
}</lsl>
}</syntaxhighlight>


==== Campsite ====
=== Link-Set Texture Configuration ===
For example - We have a piece of furniture with 5 frame prims and 4 cushion prims.
* You want the frame to have 4 texture options -
** Dark Wood
** Light Wood
** Aluminium
** Shiny Black
* And the cushions have 4 texture options -
** Pink Damasque
** Green Twill
** Black Fur
** Crimson Velour
You want these options to be available to choose from -
* Dark Wood frame with Crimson Velour cushions.
* Light Wood frame with Pink Damasque cushions.
* Aluminium frame with Green Twill cushions.
* Shiny Black frame with Black Fur cushions.
* Dark Wood frame with Pink Damasque cushions.
* Light Wood frame with Green Twill cushions.
* Aluminium frame with Black Fur cushions.
* Shiny Black frame with Crimson Velour cushions.
* Dark Wood frame with Green Twill cushions.
* Light Wood frame with Black Fur cushions.
* Aluminium frame with Crimson Velour cushions.
* Shiny Black frame with Pink Damasque cushions.
Put this script in any prim in the set. If you put it in the root prim, the whole object will become touchable. This may be undesirable. If the script is in any other prim in the set, only that prim will be touchable (unless you have other touch active scripts in the object). The script responds to its owner only. It will reset if the owner changes so that the new owner can control it.
# Set the object manually to one of the texturing configurations.
# Set your Viewer Preferences > Text Chat > Chat Options > Show Timestamp in Local Chat to '''OFF''' (uncheck that option).
# Click the prim with this script in it.
# A dialog will appear, click the "Config" button.
# A load of data will be chatted to you.
# Copy from your local chat history '''all''' the text '''between''' "!!!!!!!!!!----CONFIGURATION START----!!!!!!!!!!" & "!!!!!!!!!!----CONFIGURATION END----!!!!!!!!!!". Don't include those two lines. Since this is local chat (and the script is cleaner without automatic removal) you'll need to check there is no ''unwanted'' chat mixed up in the object data chat.
# Paste that text into an otherwise clean Notecard (no other text in the card).
# Name it. The Notecard name needs to be short enough to be the name of that configuration option when offered on a dialog button.
# Set the object manually to another of the texturing configurations.
# Repeat these steps until all the configurations (Maximum of 12) are stored to Notecards.
Once all the Notecards are saved and named, drop them all into the same prim contents as the script. That's it.
Now when the prim is clicked a dialog will appear offering the options, taking the names for each option from the Notecards the script finds.
* To add new configurations after adding Notecards to the prim, you'll need to remove the Notecards already in the contents and add them again after creating the new Notecards. In other words, If the prim has any Notecards in it, it will offer the options. If the prim has no Notecards in it, it will offer the "Config" button.
* The change from one configuration to another can be very slow (depending on the number of prims and the number of faces of each prim etc).
** This slowness is a trade off. The main advantages are -
*** The script doesn't use a vast amount of memory ("Memory use is bad, M'kay?").
*** There are not loads of scripts. Just one script for the whole object.
*** Dramatically different texturing is as simple to apply as slight changes.
** This isn't designed for dynamic effect. It is for simply changing decoration. Speed is hardly important when changing the color of an arm chair after all.
All texture parameters are catered for. Every individual face separately.
* Texture
** UUID
** Repeats
** Offsets
** Rotations
* Color
* Alpha
* Mapping
** Default or Planar
* Shiny
** High, Medium, Low or None
* Bump Mapping
** All the bumpy options are recorded
* Fullbright
* Glow
'''This is early days for this idea (I may possibly rework it sometime) and there are limits. The amount of data that can be stored to a Notecard being one of them. Very large prim-count objects with complex prims (hollowed and path cut boxes having up to 9 faces for example) may create too much data to be stored to one Notecard. Sorry bout that.'''


'''This script deals with logged campers, owner permissions (to debit your account), owner's instructions etc. It also deals with remote ON/OFF switching via email. So if you need to shut it down but cannot log on for whatever reason you can switch it ON/OFF by emailing it. The script needs to know what email address to respond to so, you need to fill those details out. The email instructions are simple...'''
<syntaxhighlight lang="lsl2">// V2 //


'''The campsite will tell you its email address as the script is set running. Make a note of it.'''
SpewConfig( integer nol ) {
    llSetObjectName( "" );
    llOwnerSay( "/me /n!!!!!!!!!!----CONFIGURATION START----!!!!!!!!!!" );
    integer ln = 1;
    do {
        list s = [];
        list p = [];
        integer c = 0;
        integer f = 0;
        integer l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 17, -1 ] ) ) );
        do {
            llOwnerSay( "/me " + llDumpList2String( [17, ( f++ ) ] + llList2List( s, c, ( c + 3 ) ), "," ) );
            c += 4;
        } while ( c < l );
       
        c = 0;
        f = 0;
        l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 18, -1 ] ) ) );
        do {
            llOwnerSay( "/me " + llDumpList2String( [ 18, ( f++ ) ] + llList2List( s, c, ( c + 1 ) ), "," ) );
            c += 2;
        } while ( c < l );
       
        c = 0;
        f = 0;
        l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 19, -1 ] ) ) );
        do {
            p += [ 19, ( f++ ) ] + llList2List( s, c, ( c + 1 ) );
            c += 2;
        } while ( c < l );
        llOwnerSay( "/me " + llDumpList2String( p, "," ) );
       
        p = [];
        c = 0;
        f = 0;
        l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 20, -1 ] ) ) );
        do {
            p += [ 20, ( f++ ) ] + llList2List( s, c, c );
        } while ( ( ++c ) < l );
        llOwnerSay( "/me " + llDumpList2String( p, "," ) );
       
        p = [];
        c = 0;
        f = 0;
        l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 22, -1 ] ) ) );
        do {
            p += [ 22, ( f++ ) ] + llList2List( s, c, c );
        } while ( ( ++c ) < l );
        llOwnerSay( "/me " + llDumpList2String( p, "," ) );
       
        p = [];
        c = 0;
        f = 0;
        l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 25, -1 ] ) ) );
        do {
            p += [ 25, ( f++ ) ] + llList2List( s, c, c );
        } while ( ( ++c ) < l );
        llOwnerSay( "/me " + llDumpList2String( p, "," ) );
       
        llOwnerSay( "/me LINK" );
    } while ( ( ++ln ) <= nol );
   
    llOwnerSay( "/me !!!!!!!!!!----CONFIGURATION END----!!!!!!!!!!\n" );
    llSetObjectName( my_name );
}


'''Instructions are sent to the campsite as the subject line of the email you send (no actual message is required). A confirmation email will be sent back. Refresh your inbox after sending the instruction to confirm it was received. Be reasonably patient.'''
list TypeCast( list p ) {
    list P = [];
    list c = [];
    integer int = 0;
    integer count = 0;
    integer length = llGetListLength( p );
    do {
        if ( ( int = ( ( integer )llList2String( ( c = llCSV2List( llList2String( p, count ) ) ), 0 ) ) ) == 17 ) {
            P += [ int, ( ( integer )llList2String( c, 1 ) ),
                        ( ( key )llList2String( c, 2 ) ),
                        ( ( vector )llList2String( c, 3 ) ),
                        ( ( vector )llList2String( c, 4 ) ),
                        ( ( float )llList2String( c, 5 ) )
                ];
        } else if ( int == 18 ) {
            P += [ int, ( ( integer )llList2String( c, 1 ) ),
                        ( ( vector )llList2String( c, 2 ) ),
                        ( ( float )llList2String( c, 3 ) )
                ];
        } else {
            integer l = ( llGetListLength( c ) - 1 );
            integer i = -1;
            if ( int == 19 ) {
                do {
                    ++i;
                    P += [ int, ( ( integer )llList2String( c, ( ++i ) ) ),
                                ( ( integer )llList2String( c, ( ++i ) ) ),
                                ( ( integer )llList2String( c, ( ++i ) ) )
                        ];
                } while ( i < l );
            } else if ( ( int == 20 ) | ( int == 22 ) ) {
                do {
                    ++i;
                    P += [ int, ( ( integer )llList2String( c, ( ++i ) ) ),
                                ( ( integer )llList2String( c, ( ++i ) ) )
                        ];
                } while ( i < l );
            } else if ( int == 25 ) {
                do {
                    ++i;
                    P += [ int, ( ( integer )llList2String( c, ( ++i ) ) ),
                                ( ( float )llList2String( c, ( ++i ) ) )
                        ];
                } while ( i < l );
            }
        }
    } while ( ( ++count ) < length );
    return P;
}


*'''"shutdown" - Will shut the campsite down.'''
key iq;


*'''"startup" - Will open the campsite for use.'''
key owner;


'''If the owner touches the login side (that will make more sense when you see the object) of the campsite they will not be logged in but, will be given a dialog menu with the option to shut or open the campsite depending on its current state.
integer lis;


<lsl>// V1 //
integer link;


integer max_campers = 5; // Maximum number of slots for campers (e.g. 5 = 5 avatars).
integer nclc;


integer lindens_per_5_mins = 5; // The number of L$ to pay an avatar for 5 minutes camping.
list params = [];


string e_master = "my_email_address@my_email_service.com"; // The email address you will/might send email instructions from.
string my_name = "";


key WS_UUID = "f0863bb8-141a-e705-7fe1-3ac3212b503e"; // The UUID of the texture used for the wordsearch.
integer channel = -4756297; // The channel for dialog coms. Keep it negative and in the millions.


///////////////////////////////////////////////////////////////////////////////////////////////////////////
string present = "Default"; // The name of your default configuration NC
//////////////DON'T DO ANYTHING TO THE REST OF THIS SCRIPT UNLESS YOU KNOW WHAT YOU ARE DOING//////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////


string vacancy = "/me  **    A vacancy has opened up!   **";
default {
    state_entry() {
        owner = llGetOwner();
        my_name = llGetObjectName();
    }
    touch_start( integer nd ) {
        if ( llDetectedKey( 0 ) == owner ) {
            integer inn = llGetInventoryNumber( INVENTORY_NOTECARD );
            if ( inn ) {
                list ncn = [];
                while ( inn ) {
                    ncn += [ llGetInventoryName( INVENTORY_NOTECARD, ( --inn ) ) ];
                }
                llListenRemove( lis );
                lis = llListen( channel, llKey2Name( owner ), owner, "" );
                llDialog( owner, ( "\n\nChoose your texture configuration.\nThe present configuration is - \"" + present + "\"" ), ncn, channel );
                llSetTimerEvent( 60.0 );
            } else { // Could just jump right to it but, this stops accidental activation.
                llListenRemove( lis );
                lis = llListen( channel, llKey2Name( owner ), owner, "Config" );
                llDialog( owner, "\n\nClick \"Config\" when the objects texturing is set.", [ "Config" ], channel );
                llSetTimerEvent( 10.0 );
            }
        }
    }
    timer() {
        llSetTimerEvent( 0.0 );
        llListenRemove( lis );
        llOwnerSay( "The listen has been removed by timer." );
    }
    dataserver( key q, string data ) {
        if ( ( q == iq ) && ( data != EOF ) ) {
            if ( ( data = llStringTrim( data, STRING_TRIM ) ) != "LINK" ) {
                params += [ data ];
            } else {
                llSetLinkPrimitiveParamsFast( ( ++link ), TypeCast( params ) );
                params = [];
            }
            iq = llGetNotecardLine( present, ( ++nclc ) );
        }
    }
    listen( integer chan, string name, key id, string msg ) {
        llSetTimerEvent( 0.0 );
        llListenRemove( lis );
        if ( msg == "Config" ) {
            SpewConfig( llGetObjectPrimCount( llGetKey() ) );
        } else {
            params = [];
            link = 0;
            iq = llGetNotecardLine( ( present = msg ), ( nclc = 0 ) );
        }
    }
    changed( integer change ) {
        if ( change & ( CHANGED_OWNER | CHANGED_INVENTORY ) ) {
            llResetScript();
        }
    }
}</syntaxhighlight>


integer tracking;
=== Zippadeedoodah (Teleporter) ===
These are those "sit & go" type prim based ''teleporters'' that you might use to get from the ground to a skybox (or similar).
: When you sit on the object the operation happens automatically.
* Reaching the destination target is not guaranteed. See [[llSetRegionPos]] for details.


integer perms;
==== Temp Rez Version ====
This version is a one way, self deleting type ''e.g.'' a sign, when touched, rezzes a teleporter seat which takes them directly to areas of a region/parcel. Since the sign could be just 1 prim providing multiple destinations and each rezzed teleporter is both temporary and phantom the savings on both prim count and server stress are obvious.


integer open;
===== Sign Board =====
 
* Add textures to the faces (multiple faces is fine and each may show a different selection of destinations) of the prim you want to use as the sign, that shows all of the ''buttons'' to click in order to rez a seat to that destination.
integer lis;
* The script will chat instructions to you about how to set it up. It's easy :-)
* If you add or remove destination seats after the set up, you'll need to set it up again, but once done, the script remembers everything, even if you take a re-rez it.
* Since the seats have all the information they need about their job, the sign can be moved without affecting the results.
Annotations will come later.


integer RTC;
<syntaxhighlight lang="lsl2">// V1 //


string parcel;
vector seat_rez_position = <0.0, 0.0, 0.0>; // You may want to play with these.


vector where;
//////////////////////////////////////////////////////////////////////////////


key owner;
list making_boxes;
list destinations;
list destination_buttons;


list logged;
integer destindex;
integer number_of_dests;


integer InRange(key id)
integer mapDestinations() {
{
     integer noo = llGetInventoryNumber( INVENTORY_OBJECT );
     if(llGetAgentSize(id) != ZERO_VECTOR)
    string dest;
    {
    while ( noo ) {
         if(llList2String(llGetParcelDetails(llList2Vector(llGetObjectDetails(id, [OBJECT_POS]), 0), [PARCEL_DETAILS_NAME]), 0) == parcel)
        dest = llGetInventoryName( INVENTORY_OBJECT, --noo );
        {
         if ( ( vector )( "<" + dest + ">" ) ) {
             if(llOverMyLand(id))
             if ( !~llListFindList( destinations, [ dest ] ) ) {
             return TRUE;
                destinations += [ dest ];
             }
         }
         }
     }
     }
     return FALSE;
     return ( number_of_dests = llGetListLength( destinations ) );
}
}


LogOut(key id, integer i)
integer instruct2DefineButton() {
{
     if ( destindex < number_of_dests ) {
    integer time = llList2Integer(logged, (i + 1));
         llOwnerSay( "Define the button for destination: " + llList2String( destinations, destindex++ ) );
    integer earned = (llFloor(((float)(time / 5))) * lindens_per_5_mins);
        return FALSE;
     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));
     return TRUE;
    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)
resetIfInventoryChanges( integer c ) {
{
     if ( c & CHANGED_INVENTORY ) {
     open = FALSE;
         llResetScript();
    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()
default {
{
     state_entry() {
     integer count;
         if ( mapDestinations() ) {
    integer to_track = llGetListLength(logged);
             llOwnerSay( "For each destination, touch the sign at 2 diagonally opposing corners of an imagined box around the area of the sign that shows the \"button\" to click to go there." );
    do
             instruct2DefineButton();
    {
        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);
     changed( integer change ) {
}
         resetIfInventoryChanges( change );
 
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)
     touch_start( integer nd ) {
    {
         while ( nd ) {
         if(llDetectedTouchFace(0) != 5)
             if ( llDetectedKey( --nd ) == llGetOwner() ) {
        {
                 if ( llGetListLength( destination_buttons ) < llGetListLength( destinations ) ) {
             integer count;
                     vector UV = llDetectedTouchUV( nd );
            do
                    if ( llGetListLength( making_boxes ) ) {
            {
                         making_boxes += [ UV.x, UV.y ];
                key id = llDetectedKey(count);
                        making_boxes = llListSort( [ llList2Float( making_boxes, 0 ), llList2Float( making_boxes, 2 ) ], 1, TRUE ) +
                if(id != owner)
                                      llListSort( [ llList2Float( making_boxes, 1 ), llList2Float( making_boxes, 3 ) ], 1, TRUE );
                 {
                        destination_buttons += [ llList2CSV( [ llDetectedTouchFace( nd ) ] + making_boxes ) ];
                    if(InRange(id))
                         making_boxes = [];
                     {
                         if ( instruct2DefineButton() ) {
                        integer index = llListFindList(logged, [id]);
                             llOwnerSay( "Setup complete." );
                        if(index != -1)
                             state ready;
                         {
                            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 {
                        making_boxes = [ UV.x, UV.y ];
                     }
                     }
                    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);
state ready {
        if(msg != "Nothing")
     touch_start( integer nd ) {
        {
         while ( nd ) {
             if(msg == "ShutDown")
             vector UV = llDetectedTouchUV( --nd );
             ShutDown(FALSE);
             integer count = number_of_dests;
             else if(msg == "StartUp")
             string destseat = "";
             StartUp(FALSE);
             list button = [];
        }
             while ( destseat == "" && count ) {
    }
                 button = llCSV2List( llList2String( destination_buttons, --count ) );
    email(string t, string a, string s, string m, integer n)
                 if ( llList2Integer( button, 0 ) == llDetectedTouchFace( nd ) ) {
    {
                    if ( UV.x >= llList2Float( button, 1 ) && UV.x <= llList2Float( button, 2 ) ) {
        if(a == e_master)
                        if ( UV.y >= llList2Float( button, 3 ) && UV.y <= llList2Float( button, 4 ) ) {
        {
                            destseat = llList2String( destinations, count );
             if(llToLower(s) == "shutdown")
                            llRezObject( destseat, llDetectedTouchPos( nd ), seat_rez_position, llGetLocalRot(), 0 );
            {
                        }
                 if(open)
                     }
                ShutDown(TRUE);
                 else
                llEmail(e_master, "Already ShutDown. Other option is \"StartUp\"", "");
            }
            else if(llToLower(s) == "startup")
            {
                if(!open)
                StartUp(TRUE);
                else
                llEmail(e_master, "Already 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)
     changed( integer change ) {
    {
         resetIfInventoryChanges( 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()
}</syntaxhighlight>
    {
        if(tracking)
        Track();
        llGetNextEmail(e_master, "");
    }
}</lsl>


==== Wordsearcher ====
===== Teleporter Seats =====
* Add the destination as a comma separated string of three numbers to the '''name''' of the prim the script is in (ideally the root).
:* ''e.g.'' '''<tt>36.025, 128, 4000.5</tt>'''
* The numbers represent the X, Y and Z coordinates of the destination on the region the scripted object is on.


'''This script takes care of the wordsearch tests. You can change the wordsearch texture and configuration to suit your own business or style. There is a basic and simple wordsearch supplied with this script so, it is ready to roll. If you create your own wordsearch, just apply the texture to the correct panel of the object and the scripts will issue instructions to you. Read them ALL and follow them.'''
<syntaxhighlight lang="lsl2">// V9 //


'''I found a site that can automatically and for free create a wordsearch to your specifications very simply. Visit [http://www.teachers-direct.co.uk/resources/wordsearches/ THIS SITE] to see how simple it really is. I found copy/pasting the result to a text layer in [http://www.gimp.org/downloads/ GIMP] and stretching it to fit within a guide grid (10 x 10) on another layer very simple and easy.'''
// These two variables can be used to set the position and rotation of the seat's sit target.
// Although the avatar won't be seated for long enough for this to matter much,
// how the avatar is dismounted may be affected.
vector sit_position = <0.0, 0.0, 0.1>; // Must not be zero
rotation sit_rotation = ZERO_ROTATION;


*'''THE WORDSEARCH MUST BE A 10 x 10 GRID. 10 LETTERS BY 10 LETTERS'''
/////////////////////////////////////////////////////////////////////////////////////////////


'''Of course you may wish to create a wordsearch from scratch yourself. Good luck with that!'''
integer zippadeeDoodah( vector dest ) {
    if ( llSetRegionPos( dest ) ) { // Transport us as close as possible and, if that worked
        llSetLinkPrimitiveParamsFast( !!llGetLinkNumber(), [ PRIM_POSITION, dest ] ); // make sure we're exactly on target.
        return TRUE; // Return true if everything worked and
    }
    return FALSE; // return false if it didn't.
}


<lsl>// V1 //
vector string2Vector( string str ) {
    return ( vector )( "<" + str + ">" ); // create a vector from the string and return it.
}


// The list below should only be changed if/when the texture is changed to make another wordsearch.
default { // Set up the seat for use.
    on_rez( integer param ) { // On being rezzed:
        llSitTarget( sit_position, sit_rotation ); // Make space to sit on even an uncomfortable object.
        llSetClickAction( CLICK_ACTION_SIT ); // Make the prim click-to-sit-able.
        llSetLinkPrimitiveParamsFast( !!llGetLinkNumber(), [ PRIM_PHANTOM, TRUE,
                                                            PRIM_TEMP_ON_REZ, TRUE ] ); // Make the object less intensive for the region.
    }
    changed( integer change ) { // If something about the object has changed, such as the number of links,
        if ( change & CHANGED_LINK && llAvatarOnSitTarget() != NULL_KEY ) { // there may be aseated avatar.
            vector dest = string2Vector( llGetObjectName() ); // Establish the destination from the object name,
            if ( dest ) { // and if the destination makes sense:
                if ( zippadeeDoodah( dest ) ) { // Move the seat and the rider to the destination from the object description.
                    state rest_in_peace; // And if that worked, go to a quite place to die.
                }
            } // If we get to this point, we haven't functioned correctly, so message the owner about the problem and
            llInstantMessage( llGetOwner(), "Hi boss. So I was supposed to be doing my job but, something went wrong." +
                                            "\nYou might need to fix something in my clones so they don't fail the same way." +
                                            "\nGoodbye cruel world!" );
            llDie(); // delete the object.
        }
    }
    state_exit() { // On the way out of this state
        key rider = llAvatarOnSitTarget(); // Establish that the rider didn't fall off,
        if ( rider ) { // and if they didn't,
            llUnSit( rider ); // give 'em a push! ;-)
        }
    }
}


list words = [
state rest_in_peace {
"ANIMATION",
    state_entry() { // On entering the state:
"59,58,57,56,55,54,53,52,51,",
        llDie(); // Delete the object.
"TELEPORT",
    }
"2,12,22,32,42,52,62,72,",
}</syntaxhighlight>
"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,"
];


///////////////////////////////////////////////////////////////////////////////////////////////////////////
==== Permanent Version ====
//////////////DON'T DO ANYTHING TO THE REST OF THIS SCRIPT UNLESS YOU KNOW WHAT YOU ARE DOING//////////////
This version drops the user off at the destination then goes straight back home to be reused.
///////////////////////////////////////////////////////////////////////////////////////////////////////////
* Add the '''home''' position as a comma separated string of three numbers to the '''name''' of the prim the script is in (ideally the root).
* Add the '''destination''' as a comma separated string of three numbers to the '''description'''.
:* ''e.g.'' '''<tt>36.025, 128, 4000.5</tt>'''
* The numbers represent the X, Y and Z coordinates of the destinations on the region the scripted object is on.


list agents;
<syntaxhighlight lang="lsl2">// V13 //


list plot_list;
// These two variables can be used to set the position and rotation of the seat's sit target.
// Although the avatar won't be seated for long enough for this to matter much,
// how the avatar is dismounted may be affected.
vector sit_position = <0.0, 0.0, 0.1>; // Must not be zero
rotation sit_rotation = ZERO_ROTATION;


key owner;
//////////////////////////////////////////////////////////


string owner_name;
integer zippadeeDoodah( vector dest ) {
    if ( llSetRegionPos( dest ) ) { // Transport us as close as possible and, if that worked
        llSetLinkPrimitiveParamsFast( !!llGetLinkNumber(), [ PRIM_POSITION, dest ] ); // make sure we're exactly on target.
        return TRUE; // Return true if everything worked and
    }
    return FALSE; // return false if it didn't.
}


integer lis;
vector string2Vector( string str ) {
    return ( vector )( "<" + str + ">" ); // create a vector from the string and return it.
}


integer coord_count = 0;
default { // Set up the seat for use.
 
     state_entry() { // On entering the state:
string new_coords;
         llSitTarget( sit_position, sit_rotation ); // Make space to sit on even an uncomfortable object.
 
         llSetClickAction( CLICK_ACTION_SIT ); // Make the prim click-to-sit-able.
integer lis_by_2;
         llSetLinkPrimitiveParamsFast( !!llGetLinkNumber(), [ PRIM_PHANTOM, TRUE ] ); // Make the object less intensive for the region.
 
         state coiled_spring; // With the seat set up, go to a state with a changed event.
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
state coiled_spring { // Be prepared for riders.
{
     changed( integer change ) { // If something about the object has changed, such as the number of links,
     on_rez(integer param)
        if ( change & CHANGED_LINK && llAvatarOnSitTarget() != NULL_KEY ) { // there may be aseated avatar.
    {
            vector dest = string2Vector( llGetObjectDesc() ); // Establish the destination from the object description,
        llResetScript();
            if ( dest ) { // and if the destination makes sense:
                if ( zippadeeDoodah( dest ) ) { // Move the seat and the rider to the destination from the object description.
                    state recoil; // And if that worked, go to a state with no changed event.
                }
            } // If we get to this point, we haven't functioned correctly, so
            state cannot_function; // deactivate and call for help.
        }
     }
     }
     changed(integer change)
     state_exit() { // On the way out of this state
    {
        key rider = llAvatarOnSitTarget(); // Establish that the rider didn't fall off,
         if(change & CHANGED_OWNER)
         if ( rider ) { // and if they didn't,
        llResetScript();
            llUnSit( rider ); // give 'em a push! ;-)
        }
     }
     }
     state_entry()
}
    {
 
         owner = llGetOwner();
state recoil {
        owner_name = llKey2Name(owner);
     state_entry() { // On entering the state:
    }
         vector home = string2Vector( llGetObjectName() ); // Establish the way home from the object name,
    link_message(integer sender, integer num, string str, key id)
         if ( home ) { // and if it makes sense:
    {
             if ( zippadeeDoodah( home ) ) { // Send the seat back to it's home and
         if(str == "foo")
                 state coiled_spring; // if that worked, go back to being prepared for riders.
        {
             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);
             }
             }
         }
         } // If we get to this point, we haven't functioned correctly, so
        else if(num == 36912)
         state cannot_function; // deactivate and call for help.
        {
            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)
state cannot_function {
        {
    state_entry() { // On entering the state:
            if(!llGetListLength(plot_list))
        llSetClickAction( CLICK_ACTION_TOUCH ); // Make the prim click-able and message the owner.
            {
         llInstantMessage( llGetOwner(), "Hi boss. So I was supposed to be doing my job but, something went wrong." +
                plot_list = ["list words = ["];
                                        "\nYou'll probably need to reset my script after fixing whatever was wrong with me." +
                llDialog(owner, "\nClick \"DONE\" when you have FINISHED plotting ALL OF the new Wordsearch", ["DONE"], (channel * 2));
                                        "\nWhen you've fixed the problem, just click me to reset my script." );
            }
            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)
     touch_end( integer nd ) {
    {
         while ( nd ) { // For each detected touch
         integer count;
             if ( llDetectedKey( --nd ) == llGetOwner() ) { // check if the toucher is the owner
        do
                llResetScript(); // and if it is, reset the script.
        {
            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()
}</syntaxhighlight>}}
    {
        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... ==
 
'''[[User:Fred_Gandt/Scripts| Free Scripts]]'''
 
'''[[User:Fred_Gandt/Scripts/Continued_1| More Free Scripts]]'''
 
'''[[User:Fred_Gandt/Scripts/Continued_2| Even More Free Scripts]]'''
 
'''[[User:Fred_Gandt/Scripts/Continued_3| Even More More Free Scripts]]'''
 
'''If you have any comments about the content of this page please post them [[User_talk:Fred_Gandt/Scripts/Continued_4 | HERE]]'''

Latest revision as of 08:36, 5 April 2020

I get in-world very rarely these days. The knock-on effect of this, is that I am not in the best position to keep these scripts updated. Please message me in-world (forwarded to email) if you discover any bugs (that can't be simply fixed), and I'll do my best to find a solution.

My Contributions

If unsure about how to use these scripts

I have implemented a version number system to make it more obvious if a script is updated. The V# is a comment at the top of each script.

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

All my scripts are written for compilation as MONO

More Scripts

Legal Stuff

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

PJIRA Issue Tracker

The issues I have filed on the PJIRA

Tuition

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

Free Scripts

Text Scroller

A simple text display unit that scrolls text from right to left (like those LED signs) in a continuous loop. Touch to start and stop the scrolling. It is not very sophisticated.

Create The Object

  • Create a fresh new prim and drop this script onto/into it. The prim will form the shape needed plus change the texturing etc. (you can do what you like to the texturing afterwards).
// V2 //

default {
    state_entry() {
        llSetPrimitiveParams( [
            7, <0.5, 0.01, 0.25>, // Set the size
            8, <0.0, 0.0, 0.0, 1.0>, // Set to ZERO_ROTATION
            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>, // Shape the prim
            17, -1, "5748decc-f629-461c-9a36-a35a221fe21f", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0, // Apply the blank texture
            18, -1, <1.0, 0.65, 0.1>, 1.0, // Color the prim (kinda orange)
            20, -1, 1, // Make fullbright
            25, -1, 0.05 // Slight glow
        ] );
        llRemoveInventory( llGetScriptName() ); // Remove the script when done
    }
}
  • When the script has worked its magic, Snap the prim to the grid with a grid size of .5 meters.
  • Shift-Drag-Copy the prim, snapping each to the grid positively along the X axis until you have 10 prims in a continuous strip.

You can actually make the object as long or short as you like. 1 prim will work. 100 prims will work (although large linksets have been a problem for link_messages in the past). Just follow the same basic build plan.

  • Select each of the prims from the end that has the greatest X axis position, one at a time (negatively along the X axis) until ALL are selected.

Text Scroller How It Should Look jpg.jpg

  • Link the set.

Display Script

  • Check "Edit Linked parts" and select one prim at a time, dropping this script in each.
  • DO NOT CREATE A FRESH SCRIPT IN EACH PRIM. DROP THE SAME SCRIPT FROM YOUR INVENTORY INTO EACH PRIM.
// V1 //

string font = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890(){}[]<>|\\/.,;:'!?\"£$%^&*_+-=~#@ ";
// A accurate representation of the characters featured on the texture used to display the text.
 
vector GetOffset(string s) {
    if ( s == "" ) { // If there is no text
        s = " "; // Use a space
    }
    integer i = llSubStringIndex( font, s ); // Find the character
    if ( i == -1 ) { // If we can't find it
        i = 94; // Use a space
    }
    return <( -0.45 + ( ( i % 10 ) * 0.1 ) ), ( 0.45 - ( llRound( i / 10 ) * 0.1 ) ), 0.0>;
} // Return the offset needed to display the correct section of the texture by doing the mathematics *coughs*
 
integer me; // Used to store the Link number
 
integer my_ss_5; // Used to store the index of the feed text we display on face 5
 
integer my_ss_6; // Used to store the index of the feed text we display on face 6
 
default {
    state_entry() {
        me = llGetLinkNumber();
        my_ss_6 = ( ( me - 1 ) * 2 ); // Whatever link we are (in a correctly built object) establish the index to grab
        my_ss_5 = ( my_ss_6 + 1 ); // And also grab the next
    }
    link_message( integer sender, integer num, string msg, key id ) {
        llSetLinkPrimitiveParamsFast( me, [
            17, 5, id, <0.1, 0.1, 0.0>, GetOffset( llGetSubString( msg, my_ss_5, my_ss_5 ) ), 0.0,
            17, 6, id, <0.1, 0.1, 0.0>, GetOffset( llGetSubString( msg, my_ss_6, my_ss_6 ) ), 0.0
        ] );
    } // Set the texture to the correct offset to display the correct characters
}

Control Script

One possible way amongst many to feed the text to the script is by notecard. That is the way I set this script. As such, you need a notecard in the root containing the text you wish to display. One notecard will be read. If you add more notecards (without altering the script) it will read the first it finds alphabetically.

  • There is a caveat regarding the length of the lines of text in the notecard. If the line is longer then 255 bytes the dataserver will return the first 255 bytes of the line.
  • This example - taken from one of Shakespeare's Hamlet's soliloquy (To be, or not to be...) is too long by the red lettering -
    • "For who would bear the whips and scorns of time, th'oppressor's wrong, the proud man's contumely, the pangs of despised love, the law's delay, the insolence of office, and the spurns that patient merit of th'unworthy takes, when he himself might his quietus make with a bare bodkin?"
  • Add your text notecard to the root.
  • Drop this script into the root.
// V1 //

integer count; // Used to keep track of iterations
 
integer length; // A measure of string length
 
string text = "                   "; // Adding this creates a gap between beginning and end of text
 
integer NCC; // NoteCardCount for tracking which line to read
 
string NC; // NoteCard name
 
integer on; // Are we on or off?
 
default {
    state_entry() {
        NC = llGetInventoryName( INVENTORY_NOTECARD, 0 ); // Establish the name of our NC
        llGetNotecardLine( NC, NCC ); // Ask for the first line
    }
    dataserver( key q, string data ) {
        if ( data != EOF ) { // If the data is useful
            text += ( data + " " ); // Store it
            llGetNotecardLine( NC, ( ++NCC ) ); // And get the next line
        } else { // If not useful we are at the end of the NC
            length = llStringLength( text ); // Establish the length of our text
            // The number 19 is 1 less than the number of faces (2 per prim) that display text. Change that number accordingly if...
            // ...you have a larger or smaller number of prims in your object.
            llMessageLinked( -1, 0, llGetSubString( "Touch start scroll.", count, ( count + 19 ) ), "b6349d2d-56bf-4c18-4859-7db0771990a5" );
        } // Message the display scripts that we are ready to function
    }
    timer() {
        if ( count == length ) { // If we have gone full circle
            count = 0; // Start again
        }
        llMessageLinked( -1, 0, llGetSubString( text, count, ( count + 19 ) ), "b6349d2d-56bf-4c18-4859-7db0771990a5" );
        ++count; // Message the display scripts with a chunk of text
    }
    touch_end( integer nd ) {
        if ( on ) { // Are we running?
            llSetTimerEvent( 0.0 ); // Stop the timer
        } else { // No?
            llSetTimerEvent( 0.15 ); // Start the timer
        }
        on = ( !on ); // Remember what we did
    }
    changed( integer change ) {
        if ( change & CHANGED_INVENTORY ) { // If the inventory has changed the NC may have
            llResetScript(); // So reset the script to read the new card
        }
    }
}

It should set the text to read "Touch Start Scroll.". If you get something else, you haven't followed these instructions.

The Charsheet Texture

I am a scriptor, not a texturizerer. I created a very simple Charsheet (Character Sheet) to get you going but, it isn't very good *grins*. You will probably want to replace it.

  • The texture MUST be 10 characters by 10 characters (you may have empty spaces so, 56 chars is fine so long as the grid is the full 100 spaces).
  • Unlike the texture I have supplied...ALL the chars should be perfectly evenly spaced and not spreading into the neighboring spaces.

This is the texture supplied. You don't need to copy this. The script already has the UUID in it.

Charsheet Mono Black on White jpg.jpg

The display scripts contain a string that is in the exact same order the chars are read from top left to bottom right (row by row, not column by column).

  • HAVING THE SAME ORDER OF CHARS IN THE TEXTURE AND STRING IS VITAL

The order you choose is entirely up to you as long as the strings in ALL the display scripts match the order of chars in the texture.

  • Don't forget to include a blank grid space on your 10 x 10 texture for a space "character". There also needs to be an empty space (in the correct place) in the scripts.
  • In the display script strings there are two characters that must be treated unusually. The \ and the " must have a \ placed before them.
    • Example "ABCabc123.,:\"\\/| " Note the included space and the way the \ and " have a \ before them.

Sell To Group Only

This is a simple GROUP ONLY vendor script. It can be used to GIVE FREE items to group only too.

  • THIS SCRIPT WILL ASK FOR DEBIT PERMISSIONS. THEY MUST BE GRANTED FOR THE SCRIPT TO FUNCTION. L$ WILL BE TAKEN FROM THE OBJECT OWNERS ACCOUNT.
    • The debit permissions are required for making refunds in the event of an over or under payment or a payment being made by a non group member.
// V2 //
 
integer cost = 0; // The cost of the contents of this object (A whole round number (No decimal places)).
                  // If this is set to zero, the object will act as a group only freebie giver, however...
                  // ...it will still ask for permissions to debit.
 
string folder_name = "Folder"; // The Name of the folder in which to give the contents.
 
integer offer_group_join = TRUE; // Set TRUE or FALSE to offer group membership link on failed purchase attempt.
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////// YOU NEED NOT CHANGE ANYTHING BELOW THIS POINT /////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
list contents_list = [];
 
string group_name;
 
key group_key;
 
key owner;
 
default {
    on_rez( integer param ) {
        llResetScript();
    }
    changed( integer change ) {
        if ( change & ( CHANGED_OWNER | CHANGED_INVENTORY ) ) {
            llResetScript();
        }
    }
    state_entry() {
        llSetClickAction( CLICK_ACTION_TOUCH );
        llRequestPermissions( ( owner = llGetOwner() ), PERMISSION_DEBIT );
    }
    run_time_permissions( integer perm ) {
        if ( perm & PERMISSION_DEBIT ) {
            integer in = llGetInventoryNumber( INVENTORY_ALL );
            integer count;
            string name;
            do {
                if ( ( name = llGetInventoryName( INVENTORY_ALL, count ) ) != llGetScriptName() ) {
                    contents_list += [ name ];
                }
            } while ( ( ++count ) < in );
            if ( llGetListLength( contents_list ) ) {
                if ( ( group_key = llList2Key( llGetObjectDetails( llGetKey(), [ OBJECT_GROUP ] ), 0 ) ) == NULL_KEY ) {
                    llOwnerSay( "You NEED to set this object to a group in order to have it sell contents ONLY to that group." +
                                "\nThis script is resetting. You will need to grant debit permissions again." +
                                "\n!! ONLY DO THAT AFTER SETTING THIS OBJECT TO THE DESIRED GROUP !!" );
                    llResetScript();
                } else {
                    llHTTPRequest( "http://world.secondlife.com/group/" + ( ( string )group_key ), [], "" );
                }
            } else {
                llOwnerSay( "There are no contents. This object cannot sell thin air. There is no air in SL." +
                            "\nPlease add the contents to sell." +
                            "\n!! ONLY RE-GRANT PERMISSIONS WHEN ALL CONTENTS ARE ADDED !!" );
            }
        } else {
            llOwnerSay( "You MUST grant permissions for this script to function." );
            llRequestPermissions( owner, PERMISSION_DEBIT );
        }
    }
    http_response( key q, integer status, list metadata, string body ) {
        if ( status == 200 ) {
            llOwnerSay( "This object is set to the group - " +
                        ( group_name = llGetSubString( body, ( llSubStringIndex( body, "<title>" ) + 7 ),
                                                             ( llSubStringIndex( body, "</title>" ) - 1 ) ) ) +
                        "\nOnly members of that group will be able to buy this objects contents." +
                        "\nContents for sale - \n" + llDumpList2String( contents_list, "\n" ) +
                        "\nPrice is " + ( ( string )cost ) + "L$" );
            if ( cost ) {
                llSetClickAction( CLICK_ACTION_PAY );
                llSetPayPrice( PAY_HIDE, [ cost, PAY_HIDE, PAY_HIDE, PAY_HIDE ] );
                state shoptastic;
            } else {
                state freebietastic;
            }
        } else {
            llOwnerSay( "HTTP Request failed. Trying again in 45 seconds. Please wait." );
            llSleep( 45.0 );
            llHTTPRequest( "http://world.secondlife.com/group/" + ( ( string )group_key ), [], "" );
        }
    }
}
state freebietastic {
    on_rez( integer param ) {
        llResetScript();
    }
    changed( integer change ) {
        if ( change & ( CHANGED_OWNER | CHANGED_INVENTORY ) ) {
            llResetScript();
        }
    }
    touch_start( integer nd ) {
        while( nd ) {
            key id = llDetectedKey( --nd );
            if ( llSameGroup( id ) ) {
                llGiveInventoryList( id, folder_name, contents_list );
            } else {
                string msg = "";
                if ( offer_group_join ) {
                    msg = "\nYou can join this group by clicking this - \nsecondlife:///app/group/" + ( ( string )group_key ) + "/about";
                }
                llRegionSayTo( id, 0, "Sorry, this vendor is set to give only to " + group_name + " group members." + msg );
            }
        }
    }
}
state shoptastic {
    on_rez( integer param ) {
        llResetScript();
    }
    changed( integer change ) {
        if ( change & ( CHANGED_OWNER | CHANGED_INVENTORY ) ) {
            llResetScript();
        }
    }
    money( key id, integer amount ) {
        if ( llSameGroup( id ) ) {
            if ( amount >= cost ) {
                if ( amount > cost ) {
                    llGiveMoney( id, ( amount - cost ) );
                }
                llGiveInventoryList( id, folder_name, contents_list );
            } else if ( amount < cost ) {
                llGiveMoney( id, amount );
                llRegionSayTo( id, 0, "Sorry, you paid to little.\nThe cost is " + ( ( string )cost ) + "L$" );
            }
        } else {
            llGiveMoney( id, amount );
            string msg = "";
            if ( offer_group_join ) {
                msg = "\nYou can join this group by clicking this - \nsecondlife:///app/group/" + ( ( string )group_key ) + "/about";
            }
            llRegionSayTo( id, 0, "Sorry, this vendor is set to sell only to " + group_name + " group members." + msg );
        }
    }
}

Basic Smooth Sliding Door

Sliding door that glides smoothly from closed to open and back with an auto timer.

  • DO NOT LINK TO HOUSE (even though it is quite funny).
// V1 //

vector target = <1.5, 0.1, 0.0>; // Play about to get the result you want.
// Each of the 3 floats represents X, Y, Z region axis in meters.

float time = 10.0; // Time for auto close. Set to zero to disable.

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

integer t;

integer open;

vector pos;

Door() {
    vector targ;
    if ( !open ) {
        targ = ( pos + target );
        llSetTimerEvent( time );
    } else {
        llSetTimerEvent( 0.0 );
        targ = ( pos );
    }
    open = ( !open );
    t = llTarget( targ, 0.04 );
    llMoveToTarget( targ, 0.75 );
    llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, TRUE);
}

default {
    on_rez( integer param ) {
        llResetScript();
    }
    state_entry() {
        llSetStatus( STATUS_BLOCK_GRAB, TRUE );
        llSetStatus( STATUS_PHYSICS |
                     STATUS_ROTATE_X |
                     STATUS_ROTATE_Y |
                     STATUS_ROTATE_Z |
                     STATUS_PHANTOM, FALSE );
        pos = llGetPos();
    }
    touch_start( integer nd ) {
        Door();
    }
    at_target( integer num, vector tpos, vector opos ) {
        llTargetRemove( t );
        llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE );
        llSetPos( tpos );
    }
    timer() {
        llSetTimerEvent( 0.0 );
        Door();
    }
}

Link-Set Texture Configuration

For example - We have a piece of furniture with 5 frame prims and 4 cushion prims.

  • You want the frame to have 4 texture options -
    • Dark Wood
    • Light Wood
    • Aluminium
    • Shiny Black
  • And the cushions have 4 texture options -
    • Pink Damasque
    • Green Twill
    • Black Fur
    • Crimson Velour

You want these options to be available to choose from -

  • Dark Wood frame with Crimson Velour cushions.
  • Light Wood frame with Pink Damasque cushions.
  • Aluminium frame with Green Twill cushions.
  • Shiny Black frame with Black Fur cushions.
  • Dark Wood frame with Pink Damasque cushions.
  • Light Wood frame with Green Twill cushions.
  • Aluminium frame with Black Fur cushions.
  • Shiny Black frame with Crimson Velour cushions.
  • Dark Wood frame with Green Twill cushions.
  • Light Wood frame with Black Fur cushions.
  • Aluminium frame with Crimson Velour cushions.
  • Shiny Black frame with Pink Damasque cushions.

Put this script in any prim in the set. If you put it in the root prim, the whole object will become touchable. This may be undesirable. If the script is in any other prim in the set, only that prim will be touchable (unless you have other touch active scripts in the object). The script responds to its owner only. It will reset if the owner changes so that the new owner can control it.

  1. Set the object manually to one of the texturing configurations.
  2. Set your Viewer Preferences > Text Chat > Chat Options > Show Timestamp in Local Chat to OFF (uncheck that option).
  3. Click the prim with this script in it.
  4. A dialog will appear, click the "Config" button.
  5. A load of data will be chatted to you.
  6. Copy from your local chat history all the text between "!!!!!!!!!!----CONFIGURATION START----!!!!!!!!!!" & "!!!!!!!!!!----CONFIGURATION END----!!!!!!!!!!". Don't include those two lines. Since this is local chat (and the script is cleaner without automatic removal) you'll need to check there is no unwanted chat mixed up in the object data chat.
  7. Paste that text into an otherwise clean Notecard (no other text in the card).
  8. Name it. The Notecard name needs to be short enough to be the name of that configuration option when offered on a dialog button.
  9. Set the object manually to another of the texturing configurations.
  10. Repeat these steps until all the configurations (Maximum of 12) are stored to Notecards.

Once all the Notecards are saved and named, drop them all into the same prim contents as the script. That's it. Now when the prim is clicked a dialog will appear offering the options, taking the names for each option from the Notecards the script finds.

  • To add new configurations after adding Notecards to the prim, you'll need to remove the Notecards already in the contents and add them again after creating the new Notecards. In other words, If the prim has any Notecards in it, it will offer the options. If the prim has no Notecards in it, it will offer the "Config" button.
  • The change from one configuration to another can be very slow (depending on the number of prims and the number of faces of each prim etc).
    • This slowness is a trade off. The main advantages are -
      • The script doesn't use a vast amount of memory ("Memory use is bad, M'kay?").
      • There are not loads of scripts. Just one script for the whole object.
      • Dramatically different texturing is as simple to apply as slight changes.
    • This isn't designed for dynamic effect. It is for simply changing decoration. Speed is hardly important when changing the color of an arm chair after all.

All texture parameters are catered for. Every individual face separately.

  • Texture
    • UUID
    • Repeats
    • Offsets
    • Rotations
  • Color
  • Alpha
  • Mapping
    • Default or Planar
  • Shiny
    • High, Medium, Low or None
  • Bump Mapping
    • All the bumpy options are recorded
  • Fullbright
  • Glow

This is early days for this idea (I may possibly rework it sometime) and there are limits. The amount of data that can be stored to a Notecard being one of them. Very large prim-count objects with complex prims (hollowed and path cut boxes having up to 9 faces for example) may create too much data to be stored to one Notecard. Sorry bout that.

// V2 //

SpewConfig( integer nol ) {
    llSetObjectName( "" );
    llOwnerSay( "/me /n!!!!!!!!!!----CONFIGURATION START----!!!!!!!!!!" );
    integer ln = 1;
    do {
        list s = [];
        list p = [];
        integer c = 0;
        integer f = 0;
        integer l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 17, -1 ] ) ) );
        do {
            llOwnerSay( "/me " + llDumpList2String( [17, ( f++ ) ] + llList2List( s, c, ( c + 3 ) ), "," ) );
            c += 4;
        } while ( c < l );
        
        c = 0;
        f = 0;
        l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 18, -1 ] ) ) );
        do {
            llOwnerSay( "/me " + llDumpList2String( [ 18, ( f++ ) ] + llList2List( s, c, ( c + 1 ) ), "," ) );
            c += 2;
        } while ( c < l );
        
        c = 0;
        f = 0;
        l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 19, -1 ] ) ) );
        do {
            p += [ 19, ( f++ ) ] + llList2List( s, c, ( c + 1 ) );
            c += 2;
        } while ( c < l );
        llOwnerSay( "/me " + llDumpList2String( p, "," ) );
        
        p = [];
        c = 0;
        f = 0;
        l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 20, -1 ] ) ) );
        do {
            p += [ 20, ( f++ ) ] + llList2List( s, c, c );
        } while ( ( ++c ) < l );
        llOwnerSay( "/me " + llDumpList2String( p, "," ) );
        
        p = [];
        c = 0;
        f = 0;
        l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 22, -1 ] ) ) );
        do {
            p += [ 22, ( f++ ) ] + llList2List( s, c, c );
        } while ( ( ++c ) < l );
        llOwnerSay( "/me " + llDumpList2String( p, "," ) );
        
        p = [];
        c = 0;
        f = 0;
        l = llGetListLength( ( s = llGetLinkPrimitiveParams( ln, [ 25, -1 ] ) ) );
        do {
            p += [ 25, ( f++ ) ] + llList2List( s, c, c );
        } while ( ( ++c ) < l );
        llOwnerSay( "/me " + llDumpList2String( p, "," ) );
        
        llOwnerSay( "/me LINK" );
    } while ( ( ++ln ) <= nol );
    
    llOwnerSay( "/me !!!!!!!!!!----CONFIGURATION END----!!!!!!!!!!\n" );
    llSetObjectName( my_name );
}

list TypeCast( list p ) {
    list P = [];
    list c = [];
    integer int = 0;
    integer count = 0;
    integer length = llGetListLength( p );
    do {
        if ( ( int = ( ( integer )llList2String( ( c = llCSV2List( llList2String( p, count ) ) ), 0 ) ) ) == 17 ) {
            P += [ int, ( ( integer )llList2String( c, 1 ) ),
                        ( ( key )llList2String( c, 2 ) ),
                        ( ( vector )llList2String( c, 3 ) ),
                        ( ( vector )llList2String( c, 4 ) ),
                        ( ( float )llList2String( c, 5 ) )
                 ];
        } else if ( int == 18 ) {
            P += [ int, ( ( integer )llList2String( c, 1 ) ),
                        ( ( vector )llList2String( c, 2 ) ),
                        ( ( float )llList2String( c, 3 ) )
                 ];
        } else {
            integer l = ( llGetListLength( c ) - 1 );
            integer i = -1;
            if ( int == 19 ) {
                do {
                    ++i;
                    P += [ int, ( ( integer )llList2String( c, ( ++i ) ) ),
                                ( ( integer )llList2String( c, ( ++i ) ) ),
                                ( ( integer )llList2String( c, ( ++i ) ) )
                         ];
                } while ( i < l );
            } else if ( ( int == 20 ) | ( int == 22 ) ) {
                do {
                    ++i;
                    P += [ int, ( ( integer )llList2String( c, ( ++i ) ) ),
                                ( ( integer )llList2String( c, ( ++i ) ) )
                         ];
                } while ( i < l );
            } else if ( int == 25 ) {
                do {
                    ++i;
                    P += [ int, ( ( integer )llList2String( c, ( ++i ) ) ),
                                ( ( float )llList2String( c, ( ++i ) ) )
                         ];
                } while ( i < l );
            }
        }
    } while ( ( ++count ) < length );
    return P;
}

key iq;

key owner;

integer lis;

integer link;

integer nclc;

list params = [];

string my_name = "";

integer channel = -4756297; // The channel for dialog coms. Keep it negative and in the millions.

string present = "Default"; // The name of your default configuration NC

default {
    state_entry() {
        owner = llGetOwner();
        my_name = llGetObjectName();
    }
    touch_start( integer nd ) {
        if ( llDetectedKey( 0 ) == owner ) {
            integer inn = llGetInventoryNumber( INVENTORY_NOTECARD );
            if ( inn ) {
                list ncn = [];
                while ( inn ) {
                    ncn += [ llGetInventoryName( INVENTORY_NOTECARD, ( --inn ) ) ];
                }
                llListenRemove( lis );
                lis = llListen( channel, llKey2Name( owner ), owner, "" );
                llDialog( owner, ( "\n\nChoose your texture configuration.\nThe present configuration is - \"" + present + "\"" ), ncn, channel );
                llSetTimerEvent( 60.0 );
            } else { // Could just jump right to it but, this stops accidental activation.
                llListenRemove( lis );
                lis = llListen( channel, llKey2Name( owner ), owner, "Config" );
                llDialog( owner, "\n\nClick \"Config\" when the objects texturing is set.", [ "Config" ], channel );
                llSetTimerEvent( 10.0 );
            }
        }
    }
    timer() {
        llSetTimerEvent( 0.0 );
        llListenRemove( lis );
        llOwnerSay( "The listen has been removed by timer." );
    }
    dataserver( key q, string data ) {
        if ( ( q == iq ) && ( data != EOF ) ) {
            if ( ( data = llStringTrim( data, STRING_TRIM ) ) != "LINK" ) {
                params += [ data ];
            } else {
                llSetLinkPrimitiveParamsFast( ( ++link ), TypeCast( params ) );
                params = [];
            }
            iq = llGetNotecardLine( present, ( ++nclc ) );
        }
    }
    listen( integer chan, string name, key id, string msg ) {
        llSetTimerEvent( 0.0 );
        llListenRemove( lis );
        if ( msg == "Config" ) {
            SpewConfig( llGetObjectPrimCount( llGetKey() ) );
        } else {
            params = [];
            link = 0;
            iq = llGetNotecardLine( ( present = msg ), ( nclc = 0 ) );
        }
    }
    changed( integer change ) {
        if ( change & ( CHANGED_OWNER | CHANGED_INVENTORY ) ) {
            llResetScript();
        }
    }
}

Zippadeedoodah (Teleporter)

These are those "sit & go" type prim based teleporters that you might use to get from the ground to a skybox (or similar).

When you sit on the object the operation happens automatically.
  • Reaching the destination target is not guaranteed. See llSetRegionPos for details.

Temp Rez Version

This version is a one way, self deleting type e.g. a sign, when touched, rezzes a teleporter seat which takes them directly to areas of a region/parcel. Since the sign could be just 1 prim providing multiple destinations and each rezzed teleporter is both temporary and phantom the savings on both prim count and server stress are obvious.

Sign Board
  • Add textures to the faces (multiple faces is fine and each may show a different selection of destinations) of the prim you want to use as the sign, that shows all of the buttons to click in order to rez a seat to that destination.
  • The script will chat instructions to you about how to set it up. It's easy :-)
  • If you add or remove destination seats after the set up, you'll need to set it up again, but once done, the script remembers everything, even if you take a re-rez it.
  • Since the seats have all the information they need about their job, the sign can be moved without affecting the results.

Annotations will come later.

// V1 //

vector seat_rez_position = <0.0, 0.0, 0.0>; // You may want to play with these.

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

list making_boxes;
list destinations;
list destination_buttons;

integer destindex;
integer number_of_dests;

integer mapDestinations() {
    integer noo = llGetInventoryNumber( INVENTORY_OBJECT );
    string dest;
    while ( noo ) {
        dest = llGetInventoryName( INVENTORY_OBJECT, --noo );
        if ( ( vector )( "<" + dest + ">" ) ) {
            if ( !~llListFindList( destinations, [ dest ] ) ) {
                destinations += [ dest ];
            }
        }
    }
    return ( number_of_dests = llGetListLength( destinations ) );
}

integer instruct2DefineButton() {
    if ( destindex < number_of_dests ) {
        llOwnerSay( "Define the button for destination: " + llList2String( destinations, destindex++ ) );
        return FALSE;
    }
    return TRUE;
}

resetIfInventoryChanges( integer c ) {
    if ( c & CHANGED_INVENTORY ) {
        llResetScript();
    }
}

default {
    state_entry() {
        if ( mapDestinations() ) {
            llOwnerSay( "For each destination, touch the sign at 2 diagonally opposing corners of an imagined box around the area of the sign that shows the \"button\" to click to go there." );
            instruct2DefineButton();
        }
    }
    changed( integer change ) {
        resetIfInventoryChanges( change );
    }
    touch_start( integer nd ) {
        while ( nd ) {
            if ( llDetectedKey( --nd ) == llGetOwner() ) {
                if ( llGetListLength( destination_buttons ) < llGetListLength( destinations ) ) {
                    vector UV = llDetectedTouchUV( nd );
                    if ( llGetListLength( making_boxes ) ) {
                        making_boxes += [ UV.x, UV.y ];
                        making_boxes = llListSort( [ llList2Float( making_boxes, 0 ), llList2Float( making_boxes, 2 ) ], 1, TRUE ) +
                                       llListSort( [ llList2Float( making_boxes, 1 ), llList2Float( making_boxes, 3 ) ], 1, TRUE );
                        destination_buttons += [ llList2CSV( [ llDetectedTouchFace( nd ) ] + making_boxes ) ];
                        making_boxes = [];
                        if ( instruct2DefineButton() ) {
                            llOwnerSay( "Setup complete." );
                            state ready;
                        }
                    } else {
                        making_boxes = [ UV.x, UV.y ];
                    }
                }
            }
        }
    }
}

state ready {
    touch_start( integer nd ) {
        while ( nd ) {
            vector UV = llDetectedTouchUV( --nd );
            integer count = number_of_dests;
            string destseat = "";
            list button = [];
            while ( destseat == "" && count ) {
                button = llCSV2List( llList2String( destination_buttons, --count ) );
                if ( llList2Integer( button, 0 ) == llDetectedTouchFace( nd ) ) {
                    if ( UV.x >= llList2Float( button, 1 ) && UV.x <= llList2Float( button, 2 ) ) {
                        if ( UV.y >= llList2Float( button, 3 ) && UV.y <= llList2Float( button, 4 ) ) {
                            destseat = llList2String( destinations, count );
                            llRezObject( destseat, llDetectedTouchPos( nd ), seat_rez_position, llGetLocalRot(), 0 );
                        }
                    }
                }
            }
        }
    }
    changed( integer change ) {
        resetIfInventoryChanges( change );
    }
}
Teleporter Seats
  • Add the destination as a comma separated string of three numbers to the name of the prim the script is in (ideally the root).
  • e.g. 36.025, 128, 4000.5
  • The numbers represent the X, Y and Z coordinates of the destination on the region the scripted object is on.
// V9 //

// These two variables can be used to set the position and rotation of the seat's sit target.
// Although the avatar won't be seated for long enough for this to matter much,
// how the avatar is dismounted may be affected.
vector sit_position = <0.0, 0.0, 0.1>; // Must not be zero
rotation sit_rotation = ZERO_ROTATION;

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

integer zippadeeDoodah( vector dest ) {
    if ( llSetRegionPos( dest ) ) { // Transport us as close as possible and, if that worked
        llSetLinkPrimitiveParamsFast( !!llGetLinkNumber(), [ PRIM_POSITION, dest ] ); // make sure we're exactly on target.
        return TRUE; // Return true if everything worked and
    }
    return FALSE; // return false if it didn't.
}

vector string2Vector( string str ) {
    return ( vector )( "<" + str + ">" ); // create a vector from the string and return it.
}

default { // Set up the seat for use.
    on_rez( integer param ) { // On being rezzed:
        llSitTarget( sit_position, sit_rotation ); // Make space to sit on even an uncomfortable object.
        llSetClickAction( CLICK_ACTION_SIT ); // Make the prim click-to-sit-able.
        llSetLinkPrimitiveParamsFast( !!llGetLinkNumber(), [ PRIM_PHANTOM, TRUE,
                                                             PRIM_TEMP_ON_REZ, TRUE ] ); // Make the object less intensive for the region.
    }
    changed( integer change ) { // If something about the object has changed, such as the number of links,
        if ( change & CHANGED_LINK && llAvatarOnSitTarget() != NULL_KEY ) { // there may be aseated avatar.
            vector dest = string2Vector( llGetObjectName() ); // Establish the destination from the object name,
            if ( dest ) { // and if the destination makes sense:
                if ( zippadeeDoodah( dest ) ) { // Move the seat and the rider to the destination from the object description.
                    state rest_in_peace; // And if that worked, go to a quite place to die.
                }
            } // If we get to this point, we haven't functioned correctly, so message the owner about the problem and
            llInstantMessage( llGetOwner(), "Hi boss. So I was supposed to be doing my job but, something went wrong." +
                                            "\nYou might need to fix something in my clones so they don't fail the same way." +
                                            "\nGoodbye cruel world!" );
            llDie(); // delete the object.
        }
    }
    state_exit() { // On the way out of this state
        key rider = llAvatarOnSitTarget(); // Establish that the rider didn't fall off,
        if ( rider ) { // and if they didn't,
            llUnSit( rider ); // give 'em a push! ;-)
        }
    }
}

state rest_in_peace {
    state_entry() { // On entering the state:
        llDie(); // Delete the object.
    }
}

Permanent Version

This version drops the user off at the destination then goes straight back home to be reused.

  • Add the home position as a comma separated string of three numbers to the name of the prim the script is in (ideally the root).
  • Add the destination as a comma separated string of three numbers to the description.
  • e.g. 36.025, 128, 4000.5
  • The numbers represent the X, Y and Z coordinates of the destinations on the region the scripted object is on.
// V13 //

// These two variables can be used to set the position and rotation of the seat's sit target.
// Although the avatar won't be seated for long enough for this to matter much,
// how the avatar is dismounted may be affected.
vector sit_position = <0.0, 0.0, 0.1>; // Must not be zero
rotation sit_rotation = ZERO_ROTATION;

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

integer zippadeeDoodah( vector dest ) {
    if ( llSetRegionPos( dest ) ) { // Transport us as close as possible and, if that worked
        llSetLinkPrimitiveParamsFast( !!llGetLinkNumber(), [ PRIM_POSITION, dest ] ); // make sure we're exactly on target.
        return TRUE; // Return true if everything worked and
    }
    return FALSE; // return false if it didn't.
}

vector string2Vector( string str ) {
    return ( vector )( "<" + str + ">" ); // create a vector from the string and return it.
}

default { // Set up the seat for use.
    state_entry() { // On entering the state:
        llSitTarget( sit_position, sit_rotation ); // Make space to sit on even an uncomfortable object.
        llSetClickAction( CLICK_ACTION_SIT ); // Make the prim click-to-sit-able.
        llSetLinkPrimitiveParamsFast( !!llGetLinkNumber(), [ PRIM_PHANTOM, TRUE ] ); // Make the object less intensive for the region.
        state coiled_spring; // With the seat set up, go to a state with a changed event.
    }
}

state coiled_spring { // Be prepared for riders.
    changed( integer change ) { // If something about the object has changed, such as the number of links,
        if ( change & CHANGED_LINK && llAvatarOnSitTarget() != NULL_KEY ) { // there may be aseated avatar.
            vector dest = string2Vector( llGetObjectDesc() ); // Establish the destination from the object description,
            if ( dest ) { // and if the destination makes sense:
                if ( zippadeeDoodah( dest ) ) { // Move the seat and the rider to the destination from the object description.
                    state recoil; // And if that worked, go to a state with no changed event.
                }
            } // If we get to this point, we haven't functioned correctly, so
            state cannot_function; // deactivate and call for help.
        }
    }
    state_exit() { // On the way out of this state
        key rider = llAvatarOnSitTarget(); // Establish that the rider didn't fall off,
        if ( rider ) { // and if they didn't,
            llUnSit( rider ); // give 'em a push! ;-)
        }
    }
}

state recoil {
    state_entry() { // On entering the state:
        vector home = string2Vector( llGetObjectName() ); // Establish the way home from the object name,
        if ( home ) { // and if it makes sense:
            if ( zippadeeDoodah( home ) ) { // Send the seat back to it's home and
                state coiled_spring; // if that worked, go back to being prepared for riders.
            }
        } // If we get to this point, we haven't functioned correctly, so
        state cannot_function; // deactivate and call for help.
    }
}

state cannot_function {
    state_entry() { // On entering the state:
        llSetClickAction( CLICK_ACTION_TOUCH ); // Make the prim click-able and message the owner.
        llInstantMessage( llGetOwner(), "Hi boss. So I was supposed to be doing my job but, something went wrong." +
                                        "\nYou'll probably need to reset my script after fixing whatever was wrong with me." +
                                        "\nWhen you've fixed the problem, just click me to reset my script." );
    }
    touch_end( integer nd ) {
        while ( nd ) { // For each detected touch
            if ( llDetectedKey( --nd ) == llGetOwner() ) { // check if the toucher is the owner
                llResetScript(); // and if it is, reset the script.
            }
        }
    }
}

More Scripts...

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