From 06d613a104258e8afa94e2047d8b934d1934aefb Mon Sep 17 00:00:00 2001 From: Fred Beckhusen Date: Wed, 27 Feb 2019 14:27:09 -0600 Subject: [PATCH] add partners and builder buddy --- .../BuildersBuddy-Opensim.sol | 3 + .../Base/Builders+Buddy+Base+(opensim).lsl | 477 +++++++ .../BuildersBuddy-Opensim/Base/Readme.txt | 302 ++++ .../BuildersBuddy-Opensim.prj | 12 + ...Builders+Buddy+Component+with+NC+(VAR).lsl | 403 ++++++ Lightshare/Lightshare/Lightshare.lsl | 1235 +++++++++++++++++ New folder/Flash.lsl | 34 + Opensim Partners/Opensim Partners.sol | 3 + .../Object/Opensim Partners.lsl | 201 +++ .../Opensim Partners/Opensim Partners.prj | 6 + 10 files changed, 2676 insertions(+) create mode 100644 BuildersBuddy-Opensim/BuildersBuddy-Opensim.sol create mode 100644 BuildersBuddy-Opensim/BuildersBuddy-Opensim/Base/Builders+Buddy+Base+(opensim).lsl create mode 100644 BuildersBuddy-Opensim/BuildersBuddy-Opensim/Base/Readme.txt create mode 100644 BuildersBuddy-Opensim/BuildersBuddy-Opensim/BuildersBuddy-Opensim.prj create mode 100644 BuildersBuddy-Opensim/BuildersBuddy-Opensim/SomeObject/Builders+Buddy+Component+with+NC+(VAR).lsl create mode 100644 Lightshare/Lightshare/Lightshare.lsl create mode 100644 New folder/Flash.lsl create mode 100644 Opensim Partners/Opensim Partners.sol create mode 100644 Opensim Partners/Opensim Partners/Object/Opensim Partners.lsl create mode 100644 Opensim Partners/Opensim Partners/Opensim Partners.prj diff --git a/BuildersBuddy-Opensim/BuildersBuddy-Opensim.sol b/BuildersBuddy-Opensim/BuildersBuddy-Opensim.sol new file mode 100644 index 00000000..6bd76e6b --- /dev/null +++ b/BuildersBuddy-Opensim/BuildersBuddy-Opensim.sol @@ -0,0 +1,3 @@ + + + diff --git a/BuildersBuddy-Opensim/BuildersBuddy-Opensim/Base/Builders+Buddy+Base+(opensim).lsl b/BuildersBuddy-Opensim/BuildersBuddy-Opensim/Base/Builders+Buddy+Base+(opensim).lsl new file mode 100644 index 00000000..9d356bf3 --- /dev/null +++ b/BuildersBuddy-Opensim/BuildersBuddy-Opensim/Base/Builders+Buddy+Base+(opensim).lsl @@ -0,0 +1,477 @@ +// :CATEGORY:Building +// :NAME:Builders Buddy for Opensim +// :AUTHOR:Newfie Pendragon +// :KEYWORDS:Opensim +// :REV:2 +// :WORLD:Opensim +// :DESCRIPTION: +// Builders Buddy for Opensim Base Script +// :CODE: +/////////////////////////////////////////////////////////////////////////////// +// Builders' Buddy 1.10 (Base Script) +// by Newfie Pendragon, 2006-2008 +/////////////////////////////////////////////////////////////////////////////// +// +// Script Purpose & Use +// Functions are dependent on the "component script" +// +// QUICK USE: +// - Drop this script in the Base. +// - Drop the "Component" Script in each building part. +// - Touch your Base, and choose RECORD +// - Take all building parts into inventory +// - Drag building parts from inventory into Base Prim +// - Touch your base and choose BUILD +// +// OTHER COMMANDS from the Touch menu +// - To reposition, move/rotate Base Prim choose POSITION +// - To lock into position (removes scripts) choose DONE +// - To delete building pieces: choose CLEAN +/////////////////////////////////////////////////////////////////////////////// +// This script is copyrighted material, and has a few (minor) restrictions. +// For complete details, including a revision history, please see +// http://wiki.secondlife.com/wiki/Builders_Buddy +/////////////////////////////////////////////////////////////////////////////// + +// Channel used by Base Prim to talk to Component Prims +// This channel must be the same one in the component script +// A negative channel is used because it elimited accidental activations +// by an Avatar talking on obscure channels +integer DefaultPRIMCHAN = -120001; // Default channel to use +//integer PRIMCHAN = DefaultPRIMCHAN; // Channel used by Base Prim to talk to Component Prims; + +integer PRIMCHAN = -120001; // OpenSim Modification - also comment out the previous line for OpenSim +// ***THIS MUST MATCH IN BOTH SCRIPTS!*** + +//The UUID of the creator of the object +//Leave this as "" unless SL displays wrong name in object properties +key creatorUUID = ""; + +// Set to TRUE to allow group members to use the dialog menu +// Set to FALSE to disallow group members from using the dialog menu +integer ingroup = TRUE; + +// Set to TRUE to delete piece from inventory when rezzed +// (WARNING) If set to FALSE, user will be able to rez multiple copies +integer deleteOnRez = FALSE; + +// Allow non-creator to use CLEAN command? +// (WARNING) If set to TRUE, it is recommended to set +// deleteOnRez to FALSE, or user could lose entire building +integer allowClean = TRUE; + +//When user selects CLEAN, delete the base prim too? +integer dieOnClean = FALSE; + +// Set to TRUE to record piece's location based on sim +// coordinates instead of relationship to base prim +integer recordSimLocation = FALSE; + +// Set to TRUE to rez all building pieces before positioning, +// or FALSE to do (slower?) one at a time +integer bulkBuild = TRUE; + +//Set to FALSE if you dont want the script to say anything while 'working' +integer chatty = TRUE; + +//How long to listen for a menu response before shutting down the listener +float fListenTime = 30.0; + +//How often (in seconds) to perform any timed checks +float fTimerRate = 0.25; + +//How long to sit still before exiting active mode +float fStoppedTime = 30.0; + +//SL sometimes blocks rezzing to prevent "gray goo" attacks +//How long we wait (seconds) before we assume SL blocked our rez attempt +integer iRezWait = 30; + +//Specify which Menu Options will be displayed +//FALSE will restrict full options to creator +//TRUE will offer full options to anyone +integer fullOptions = FALSE; + +//Set to TRUE if you want ShapeGen channel support +// (Last 4 digits of channel affected) +integer SGCompatible = FALSE; + + + +/////////////////////////////////////////////////////////////////////////////// +//Part of KEYPAD CODE BY Andromeda Quonset....More added below in seevral places +list Menu2 = [ "-", "0","enter","7","8","9","4","5","6","1","2","3"]; +string Input = ""; +string Sign = "+"; +string SignInput = " "; +string Caption = "Enter a number, include any leading 0's: "; + +/////////////////////////////////////////////////////////////////////////////// +// DO NOT EDIT BELOW THIS LINE.... NO.. NOT EVEN THEN +/////////////////////////////////////////////////////////////////////////////// + +//Name each option-these names will be your button names. +string optRecord = "Record"; +string optReset = "Reset"; +string optBuild = "Build"; +string optPos = "Position"; +string optClean = "Clean"; +string optDone = "Done"; +string optChannel = "Channel"; + +//Menu option descriptions +string descRecord = ": Record the position of all parts\n"; +string descReset = ": Forgets the position of all parts\n"; +string descBuild = ": Rez inv. items and position them\n"; +string descPos = ": Reposition the parts to a new location\n"; +string descClean = ": De-Rez all pieces\n"; +string descDone = ": Remove all BB scripts and freeze parts in place.\n"; +string descChannel = ": Change Channel used on base and parts.\n"; + +integer MENU_CHANNEL; +integer MENU2_CHANNEL; +integer MENU_HANDLE; +integer MENU2_HANDLE; +key agent; +key objectowner; +integer group; +string title = ""; +list optionlist = []; +integer bMoving; +vector vLastPos; +rotation rLastRot; +integer bRezzing; +integer iListenTimeout = 0; +integer iLastRez = 0; +integer iRezIndex; + + +InvertSign() +{ + if(Sign == "+") + Sign = "-"; + else + Sign = "+"; +} + +//To avoid flooding the sim with a high rate of movements +//(and the resulting mass updates it will bring), we used +// a short throttle to limit ourselves +announce_moved() +{ + llRegionSay(PRIMCHAN, "MOVE " + llDumpList2String([ llGetPos(), llGetRot() ], "|")); + llResetTime(); //Reset our throttle + vLastPos = llGetPos(); + rLastRot = llGetRot(); + return; +} + + +rez_object() +{ + //Rez the object indicated by iRezIndex + llRezObject(llGetInventoryName(INVENTORY_OBJECT, iRezIndex), llGetPos(), ZERO_VECTOR, llGetRot(), PRIMCHAN); + + //DreamGrid is very slow when compared to other grids when rezzing using this script, + //by adding an llSleep(2); + //Gives this script time to detect when the parts have been successfully rezzed and positioned. + + llSleep(2); + iLastRez = llGetUnixTime(); + + if(!bRezzing) { + bRezzing = TRUE; + //timer_on(); + } +} + +post_rez_object() +{ + if ( creatorUUID != llGetOwner() ) { + if(deleteOnRez) llRemoveInventory(llGetInventoryName(INVENTORY_OBJECT, iRezIndex)); + } +} + +heard(integer channel, string name, key id, string message) +{ + if( channel == PRIMCHAN ) { + if( message == "READYTOPOS" ) { + //New prim ready to be positioned + vector vThisPos = llGetPos(); + rotation rThisRot = llGetRot(); + llRegionSay(PRIMCHAN, "MOVESINGLE " + llDumpList2String([ vThisPos, rThisRot ], "|")); + + } else if( message == "ATDEST" ) { + //Rez the next in the sequence (if any) + iRezIndex--; + if(iRezIndex >= 0) { + //Attempt to rez it + rez_object(); + } else { + //We are done building, reset our listeners + iLastRez = 0; + bRezzing = FALSE; + state reset_listeners; + } + } + return; + + } else if( channel == MENU_CHANNEL ) { //Process input from original menu + if ( message == optRecord ) { + PRIMCHAN = DefaultPRIMCHAN; + llOwnerSay("Recording positions..."); + if(recordSimLocation) { + //Location in sim + llRegionSay(PRIMCHAN, "RECORDABS " + llDumpList2String([ llGetPos(), llGetRot() ], "|")); + } else { + //Location relative to base + llRegionSay(PRIMCHAN, "RECORD " + llDumpList2String([ llGetPos(), llGetRot() ], "|")); + } + return; + } + if( message == optReset ) { + llOwnerSay("Forgetting positions..."); + llShout(PRIMCHAN, "RESET"); + return; + } + if ( message == optBuild ) { + if(chatty) llOwnerSay("Rezzing build pieces..."); + + //If rezzing/positioning one at a time, we need + // to listen for when they've reached their dest + if(!bulkBuild) { + llListen(PRIMCHAN, "", NULL_KEY, "READYTOPOS"); + llListen(PRIMCHAN, "", NULL_KEY, "ATDEST"); + } + + //Start rezzing, last piece first + iRezIndex = llGetInventoryNumber(INVENTORY_OBJECT) - 1; + rez_object(); + return; + } + if ( message == optPos ) { + if(chatty) llOwnerSay("Positioning"); + vector vThisPos = llGetPos(); + rotation rThisRot = llGetRot(); + llRegionSay(PRIMCHAN, "MOVE " + llDumpList2String([ vThisPos, rThisRot ], "|")); + return; + } + if ( message == optClean ) { + llRegionSay(PRIMCHAN, "CLEAN"); + if(dieOnClean) llDie(); + return; + } + if ( message == optDone ) { + llRegionSay(PRIMCHAN, "DONE"); + if(chatty) llOwnerSay("Removing Builder's Buddy scripts."); + return; + } + if ( message == optChannel ) { + Sign = "+"; //default is a positive number + Input = ""; + llDialog( agent, Caption, Menu2, MENU2_CHANNEL ); + } + + } else if ( channel == MENU2_CHANNEL ) { //process input from MENU2 + // if a valid choice was made, implement that choice if possible. + // (llListFindList returns -1 if Choice is not in the menu list.) + if ( llListFindList( Menu2, [ message ]) != -1 ) { + if( llListFindList(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], [message]) != -1) { + Input += message; + SignInput = Sign + Input; + llDialog( agent, Caption + SignInput, Menu2, MENU2_CHANNEL ); + + } else if( message == "-" ) { + InvertSign(); + SignInput = Sign + Input; + llDialog( agent, Caption + SignInput, Menu2, MENU2_CHANNEL ); + + } else if( message == "enter" ) { //terminate input from menu2 + string CalcChan = Input; + + //Apply ShapeGen compatibility? + if(SGCompatible) { + //new assign channel number, forcing last 4 digits to 0000 + integer ChanSize = llStringLength(Input); //determine number of digits (chars) + if(ChanSize > 5) { + CalcChan = llGetSubString(Input, 0, 4); //Shorten to 5 digits + } + CalcChan += "0000"; //append 0000 + if(Sign == "-") + CalcChan = Sign + CalcChan; + } + PRIMCHAN = (integer)CalcChan; //assign channel number + llOwnerSay("Channel set to " + (string)PRIMCHAN + "."); + } + + } else { + llDialog( agent, Caption, Menu2, MENU2_CHANNEL ); + } + } +} + + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +default { + /////////////////////////////////////////////////////////////////////////////// + changed(integer change) { + if(change & CHANGED_OWNER) + llResetScript(); + } + + /////////////////////////////////////////////////////////////////////////////// + state_entry () { + //Determine the creator UUID + if(creatorUUID == "") creatorUUID = llGetCreator(); + + //Use which menu? + if (creatorUUID == llGetOwner() || fullOptions) { + //Display all options + optionlist = [optPos, optClean, optDone, optRecord, optReset, optBuild, optChannel]; + title = optRecord + descRecord; + title += optReset + descReset; + title += optBuild + descBuild; + title += optPos + descPos; + title += optClean + descClean; + title += optDone + descDone; + title += optChannel + descChannel; + + } else { + //Display limited options + if(allowClean) { + optionlist = [optBuild, optPos, optClean, optDone]; + title = optBuild + descBuild; + title += optPos + descPos; + title += optClean + descClean; + title += optDone + descDone; + } else { + optionlist = [optBuild, optPos, optDone]; + title = optBuild + descBuild; + title += optPos + descPos; + title += optDone + descDone; + } + } + + //Record our position + vLastPos = llGetPos(); + rLastRot = llGetRot(); + + llSetTimerEvent(fTimerRate); + } + + /////////////////////////////////////////////////////////////////////////////// + touch_start (integer total_number) { + group = llDetectedGroup(0); // Is the Agent in the objowners group? + agent = llDetectedKey(0); // Agent's key + objectowner = llGetOwner(); // objowners key + // is the Agent = the owner OR is the agent in the owners group + if ( (objectowner == agent) || ( group && ingroup ) ) { + iListenTimeout = llGetUnixTime() + llFloor(fListenTime); + MENU_CHANNEL = llFloor(llFrand(-99999.0 - -100)); + MENU2_CHANNEL = MENU_CHANNEL + 1; + MENU_HANDLE = llListen(MENU_CHANNEL,"","",""); + MENU2_HANDLE = llListen(MENU2_CHANNEL,"","",""); + if ( creatorUUID == llGetOwner() || fullOptions) { + llDialog(agent,title + "Now on Channel " + (string)PRIMCHAN, optionlist, MENU_CHANNEL); //display channel number if authorized + } else { + llDialog(agent, title, optionlist, MENU_CHANNEL); + } + //timer_on(); + } + } + + /////////////////////////////////////////////////////////////////////////////// + listen(integer channel, string name, key id, string message) { + heard(channel, name, id, message); + return; + } + + /////////////////////////////////////////////////////////////////////////////// + moving_start() + { + if( !bMoving ) + { + bMoving = TRUE; + //timer_on(); + announce_moved(); + } + } + + /////////////////////////////////////////////////////////////////////////////// + object_rez(key id) { + //The object rezzed, perform any post-rez processing + post_rez_object(); + + //Rezzing it all before moving? + if(bulkBuild) { + //Move on to the next object + //Loop through backwards (safety precaution in case of inventory change) + iRezIndex--; + if(iRezIndex >= 0) { + //Attempt to rez it + rez_object(); + + } else { + //Rezzing complete, now positioning + iLastRez = 0; + bRezzing = FALSE; + if(chatty) llOwnerSay("Positioning"); + llRegionSay(PRIMCHAN, "MOVE " + llDumpList2String([ llGetPos(), llGetRot() ], "|")); + } + } + } + + /////////////////////////////////////////////////////////////////////////////// + timer() { + //Did we change position/rotation? + if( (llGetRot() != rLastRot) || (llGetPos() != vLastPos) ) + { + if( llGetTime() > fTimerRate ) { + announce_moved(); + } + } + + //Are we rezzing? + if(bRezzing) { + //Did the last one take too long? + if((llGetUnixTime() - iLastRez) >= iRezWait) { + //Yes, retry it + if(chatty) llOwnerSay("Reattempting rez of most recent piece"); + rez_object(); + } + } + + //Open listener? + if( iListenTimeout != 0 ) + { + //Past our close timeout? + if( iListenTimeout <= llGetUnixTime() ) + { + iListenTimeout = 0; + llListenRemove(MENU_HANDLE); + } + } + } + + /////////////////////////////////////////////////////////////////////////////// + on_rez(integer iStart) + { + //Reset ourselves + llResetScript(); + } +} + + +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +state reset_listeners +{ + ////////////////////////////////////////////////////////////////////////////////////////// + state_entry() + { + state default; + } +} \ No newline at end of file diff --git a/BuildersBuddy-Opensim/BuildersBuddy-Opensim/Base/Readme.txt b/BuildersBuddy-Opensim/BuildersBuddy-Opensim/Base/Readme.txt new file mode 100644 index 00000000..0ae777f3 --- /dev/null +++ b/BuildersBuddy-Opensim/BuildersBuddy-Opensim/Base/Readme.txt @@ -0,0 +1,302 @@ +// :CATEGORY:Building +// :NAME:Builders Buddy for Opensim +// :AUTHOR:Newfie Pendragon +// :KEYWORDS:Opensim +// :REV:2 +// :WORLD:Opensim +// :DESCRIPTION: +// Builders Buddy for Opensim readme +// :CODE: + + +Revision History + + TABLE OF CONTENTS + + +01. PRODUCT SUMMARY +02. LICENCE AND COPYRIGHT +03. OFFICIAL RELEASES +04. ABOUT THE SCRIPTS +05. USAGE SUMMARY +06. DEFINITIONS +07. PREPARING A SET OF PRIMS TO WORK WITH BUILDER'S BUDDY +08. FINE-TUNING THE BEHAVIOUR +09. OTHER NOTES +10. FOOTNOTES +11. USING BUILDER'S BUDDY -- CUSTOMER HELP + + +01. PRODUCT SUMMARY + +Builder's Buddy lets ordinary SL users rez a set of unlinked items in their proper places in relation to each other, without needing any building skills. The "Set" is usually a building, but there is no reason it can't also be a statue, a furniture set, etc. + +You prepare the unlinked items according to the easy steps below, then for distribution put them in a Packing Box. + +02. LICENCE AND COPYRIGHT + + * Use the Builder's Buddy scripts as you wish, to modify, sell, etc. + * If you use this script in a for-sale product, please give credit to Newfie Pendragon as the creator of the script. + * If you wish to modify this script and release the changes for public use, please submit changes to Newfie Pendragon. This is to ensure a consistent version numbering on releases, and to ensure changes are not wiped out in future releases. + +03. OFFICIAL RELEASES + +Official Releases of Builder's Buddy are tracked here: http://wiki.secondlife.com/wiki/Builders_Buddy + +The most current official release as of April 2008 is version 1.10. Any release numbers higher than this, as of April 2008, are not on the officially supported path for updates in the future. + +Subsequent versions of help for Builder's Buddy v 1.10 will be named -2, -3, -4, etc. This indicates the version of Builder's Buddy it is for, and the version of the help document. + +For instance, when Builder's Buddy v 1.20 comes out, then the help for it would be named v 1.20 -1, etc. + +04. ABOUT THE SCRIPTS + +There are two scripts, base and component. + +Make sure the Builder's Buddy scripts have the right permissions on them. They need at least transfer permissions, and since they are open source, there's no reason not to make them modify and copy as well. + +Both scripts must be set to running. Do NOT hold down the CTRL key -- or Apple key on a Mac -- while dragging and dropping any of the scripts into prims, or that will set them to not running. + +05. USAGE SUMMARY + +The base script you only use once in an item. It goes in a "base" prim, which is the piece that is moved/rotated/etc. The component script goes into each part or each linked part that makes up the rest of the large build. In short, only one base script, many component scripts. You do not put a component script in the same item where you put a base script. + + 1. Drop the base script in the Base. + 2. Drop the "Component" Script in each building part. + 3. Touch your Base, and choose RECORD + 4. Take all building parts into inventory except for the base prim + 5. Drag building parts from inventory into Base Prim + 6. Touch your base and choose BUILD + +OTHER COMMANDS from the Touch menu + + * To reposition, move or rotate the Base Prim choose POSITION + * To adjust where the house has rezzed after choosing BUILD, you can just edit - arrow move the base prim around, and the Rest of the build will follow; + * To lock into position (removes all scripts, helping to reduce work on the sim server) choose DONE + * To delete building pieces: choose CLEAN + +06. DEFINITIONS + +For the sake of this help, we refer to the base unit as the "Packing Box", and the set of unlinked items as the "Set." + +07. PREPARING A SET OF PRIMS TO WORK WITH BUILDER'S BUDDY + +[Note: please ensure first that you are on land where you are allowed to run scripts, or this will not work.] + +A) Make a prim. Any size, any shape, and you can decorate later how you wish. + +This is now what we are going to refer to as the "Packing Box." Occasionally, elsewhere, you will see it referred to as the "base unit." + +All rotations for "Packing Box" should be set to 0, or all bets are off for how the objects rezzed out of it later will come out :} [1] + +Drop the base script into it. + +B) Rez in-world the set of prims you wish to be working with, if they are not already. As we are preparing them for distribution, now is the time to check that all of the permissions on them are what you like. + +[TIP! in the steps below, you are going to do something to these items, then take them back into inventory. Remember that items rezzed in-world in SL, once taken *back* into inventory, tend to want to go back into the folder you rezzed them from. See the potential problem? You could end up with identically named items in that folder, the unprepared objects and the prepared objects, with no way to tell the difference. Consequently, you may wish to make sure in advance that once you have rezzed the items in-world from a folder, that in your inventory you then drag the originals off to another folder, so the coast will be clear for the incoming prepared ones. This can be particularly important if like most builders you leave each piece with the remarkably unique name of "Object" :} ] + +C) Place the Component script into the content folder [2] of each piece or set of linked pieces of your build or set. To clarify, if you have several prims linked together (a "linked" set), just one of those prims (the "root" prim, which is the one you see by default when you edit a linked set, anyway) needs a Component script in it. If a prim is a standalone prim, it needs its own Component script. + +D) Check your work. Did every piece or set of linked pieces get a Component script? Okay, then proceed. + +E) Unless you have logistical reasons not to, we recommend now moving the Packing Box into roughly the centre of the Set. See footnote [3] at the end. + +F) Click on the Packing Box (the prim you dropped the base script into earlier.) A blue menu will appear on your screen. + +For now, the only button we care about is the RECORD button, but here's an explanation of all of them: + +[Note: the menu also very cleverly contains brief explanations right on it!] + +CHANNEL: The Packing Box and the Set pieces need a "channel" that they use to talk to each other. If you have several Packing Boxes, or several Sets, rezzed out and on the go all at once, you'll definitely want to make sure that each Packing Box / Set combination has its own unique channel to talk on, or the wrong Set might end up listening to the wrong Packing Box, and disaster could result! You could end up, for instance, issuing a CLEAN (delete) command that the only copy you have on a build might here! + +RECORD: This memorizes the locations of the linksets you have dropped Component scripts into; + +RESET: This "un-memorizes" the locations of the linksets you have dropped Component scripts into -- that is to say, it undoes any recording; + +BUILD: This will rez your set of prepared, unlinked items, putting them all in the right place in relation both to each other, and in relation to the Packing Box. + +POSITION: There may be times when the Set of objects doesn't respond to being moved by simply moving the Packing Box with the arrows (covered further below in point 4 of 11. USING BUILDER'S BUDDY) -- owing to lag, or no-script zones, etc. The POSITION command can be used to force the Set to try again. + +CLEAN: This will derez the items you just rezzed using BUILD. This is done using the llDie() command. This means these items are gone, bye-bye, gonzo -- you won't even see them in your Lost and Found, or Trash. + +DONE: Removes the Component scripts from the linksets, leaving them where they are "permanently." (Removing all the scripts helps to reduce work on the sim server.) + +MOVE: Moves and rotates your set of unlinked items in relation to the Packing Box's height and rotation (e.g. your Packing Box will stay where it is; the build pieces will move.) + +G) Press the RECORD button; the base Packing Box then records the locations of the prims or primsets that have a component script in them. + +[TIP! With many pieces in a build, it can be very easy to forget to add component scripts into a piece or two. To help check that you haven't, after you have recorded the positions, go into edit mode on the Packing Box and move it up a bit. If everything follows as expected, then you are set. If not, from the SL client menu overhead, go EDIT - UNDO to have the Packing Box go back to where it was a second ago. Add a component script to the bits that didn't move. Record the positions again, then proceed.] + +H) Leave the base Packing Box out, but take back into inventory all of the pieces that have Component scripts in them. It doesn't matter whether you take them in one by one, or whether you grab them all at once using TAKE from the SL client overhead menu to take them as a compound object. + +I) The items are now in your inventory, and if you noted the advice in Step 2 above, you know exactly where they are in your inventory. Now, edit the Packing Box, switch to its contents folder, and drag all these prepared items into it. + +J) Rename the Packing Box prim to a more helpful name than Object, if you haven't already. + +K) Try rezzing the set from the Packing Box, as described below in 11. USING BUILDER'S BUDDY. Editing the packing box, and using the position arrows in edit mode, will cause the entire Set to move around with the Packing Box. Occasionally, if you are in a very laggy sim, or SL is having some kind of problem, when rezzing a build out of the Packing Box you may have to click on the Packing Box to get the menu, and click the POSITION button to get everything to pop into place. If that still doesn't do the trick, click on the CLEAN button, and then the BUILD button to try again. + +[TIP! Occasionally, you may put all the prepared component pieces into the Packing Box, and run a test rez only to find that you're missing a piece of a house or furniture set that you meant to include. Don't despair; after all, that's what test runs are for! + +Do the following: + +a) rez the set as it is out of the Packing Box; +b) position the missing piece into place, where it should have gone; +c) add a component script to that missing piece; +d) record; +e) take just that missing piece into your inventory (make sure perms are right!); +f) place just that missing piece into the Packing Box + +Note: that's right, just the missing piece -- no need to replace everything else. + +08. FINE-TUNING THE BEHAVIOUR + +Inside the Base script, at the top of it, are some parameters that you can set. + +Full help comments are provided in the script above each parameter. + +Please see these if you wish to change various aspects of how Buddy's Builder operates for you. + +Here, though, is expanded help on a few items: + +(a) "dieOnClean" + +If you choose to use a piece of your build as the base component (which is fine), you will want to ensure that the "dieOnClean" to parameter is set to FALSE, or you risk deleting the piece during when any CLEAN command is issued. + +(b) "creatorUUID" variable + +You only need to fill this in if you are not the creator of the main root prim of your object. + +Builder's Buddy checks the creator of the main root prim of your object to ensure that it can correctly determine which menu to show to whom. The creator gets the expanded menu; end users get the simpler menu that they need. + +Normally, the creator of the packaged object has also made its root prim. + +Occasionally, though, you may use prims other than those made by your own hand -- for instance, if you use megaprims. In this case, you can make sure you still get the expanded menu by specifying your UUID. + +(c) "chatty" variable + +If you want the Builder's Buddy to be less "chatty" while working away, you can change this via this script variable. + +By default, it is set to: + +integer chatty = TRUE. + +To make Builder's Buddy quieter, you would change this to: + +integer chatty = FALSE; + +Bear in mind, though, that only the owner of the Packing Box can hear the messages, because the LSL script uses "llOwnerSay" versus "Say". + +So, even though group members by default can use the menu on the Packing Box (because by default integer ingroup = TRUE ), those group members won't hear any confirmation messages unless they are the owner. + +[TIP! If you want do want your team members to hear these messages, do a Search and Replace in the base script - search of llOwnerSay and replace it with llSay.] + + +09. OTHER NOTES + +A) Position of set from Packing Box + +If you had the Packing Box 5 metres in the air when you hit the RECORD button, then all the pieces of your Set will remember their position in relation to the box. Bearing that in mind, it therefore would not be a good idea to place the Packing Box on the ground and hit the BUILD button, because some pieces -- say, a floor -- might then end up 5 metres *under* the ground and be a headache for all concerned. So, tell purchasers of your Packing Box how high up or how low to place the Packing Box before hitting the BUILD button. + +If you have indeed placed the Packing Box in the centre of your build before hitting the RECORD button, then advise purchasers that the build will rez using the Packing Box as the approximate centre. + +B) Not getting a Menu on the Packing Box + + * Check that scripts are enabled for you where you are; + * Check that the default click behaviour on the Packing Box hasn't been changed to Pay, etc. + * Edit the Packing Box, go to the contents folder, open up the Base Script, and check that it is set to running. + * If you copied the scripts yourself directly from the wiki on the web, ensure that no funny spaces or bad breaks come in with the text, as it often does from web pages; + +C) There is no issue per se using megaprims, though normal constraints re sim boundaries, unsocial neighbours who deny building rights, etc :} still apply. However, if a megaprim is used as your base object, you may need to set the "creatorUUID" variable (08. FINE-TUNING THE BEHAVIOUR above) to your creator's UUID. + +D) There is no issue with Buddy's Builder rezzing part of a build -- e.g. a foundation, a basement, etc, below ground level, if that is what you want. + +E) Underground + +When the linksets are moved/positioned, SL uses the coordinates of the root prim to move everything else with it. + +When you move a root prim by hand, you can to some extent ram it under the ground (as you no doubt remember from your early days in SL.) + +However, when a root prim is moved by script, script cannot move that room underground. Attempts to do so will fail silently. + +Child prims linked to it, though, *can* go underground, so long as the root prim's centrepoint remains aboveground. + +Bear this in mind if, for instance, you are planning to rez a house with a foundation, or basement. + +F) Two different Menus + +There are two different menus: one full menu for the creator of the Packing Box, and one with fewer options for the customer. + +G) What memorizes the positions of all the bits to be rezzed -- the Packing Box, or the bits themselves? + +Each "bit" remembers its own position, independent of the Packing Box and independent of its fellow bits. + +For instance, with pieces from an already recorded set, you can: + +a) make a fresh, new Packing Box; +b) drop a fresh, new base script into it; +c) load the previously prepared component pieces into it.... + +and it will all still work! + +H) Naming component pieces + +Builder's Buddy does not require all the prims in a build to have unique names. That being said, many feel it is good practice to have some kind of a naming system for the objects in your build so that they are not all named "object" or "block" or whatever. Otherwise, when you add them to the Packing Box, the SL system will just arbitrarily name them all Object, Object 1, Object 2, etc, and they will then not have the same name as those pieces in your inventory. + +Depending on what your build is, you may have more than one naming convention. At the very least, when you manually add the component script to the component objects, consider naming the objects numerically yourself such as Object 01, Object 02, etc. That way, you have some idea of how many objects are in the build, and by going 01, 02, you know the numbers weren't just system-assigned ones. You can also count them easier from inside your inventory. When a build command doesn't work right, you can look back at your history and see which object by number didn't respond to the base prim when you did the record command. + +10. FOOTNOTES + +[1] Rotation + +It is only the rotation of the Packing Box that you have to be concerned with. The rotation of the prims, or linked sets of prims, that you will be rezzing *doesn't* matter. Their rotations are part of the data that Builder's Buddy records, and deals with. + +[2] Finding the Content Folder of an Item + +Right-click the item in question (it must be rezzed in-world.) From the round pie menu, choose edit. The modal properties window will appear. Look on the right hand side for a button that says either "More>>" or "Less>>". If the blue button says "More>>", please click it. It will now say "Less>>". If it already says less, you are already ready for the next step. + +For the next step, look for the folder tab called "Content". Click on this tab, please. You are now in the Content area of the item. To put items in here, locate them in your inventory, and drag them from your inventory and *drop* then into the Content folder. In a second or two, they will appear there. If SL is not behaving at the time, it may take a few more seconds. + +To leave edit mode, locate the x in the upper-right hand corner of this editing properties window. Click it. + +[3] Distance of Set pieces from Packing Box + +In one way, there is no distance limit, with the simple proviso that all the prims must be in the same sim as the base. The base uses "region say" to communicate with them, meaning that its directions will be heard any anything listening for them within that region (aka sim.) + +However, the linden script command to rez something can only rez something at a maximum distance of 96 metres from the item doing the rezzing. Note, however, that this is "in all directions", so the rezzer can rez something a maximum distance of 96 metres to the left, and 96 metres to the right -- ergo, a total distance, if the rezzer is in the middle, of 192 metres, which is not bad going. If you also place the box, say, 96 metres in the air, then you can rez pieces 96 metres up, 96 metres down, and 96 metres to either side, right and left (bear in mind that you probably want to be higher than 96 metres in the air; ground level is rarely actually bang on "0" in most sims.) + +Consequently, when first setting out the Packing Box, and before pressing the RECORD button, it's good practice to place the Packing Box in the *middle* of the build, unless there are other prevailing reasons to place it elsewhere. + +11. USING BUILDER'S BUDDY -- CUSTOMER HELP + +Note: the following directions for usage are written in such a way that you can supply them just as they are written below to users / purchasers of your products, or, of course, modify them to make them more relevant to your product. +- - - - - - - - - - - - - - - - - - - + +Packing Box refers to the prim object you received for your purchase. "Set" refers to the items that will be rezzed out of it. + +[Note: please ensure first that you are on land where you are allowed to run scripts, or this will not work.] + +1. Rez the Packing Box. The creator may have supplied you with directions about how to place the Packing Box for optimal rezzing results. If the creator noted that the Set rezzes using the Packing Box as its centre, bear that in mind. The creator may have recommended placing the Packing Box at a certain height before using it. If so, this is most easily done by editing the Packing Box [1], going to the Object tab of its properties, and just typing the coordinates provided into the appropriate X, Y and / or Z fields. When you close the editing properties, the Packing Box may appear to vanish, but it hasn't -- it has just instantly moved to that new position! Fly there yourself to join it. + +TIP! Before changing the position using the X-Y-Z fields, consider just plain sitting on the Packing Box. That way, when it whizzes off, you will too right along with it! + +2. Click on the Packing Box. A blue menu will appear on your screen. The buttons are: + +Build / Position / Clean / Done + +3. Click the BUILD button. In a matter of microseconds, the Set rezzes into place. + +4. To move the entire Set of objects all at once, just edit the Packing Box and move it -- the pieces magically move in relation to it! + +5. There may be times when the Set of objects doesn't respond to being moved, as just described -- owing to lag, or no-script zones, etc. The POSITION command can be used to force the Set to try again. + +6. If a real mess has somehow happened, or if you were just experimenting, click the CLEAN button. This will derez everything you just rezzed, except the Packing Box itself. Then, click the BUILD button again. + +7. To fix the build in place, click the DONE button. + +CUSTOMER HELP FOOTNOTES + +[1] Editing the Packing Box + +Right-click the item in question (it must be rezzed in-world.) From the round pie menu, choose Edit. The modal properties window will appear. Look on the right hand side of it for a button that says either "More>>" or "Less>>". If it already says less, you are already ready for the next step. If the blue button instead says "More>>", please click it. It will now say "Less>>". You are now ready to proceed. + +To leave edit mode, locate the x in the upper-right hand corner of this editing properties window. Click it. diff --git a/BuildersBuddy-Opensim/BuildersBuddy-Opensim/BuildersBuddy-Opensim.prj b/BuildersBuddy-Opensim/BuildersBuddy-Opensim/BuildersBuddy-Opensim.prj new file mode 100644 index 00000000..b4367b34 --- /dev/null +++ b/BuildersBuddy-Opensim/BuildersBuddy-Opensim/BuildersBuddy-Opensim.prj @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/BuildersBuddy-Opensim/BuildersBuddy-Opensim/SomeObject/Builders+Buddy+Component+with+NC+(VAR).lsl b/BuildersBuddy-Opensim/BuildersBuddy-Opensim/SomeObject/Builders+Buddy+Component+with+NC+(VAR).lsl new file mode 100644 index 00000000..52685922 --- /dev/null +++ b/BuildersBuddy-Opensim/BuildersBuddy-Opensim/SomeObject/Builders+Buddy+Component+with+NC+(VAR).lsl @@ -0,0 +1,403 @@ +// :CATEGORY:Building +// :NAME:Builders Buddy for Opensim +// :AUTHOR:Newfie Pendragon +// :KEYWORDS:Opensim +// :REV:2 +// :WORLD:Opensim +// :DESCRIPTION: +// Builders Buddy for Opensim Component +// :CODE: +/////////////////////////////////////////////////////////////////////////////// +// Builders' Buddy 1.10 (Component Script) +// by Newfie Pendragon, 2006-2008 +/////////////////////////////////////////////////////////////////////////////// +// +// Script Purpose & Use +// Functions are dependent on the "component script" +// +// QUICK USE: +// - First change the numbers on lines 35 and 37 to any negative number, then save this script, it is important that to avoid multiple calls using more than one rez box to change these numbers everytime a new build is packed away. +// - Change the same numbers in the Component script to,,,,,to match the numbers changed in this script. +// - Drop this script in each building part, if using a linset, then drop this script into the root prim. +// - Touch your Base, and choose RECORD +// - Take all building parts into inventory +// - Drag building parts from inventory into Base Prim +// - Touch your base and choose BUILD +// +// OTHER COMMANDS from the Touch menu +// - To reposition, move/rotate Base Prim choose POSITION +// - To lock into position (removes scripts) choose DONE +// - To delete building pieces: choose CLEAN +/////////////////////////////////////////////////////////////////////////////// +// This script is copyrighted material, and has a few (minor) restrictions. +// For complete details, including a revision history, please see +// http://wiki.secondlife.com/wiki/Builders_Buddy +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// Added a Memory datastorage for opensim using osMakeNotecard +/////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////// +// Configurable Settings +float fTimerInterval = 0.25; // Time in seconds between movement 'ticks' +integer DefaultChannel = -120003; // Andromeda Quonset's default channel +//integer PRIMCHAN = DefaultChannel; // Channel used by Base Prim to talk to Component Prims; +integer PRIMCHAN = -120003; // OpenSim Modification - also comment out the previous line for OpenSim +// ***THIS MUST MATCH IN BOTH SCRIPTS!*** + +////////////////////////////////////////////////////////////////////////////////////////// +// Runtime Variables (Dont need to change below here unless making a derivative) +vector vOffset; +rotation rRotation; +integer bNeedMove; +vector vDestPos; +rotation rDestRot; +integer bMovingSingle = FALSE; +integer bAbsolute = FALSE; +integer bRecorded = FALSE; +vector Region_Size; +vector vLimit; + + +list record_mem = []; // Memory to be stored +key g_quary_nc; //for reading our memory notecard +integer nc_line; //what line are we reading +integer iStartValue; + + +//////////////////////////////////////////////////////////////////////////////// +string first_word(string In_String, string Token) +{ + //This routine searches for the first word in a string, + // and returns it. If no word boundary found, returns + // the whole string. + if(Token == "") Token = " "; + integer pos = llSubStringIndex(In_String, Token); + + //Found it? + if( pos >= 1 ) + return llGetSubString(In_String, 0, pos - 1); + else + return In_String; +} + +//////////////////////////////////////////////////////////////////////////////// +string other_words(string In_String, string Token) +{ + //This routine searches for the other-than-first words in a string, + // and returns it. If no word boundary found, returns + // an empty string. + if( Token == "" ) Token = " "; + + integer pos = llSubStringIndex(In_String, Token); + + //Found it? + if( pos >= 1 ) + return llGetSubString(In_String, pos + 1, llStringLength(In_String)); + else + return ""; +} + +//////////////////////////////////////////////////////////////////////////////// +do_move() +{ + integer i = 0; + vector vLastPos = ZERO_VECTOR; + while( (i < 5) && (llGetPos() != vDestPos) ) + { + list lParams = []; + + //If we're not there.... + if( llGetPos() != vDestPos ) + { + //We may be stuck on the ground... + //Did we move at all compared to last loop? + if( llGetPos() == vLastPos ) + { + //Yep, stuck...move straight up 10m (attempt to dislodge) + lParams = [ PRIM_POSITION, llGetPos() + <0, 0, 10.0> ]; + //llSetPos(llGetPos() + <0, 0, 10.0>); + } else { + //Record our spot for 'stuck' detection + vLastPos = llGetPos(); + } + } + + //Try to move to destination + //Upgraded to attempt to use the llSetPrimitiveParams fast-move hack + //(Newfie, June 2006) + integer iHops = llAbs(llCeil(llVecDist(llGetPos(), vDestPos) / 10.0)); + integer x; + for( x = 0; x < iHops; x++ ) { + lParams += [ PRIM_POSITION, vDestPos ]; + } + llSetPrimitiveParams(lParams); + //llSleep(0.1); + i++; + } + + //Set rotation + llSetRot(rDestRot); +} + +start_move(string sText, key kID) +{ + //Don't move if we've not yet recorded a position + if( !bRecorded ) return; + + //Also ignore commands from bases with a different owner than us + //(Anti-hacking measure) + if( llGetOwner() != llGetOwnerKey(kID) ) return; + + //Calculate our destination position relative to base? + if(!bAbsolute) { + //Relative position + //Calculate our destination position + sText = other_words(sText, " "); + list lParams = llParseString2List(sText, [ "|" ], []); + vector vBase = (vector)llList2String(lParams, 0); + rotation rBase = (rotation)llList2String(lParams, 1); + + vDestPos = (vOffset * rBase) + vBase; + rDestRot = rRotation * rBase; + } else { + //Sim position + vDestPos = vOffset; + rDestRot = rRotation; + } + + Region_Size = osGetRegionSize(); + vLimit.x = (Region_Size.x - 15); + vLimit.y = (Region_Size.y - 15); + + + //Make sure our calculated position is within the sim + if(vDestPos.x < 0.0) vDestPos.x = 0.0; + if(vDestPos.x > vLimit.x) vDestPos.x = vLimit.x; + if(vDestPos.y < 0.0) vDestPos.y = 0.0; + if(vDestPos.y > vLimit.y) vDestPos.y = vLimit.y; + if(vDestPos.z > 4096.0) vDestPos.z = 4096.0; + + //Turn on our timer to perform the move? + if( !bNeedMove ) + { + llSetTimerEvent(fTimerInterval); + bNeedMove = TRUE; + } + return; +} + +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +default +{ + ////////////////////////////////////////////////////////////////////////////////////////// + state_entry() + { + //Open up the listener + llListen(PRIMCHAN, "", NULL_KEY, ""); + llRegionSay(PRIMCHAN, "READYTOPOS"); + } + + ////////////////////////////////////////////////////////////////////////////////////////// + on_rez(integer iStart) + { + iStartValue = iStart; + if(llGetInventoryType("Builders Buddy Memory") != -1) + { + nc_line = 0; + g_quary_nc = llGetNotecardLine("Builders Buddy Memory", nc_line); + } + else + { + //Set the channel to what's specified + if( iStart != 0 ) + { + PRIMCHAN = iStart; + state reset_listeners; + } + } + } + + ////////////////////////////////////////////////////////////////////////////////////////// + listen(integer iChan, string sName, key kID, string sText) + { + string sCmd = llToUpper(first_word(sText, " ")); + + if( sCmd == "RECORD" ) + { + record_mem = []; + + //Record position relative to base prim + sText = other_words(sText, " "); + list lParams = llParseString2List(sText, [ "|" ], []); + vector vBase = (vector)llList2String(lParams, 0); + rotation rBase = (rotation)llList2String(lParams, 1); + + vOffset = (llGetPos() - vBase) / rBase; + record_mem += "vOffset|" +(string)vOffset ; + rRotation = llGetRot() / rBase; + record_mem += "rRotation|" +(string)rRotation ; + bAbsolute = FALSE; + record_mem += "bAbsolute|" +(string)bAbsolute ; + bRecorded = TRUE; + record_mem += "bRecorded|" +(string)bRecorded ; + + if(llGetInventoryType("Builders Buddy Memory") != -1) + { + llRemoveInventory("Builders Buddy Memory"); + } + osMakeNotecard( "Builders Buddy Memory", record_mem ); + + + llOwnerSay("Recorded position."); + return; + } + + if( sCmd == "RECORDABS" ) + { + record_mem = []; + //Record absolute position + rRotation = llGetRot(); + record_mem += "rRotation|" +(string)rRotation ; + vOffset = llGetPos(); + record_mem += "vOffset|" +(string)vOffset ; + bAbsolute = TRUE; + record_mem += "bAbsolute|" +(string)bAbsolute ; + bRecorded = TRUE; + record_mem += "bRecorded|" +(string)bRecorded ; + + if(llGetInventoryType("Builders Buddy Memory") != -1) + { + llRemoveInventory("Builders Buddy Memory"); + } + osMakeNotecard( "Builders Buddy Memory", record_mem ); + + llOwnerSay("Recorded sim position."); + return; + } + + ////////////////////////////////////////////////////////////////////////////////////////// + if( sCmd == "MOVE" ) + { + start_move(sText, kID); + return; + } + + if( sCmd == "MOVESINGLE" ) + { + //If we haven't gotten this before, position ourselves + if(!bMovingSingle) { + //Record that we are a single-prim move + bMovingSingle = TRUE; + + //Now move it + start_move(sText, kID); + return; + } + } + + ////////////////////////////////////////////////////////////////////////////////////////// + if( sCmd == "DONE" ) + { + //We are done, remove script + if(llGetInventoryType("Builders Buddy Memory") != -1) + { + llRemoveInventory("Builders Buddy Memory"); + } + llRemoveInventory(llGetScriptName()); + return; + } + + ////////////////////////////////////////////////////////////////////////////////////////// + if( sCmd == "CLEAN" ) + { + //Clean up + llDie(); + return; + } + + ////////////////////////////////////////////////////////////////////////////////////////// + if( sCmd == "RESET" ) + { + llResetScript(); + } + } + + ////////////////////////////////////////////////////////////////////////////////////////// + timer() + { + //Turn ourselves off + llSetTimerEvent(0.0); + + //Do we need to move? + if( bNeedMove ) + { + //Perform the move and clean up + do_move(); + + //If single-prim move, announce to base we're done + if(bMovingSingle) { + llRegionSay(PRIMCHAN, "ATDEST"); + } + + //Done moving + bNeedMove = FALSE; + } + return; + } + dataserver(key queryid, string data) + { + if ( queryid == g_quary_nc) + { + if (data != EOF) + { + list n = llParseString2List(data, ["|"], []); + + if(llList2String(n, 0) == "vOffset") + { + vOffset = llList2Vector(n, 1); + } + else if(llList2String(n, 0) == "rRotation") + { + rRotation = llList2Rot(n, 1); + } + else if(llList2String(n, 0) == "bAbsolute") + { + bAbsolute = (integer)llList2String(n, 1); + } + else if(llList2String(n, 0) == "bRecorded") + { + bRecorded = (integer)llList2String(n, 1); + } + nc_line++; + g_quary_nc = llGetNotecardLine("Builders Buddy Memory", nc_line); + } + else + { + //Set the channel to what's specified + if( iStartValue != 0 ) + { + PRIMCHAN = iStartValue; + state reset_listeners; + } + } + } + } +} + + +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////// +state reset_listeners +{ + ////////////////////////////////////////////////////////////////////////////////////////// + state_entry() + { + state default; + } +} \ No newline at end of file diff --git a/Lightshare/Lightshare/Lightshare.lsl b/Lightshare/Lightshare/Lightshare.lsl new file mode 100644 index 00000000..709b18f3 --- /dev/null +++ b/Lightshare/Lightshare/Lightshare.lsl @@ -0,0 +1,1235 @@ +//############################################################################### +//############################################################################### +// Script for displaying a choice of Windlight settings. Jeff Hall, January 2015 +// (Special thanks to Caro Fayray for testing the gizmo too:)) +// The lightshare script function is restricted to the region owner only; the region owner +// must be the same as the object owner though anyone can change windlight after. +// Changes will be visible to everyone having lightshare enabled on his viewer. + +// Provided under Creative Commons Attribution-Non-Commercial-ShareAlike 4.0 International license. +// Original Dark Blue settings from Wizardry and Steamworks 2012 +// Please be sure you read and adhere to the terms of this license: http://creativecommons.org/licenses/by-nc-sa/4.0/ + +//REQUIREMENTS------------------------------------------- +// LightShare must be enabled in the simulator and viewer +// (http://opensimulator.org/wiki/LightShare) +// Opensim.ini: +// [LightShare] +// ; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer. +// ; It has no ill effect on viewers which do not support server-side windlight settings. +// enable_windlight = true +// and +// [XEngine] +// ; Allow the user of LightShare functions +// AllowLightShareFunctions = true +// Viewer: +// example for Firestorm: Preferences/Opensim/Micellaneous -> Enable region Lightshare settings +// Update list of compatible viewers: http://opensimulator.org/wiki/Compatible_Viewers +// Successful tests were made with both MySQL and SQLite databases +// It might happen that some lightshare settings having floating values with many digits might have +// to be reapplied after a sim restart. It is possible however to increase the number of digits for +// fields having floating values like float(3,2) to float(9,6) for example in regionwindlight table +// in opensim database. Doing that will make lightshare settings always retained in database after a +// region restart. +// (Another possibility to insure settings retaining after a region restart can be done by using the +// Windlight-Scheduler normally included with the present Windlight-Displayer). + +//----------------------------------------------------- +// This script is intended to offer a customised lightshare when running but it always offers the possibility +// to display default one if user chooses Default option button in menu and it will do as long as sim is running. +// Sim restart will show by default the last custom lightshare used and stored in [regionwindlight] database table. +// If you want to get back permanently to default lightshare settings remove the device and set back default display +// in region settings through your viewer. +// This displayer can be rezzed in more than one place in region; in such case they will sync together for displaying +// Current windlight name or Default one. This script is free to edit for windlight settings but keep in mind that you +// should always have same script in all displayers of your region. +// Settings descriptions are included at end. +// After rezzing device you might need to reset scripts: right-click on device, Edit/Content/Reset Scripts +// (or you can use top bar menu Build/Scripts/Reset scripts). +// Enjoy:) +//############################################################################### +//############################################################################### + +integer ownerOnly = TRUE; // default FALSE; option to limitate windlight change to owner (if TRUE) + +//-------------------------- +integer dialogChannel = -256; //channel can be changed here if desired +list buttons = ["Dawn", "Sunset","Next","Starry","Glowing","Golden","Past", "Fog", "Deep Night","Dark Blue I","Dark Blue II","Evening"]; +list buttons2 = ["Random","Default","Previous","Auroras","Blazing", "Tropical","Alien I","Alien II","Pastel", "Stormy I", "Stormy II", "Green"]; + +list lstWindlight = []; +string dialogInfo = "\nWindlight Setting\n\nPlease make a choice."; +key ToucherID; +key owner = ""; +integer listenHandle; +float timerDelay = 10; // reapply periodically lightshare settings; default 10 - change to 0 for disabling but custom lightshare may not keep showing after tp back from another region. + +integer blnActivateNext; //prevents multiple dialog windows on Next button with more than one gizmo in region +string strDeactivateNext = "2c2f8725-49b2-40c7-af2f-7d4fce2e9033"; + +list settings; + +list settingsToRead =[WL_WATER_COLOR, WL_WATER_FOG_DENSITY_EXPONENT, WL_UNDERWATER_FOG_MODIFIER, WL_REFLECTION_WAVELET_SCALE, WL_FRESNEL_SCALE, WL_FRESNEL_OFFSET, WL_REFRACT_SCALE_ABOVE, WL_REFRACT_SCALE_BELOW, WL_BLUR_MULTIPLIER, WL_BIG_WAVE_DIRECTION, WL_LITTLE_WAVE_DIRECTION, WL_NORMAL_MAP_TEXTURE, WL_HAZE_HORIZON, WL_BLUE_DENSITY, WL_HORIZON, WL_DENSITY_MULTIPLIER, WL_DISTANCE_MULTIPLIER, WL_MAX_ALTITUDE, WL_SUN_MOON_COLOR, WL_AMBIENT, WL_SUN_MOON_POSITION, WL_EAST_ANGLE, WL_SUN_GLOW_SIZE, WL_SUN_GLOW_FOCUS, WL_SCENE_GAMMA, WL_STAR_BRIGHTNESS, WL_CLOUD_COLOR, WL_CLOUD_XY_DENSITY, WL_CLOUD_COVERAGE, WL_CLOUD_SCALE, WL_CLOUD_DETAIL_XY_DENSITY, WL_CLOUD_SCROLL_X, WL_CLOUD_SCROLL_Y, WL_CLOUD_SCROLL_Y_LOCK, WL_CLOUD_SCROLL_X_LOCK, WL_DRAW_CLASSIC_CLOUDS, WL_HAZE_DENSITY]; + + +default + +{ + state_entry() + + { + + llResetScript(); + llSetText(")",<0,1,1>,1.0); + llSetTimerEvent(timerDelay); + owner = llGetOwner(); + + llSetTextureAnim( // a FUNCTION that requires the following PARAMETER list: + (0 // option list: use // to disable any you do not want. + | ANIM_ON // Disable this line to turn off animations. + | LOOP // repeat animation over and over. - almost always needed + //| REVERSE // animate in opposite direction. + // | PING_PONG // reverses completed animation back to starting point + | SMOOTH // disables flip-book style 'frames' animation + // | ROTATE // spins texture instead of offsetting it + // | SCALE // zoom/shrinks texture instead of offsetting it. + ), + ALL_SIDES, // One face number or ALL_SIDES. 0=top, 1=side, 2=bottom,... depending on shape. + 0,0, // Grid Size, for 'frames' style animation, X frames wide, by Y Frames tall. + 0.0, // START: first frame, or first offset, scale or rotation angle. + TWO_PI, // LENGTH: # of frames to show, distance to offset or scale, use TWO_PI for ROTATE! + 0.07// "frames per second" smaller = slower + ); // End + + listenHandle = llListen(dialogChannel, "", ToucherID, ""); + blnActivateNext = FALSE; + } + + on_rez (integer param) + + { + llResetScript(); + } + + touch_start(integer total_number) + + { + if ((ownerOnly == FALSE) || ( (ownerOnly == TRUE) && (llDetectedKey(0) == owner))) + { + llRegionSay(dialogChannel,strDeactivateNext); //initializes blnActivateNext + llSleep(0.1); + blnActivateNext = TRUE; //only touched displayer will show next dialog menu if clicked, not others listening if present in region + ToucherID = llDetectedKey(0); + llDialog(ToucherID, dialogInfo, buttons, dialogChannel); + } + else + { + llSay(0,"Actual settings only allow owner for changing windlight."); + } + } + + + listen(integer channel, string name, key id, string message) + + { + + //llListenRemove(listenHandle); //keep open for communicating if you have more than one windlight displayer in region + + if (message == strDeactivateNext) + { + blnActivateNext = FALSE; //make sure other objects listening are correctly set + } + + + if (message == "Dark Blue I") + { + lstWindlight = [ + WL_WATER_COLOR, <13, 97, 135>, + WL_WATER_FOG_DENSITY_EXPONENT, 0.0, + WL_UNDERWATER_FOG_MODIFIER, 0.25, + WL_REFLECTION_WAVELET_SCALE, <2.0, 2.0, 2.0>, + WL_FRESNEL_SCALE, 0.10, + WL_FRESNEL_OFFSET, 0.58, + WL_REFRACT_SCALE_ABOVE, 0.08, + WL_REFRACT_SCALE_BELOW, 0.20, + WL_BLUR_MULTIPLIER, 0.003, + WL_BIG_WAVE_DIRECTION, <0.50, -0.17, 0>, + WL_LITTLE_WAVE_DIRECTION, <0.58, -0.67, 0>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.33, + WL_BLUE_DENSITY, <0.13, 0.21, 0.34, 0.34>, + WL_HORIZON, <0.24,0.40,0.46,0.46>, + WL_DENSITY_MULTIPLIER, 0.01, + WL_DISTANCE_MULTIPLIER, 0.7, + WL_MAX_ALTITUDE, 711, + WL_SUN_MOON_COLOR, <0.21,0.23,0.29,0.29>, + WL_AMBIENT, <0.09,0.15,0.25,0.25>, + WL_SUN_MOON_POSITION, 0.375, + WL_EAST_ANGLE, 0.50, + WL_SUN_GLOW_SIZE, 1.79, + WL_SUN_GLOW_FOCUS, 0.10, + WL_SCENE_GAMMA, 1.61, + WL_STAR_BRIGHTNESS, 0.00, + WL_CLOUD_COLOR, <0.53,0.53,0.53,0.53>, + WL_CLOUD_XY_DENSITY, <0.73,0.34,0.33>, + WL_CLOUD_COVERAGE, 0.26, + WL_CLOUD_SCALE, 0.33, + WL_CLOUD_DETAIL_XY_DENSITY, <0.29,0.85,0.02>, + WL_CLOUD_SCROLL_X, 0.50, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 0.7 + ]; + + lsSetWindlightScene(lstWindlight); + } + + if (message == "Dark Blue II") + { + lstWindlight = [ + WL_WATER_COLOR, <13, 97, 135>, + WL_WATER_FOG_DENSITY_EXPONENT, 0.0, + WL_UNDERWATER_FOG_MODIFIER, 0.25, + WL_REFLECTION_WAVELET_SCALE, <2.0, 2.0, 2.0>, + WL_FRESNEL_SCALE, 0.10, + WL_FRESNEL_OFFSET, 0.58, + WL_REFRACT_SCALE_ABOVE, 0.08, + WL_REFRACT_SCALE_BELOW, 0.20, + WL_BLUR_MULTIPLIER, 0.003, + WL_BIG_WAVE_DIRECTION, <0.50, -0.17, 0>, + WL_LITTLE_WAVE_DIRECTION, <0.58, -0.67, 0>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.33, + WL_BLUE_DENSITY, <0.0, 0.0, 0.0, 0.0>, + WL_HORIZON, <0.24,0.40,0.46,0.46>, + WL_DENSITY_MULTIPLIER, 0.01, + WL_DISTANCE_MULTIPLIER, 0.7, + WL_MAX_ALTITUDE, 711, + WL_SUN_MOON_COLOR, <0.07,0.06,0.07,0.29>, + WL_AMBIENT, <0.09,0.15,0.25,0.25>, + WL_SUN_MOON_POSITION, 0.375, + WL_EAST_ANGLE, 0.50, + WL_SUN_GLOW_SIZE, 1.79, + WL_SUN_GLOW_FOCUS, 0.1, + WL_SCENE_GAMMA, 2.5, + WL_STAR_BRIGHTNESS, 0.00, + WL_CLOUD_COLOR, <0.53,0.53,0.53,0.53>, + WL_CLOUD_XY_DENSITY, <0.73,0.34,0.33>, + WL_CLOUD_COVERAGE, 0.26, + WL_CLOUD_SCALE, 0.33, + WL_CLOUD_DETAIL_XY_DENSITY, <0.29,0.85,0.02>, + WL_CLOUD_SCROLL_X, 0.50, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 0.7 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + + if (message == "Evening") + { + lstWindlight = [ + WL_WATER_COLOR, <13, 97, 135>, + WL_WATER_FOG_DENSITY_EXPONENT, 0.0, + WL_UNDERWATER_FOG_MODIFIER, 0.25, + WL_REFLECTION_WAVELET_SCALE, <2.0, 2.0, 2.0>, + WL_FRESNEL_SCALE, 0.10, + WL_FRESNEL_OFFSET, 0.58, + WL_REFRACT_SCALE_ABOVE, 0.08, + WL_REFRACT_SCALE_BELOW, 0.20, + WL_BLUR_MULTIPLIER, 0.003, + WL_BIG_WAVE_DIRECTION, <0.50, -0.17, 0>, + WL_LITTLE_WAVE_DIRECTION, <0.58, -0.67, 0>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.33, + WL_BLUE_DENSITY, <0.13, 0.21, 0.34, 0.34>, + WL_HORIZON, <0.12,0.20,0.25,0.46>, + WL_DENSITY_MULTIPLIER, 0.01, + WL_DISTANCE_MULTIPLIER, 0.7, + WL_MAX_ALTITUDE, 711, + WL_SUN_MOON_COLOR, <0.14,0.12,0.14,0.29>, + WL_AMBIENT, <0.05,0.07,0.12,0.25>, + WL_SUN_MOON_POSITION, 0.375, + WL_EAST_ANGLE, 0.50, + WL_SUN_GLOW_SIZE, 1.79, + WL_SUN_GLOW_FOCUS, 0.10, + WL_SCENE_GAMMA, 0.5, + WL_STAR_BRIGHTNESS, 0.00, + WL_CLOUD_COLOR, <0.53,0.53,0.53,0.53>, + WL_CLOUD_XY_DENSITY, <0.73,0.34,0.33>, + WL_CLOUD_COVERAGE, 0.35, + WL_CLOUD_SCALE, 0.45, + WL_CLOUD_DETAIL_XY_DENSITY, <0.29,0.85,0.02>, + WL_CLOUD_SCROLL_X, 0.50, + WL_CLOUD_SCROLL_Y, -0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 0.7 + ]; + + lsSetWindlightScene(lstWindlight); + + } + + + if (message == "Past") + { + lstWindlight = [ + WL_WATER_COLOR, <220, 220, 195>, + WL_WATER_FOG_DENSITY_EXPONENT, 0.0, + WL_UNDERWATER_FOG_MODIFIER, 0.25, + WL_REFLECTION_WAVELET_SCALE, <2.0, 2.0, 2.0>, + WL_FRESNEL_SCALE, 0.10, + WL_FRESNEL_OFFSET, 0.58, + WL_REFRACT_SCALE_ABOVE, 0.08, + WL_REFRACT_SCALE_BELOW, 0.20, + WL_BLUR_MULTIPLIER, 0.003, + WL_BIG_WAVE_DIRECTION, <0.50, -0.17, 0>, + WL_LITTLE_WAVE_DIRECTION, <0.58, -0.67, 0>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.50, + WL_BLUE_DENSITY, <0.0, 0.0, 0.0, 0.0>, + WL_HORIZON, <0.24,0.40,0.46,0.46>, + WL_DENSITY_MULTIPLIER, 0.01, + WL_DISTANCE_MULTIPLIER, 0.7, + WL_MAX_ALTITUDE, 711, + WL_SUN_MOON_COLOR, <0.07,0.06,0.07,0.29>, + WL_AMBIENT, <0.4,0.4,0.25,0.25>, + WL_SUN_MOON_POSITION, 0.375, + WL_EAST_ANGLE, 0.50, + WL_SUN_GLOW_SIZE, 1.79, + WL_SUN_GLOW_FOCUS, 0.1, + WL_SCENE_GAMMA, 2.0, + WL_STAR_BRIGHTNESS, 0.00, + WL_CLOUD_COLOR, <0.53,0.53,0.53,0.53>, + WL_CLOUD_XY_DENSITY, <0.73,0.34,0.33>, + WL_CLOUD_COVERAGE, 0.26, + WL_CLOUD_SCALE, 0.33, + WL_CLOUD_DETAIL_XY_DENSITY, <0.29,0.85,0.02>, + WL_CLOUD_SCROLL_X, 0.50, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 0.7 + ]; + + lsSetWindlightScene(lstWindlight); + + } + + if (message == "Fog") + { + lstWindlight = [ + WL_WATER_COLOR, <220, 220, 195>, + WL_WATER_FOG_DENSITY_EXPONENT, 0.0, + WL_UNDERWATER_FOG_MODIFIER, 0.25, + WL_REFLECTION_WAVELET_SCALE, <2.0, 2.0, 2.0>, + WL_FRESNEL_SCALE, 0.10, + WL_FRESNEL_OFFSET, 0.58, + WL_REFRACT_SCALE_ABOVE, 0.08, + WL_REFRACT_SCALE_BELOW, 0.20, + WL_BLUR_MULTIPLIER, 0.003, + WL_BIG_WAVE_DIRECTION, <0.50, -0.17, 0>, + WL_LITTLE_WAVE_DIRECTION, <0.58, -0.67, 0>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.8, + WL_BLUE_DENSITY, <0.0, 0.0, 0.0, 0.0>, + WL_HORIZON, <0.24,0.40,0.46,0.46>, + WL_DENSITY_MULTIPLIER, 0.2, + WL_DISTANCE_MULTIPLIER, 80, + WL_MAX_ALTITUDE, 711, + WL_SUN_MOON_COLOR, <0.07,0.06,0.07,0.29>, + WL_AMBIENT, <0.05,0.05,0.03,0.03>, + WL_SUN_MOON_POSITION, 0.375, + WL_EAST_ANGLE, 0.50, + WL_SUN_GLOW_SIZE, 1.79, + WL_SUN_GLOW_FOCUS, 0.1, + WL_SCENE_GAMMA, 2.5, + WL_STAR_BRIGHTNESS, 0.00, + WL_CLOUD_COLOR, <0.53,0.53,0.53,0.53>, + WL_CLOUD_XY_DENSITY, <0.73,0.34,0.33>, + WL_CLOUD_COVERAGE, 0.35, + WL_CLOUD_SCALE, 0.33, + WL_CLOUD_DETAIL_XY_DENSITY, <0.29,0.85,0.02>, + WL_CLOUD_SCROLL_X, -0.25, + WL_CLOUD_SCROLL_Y, 0.25, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 0.7 + + ]; + + lsSetWindlightScene(lstWindlight); + } + + + if (message == "Deep Night") + { + lstWindlight = [ + + WL_WATER_COLOR, <13, 97, 135>, + WL_WATER_FOG_DENSITY_EXPONENT, 0.0, + WL_UNDERWATER_FOG_MODIFIER, 0.201542, + WL_REFLECTION_WAVELET_SCALE, <2.000000,2.000000,2.000000>, + WL_FRESNEL_SCALE, 0.1, + WL_FRESNEL_OFFSET, 0.58, + WL_REFRACT_SCALE_ABOVE, 0.08, + WL_REFRACT_SCALE_BELOW, 0.2, + WL_BLUR_MULTIPLIER, 0.003, + WL_BIG_WAVE_DIRECTION, <0.500000,-0.170000,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <0.580000,-0.670000,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.33, + WL_BLUE_DENSITY, <0.130000,0.210000,0.340000,0.340000>, + WL_HORIZON, <0.285776,0.350453,0.211813,0.094694>, + WL_DENSITY_MULTIPLIER, 0.000076, + WL_DISTANCE_MULTIPLIER, 0.7, + WL_MAX_ALTITUDE, 931, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.575061, + WL_EAST_ANGLE, 0.5, + WL_SUN_GLOW_SIZE, 1.79, + WL_SUN_GLOW_FOCUS, 0.1, + WL_SCENE_GAMMA, 1.61, + WL_STAR_BRIGHTNESS, 0, + WL_CLOUD_COLOR, <0.530000,0.530000,0.530000,0.530000>, + WL_CLOUD_XY_DENSITY, <0.730000,0.340000,0.330000>, + WL_CLOUD_COVERAGE, 0.26, + WL_CLOUD_SCALE, 0.33, + WL_CLOUD_DETAIL_XY_DENSITY, <0.290000,0.850000,0.020000>, + WL_CLOUD_SCROLL_X, -0.5, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 0.7 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + + if (message == "Starry") + { + lstWindlight = [ + + WL_WATER_COLOR, <0,0,128>, + WL_WATER_FOG_DENSITY_EXPONENT, 0.806602, + WL_UNDERWATER_FOG_MODIFIER, 0.448619, + WL_REFLECTION_WAVELET_SCALE, <1.768648,1.242124,7.178653>, + WL_FRESNEL_SCALE, 0.266238, + WL_FRESNEL_OFFSET, 0.639828, + WL_REFRACT_SCALE_ABOVE, 0.378514, + WL_REFRACT_SCALE_BELOW, 0.877668, + WL_BLUR_MULTIPLIER, 0.084658, + WL_BIG_WAVE_DIRECTION, <0.81,0.621785,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <0.042799,0.56936,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.098134, + WL_BLUE_DENSITY, <0.427008,0.535837,0.957327,0.663032>, + WL_HORIZON, <0.528483,0.659543,0.900877,0.495787>, + WL_DENSITY_MULTIPLIER, 0.000703, + WL_DISTANCE_MULTIPLIER, 1.074452, + WL_MAX_ALTITUDE, 324, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.66092, + WL_EAST_ANGLE, 0.602004, + WL_SUN_GLOW_SIZE, 0.450286, + WL_SUN_GLOW_FOCUS, 0.078417, + WL_SCENE_GAMMA, 1.0, + WL_STAR_BRIGHTNESS, 1.99, + WL_CLOUD_COLOR, <0.613282,0.836680,0.582055,0.301782>, + WL_CLOUD_XY_DENSITY, <0.775693,0.040026,0.609956>, + WL_CLOUD_COVERAGE, 0.12, + WL_CLOUD_SCALE, 0.455395, + WL_CLOUD_DETAIL_XY_DENSITY, <0.398200,0.118275,0.867201>, + WL_CLOUD_SCROLL_X, 0.5, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 3.95 + + ]; + + lsSetWindlightScene(lstWindlight); + } + + + if (message == "Glowing") + { + lstWindlight = [ + + WL_WATER_COLOR, <0.0,143.0,175.0>, + WL_WATER_FOG_DENSITY_EXPONENT, 1.156439, + WL_UNDERWATER_FOG_MODIFIER, 0.969125, + WL_REFLECTION_WAVELET_SCALE, <8.482132,9.775111,4.452634>, + WL_FRESNEL_SCALE, 0.546374, + WL_FRESNEL_OFFSET, 0.503164, + WL_REFRACT_SCALE_ABOVE, 0.628186, + WL_REFRACT_SCALE_BELOW, 0.980204, + WL_BLUR_MULTIPLIER, 0.03555, + WL_BIG_WAVE_DIRECTION, <1.05452,1.07541,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <1.120385,1.155334,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.472696, + WL_BLUE_DENSITY, <0.622049,0.798068,0.097409,0.597018>, + WL_HORIZON, <0.0,0.30,0.85,0.32>, + WL_DENSITY_MULTIPLIER, 0.039702, + WL_DISTANCE_MULTIPLIER, 4.824, + WL_MAX_ALTITUDE, 44, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.365929, + WL_EAST_ANGLE, 0.883019, + WL_SUN_GLOW_SIZE, 1.780648, + WL_SUN_GLOW_FOCUS, 0.073334, + WL_SCENE_GAMMA, 0.646127, + WL_STAR_BRIGHTNESS, 1.301247, + WL_CLOUD_COLOR, <0.979874,0.169159,0.049543,0.470948>, + WL_CLOUD_XY_DENSITY, <0.715409,0.414984,0.128918>, + WL_CLOUD_COVERAGE, 0.493855, + WL_CLOUD_SCALE, 0.656979, + WL_CLOUD_DETAIL_XY_DENSITY, <0.182797,0.031768,0.981983>, + WL_CLOUD_SCROLL_X, 0.5, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 2.439926 + + ]; + + lsSetWindlightScene(lstWindlight); + } + + + if (message == "Golden") + { + lstWindlight = [ + + WL_WATER_COLOR, <70.000000,105.000000,225.000000>, + WL_WATER_FOG_DENSITY_EXPONENT, 1.074903, + WL_UNDERWATER_FOG_MODIFIER, 0.139087, + WL_REFLECTION_WAVELET_SCALE, <4.759264,5.874388,4.500500>, + WL_FRESNEL_SCALE, 0.769096, + WL_FRESNEL_OFFSET, 0.55626, + WL_REFRACT_SCALE_ABOVE, 0.178062, + WL_REFRACT_SCALE_BELOW, 0.292827, + WL_BLUR_MULTIPLIER, 0.00557, + WL_BIG_WAVE_DIRECTION, <1.117288,1.092456,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <1.029926,1.073620,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.464688, + WL_BLUE_DENSITY, <0.884736,0.505738,0.718928,0.116796>, + WL_HORIZON, <0.873863,0.656011,0.048029,0.027890>, + WL_DENSITY_MULTIPLIER, 0.017132, + WL_DISTANCE_MULTIPLIER, 9.799045, + WL_MAX_ALTITUDE, 1647, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.260481, + WL_EAST_ANGLE, 0.391493, + WL_SUN_GLOW_SIZE, 1.916126, + WL_SUN_GLOW_FOCUS, 0.336887, + WL_SCENE_GAMMA, 1.25, + WL_STAR_BRIGHTNESS, 1.493026, + WL_CLOUD_COLOR, <0.646161,0.607957,0.273940,0.298599>, + WL_CLOUD_XY_DENSITY, <0.903541,0.279909,0.248966>, + WL_CLOUD_COVERAGE, 0.054694, + WL_CLOUD_SCALE, 0.364161, + WL_CLOUD_DETAIL_XY_DENSITY, <0.451154,0.719094,0.904059>, + WL_CLOUD_SCROLL_X, 0.5, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 1.264978 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + + if (message == "Dawn") + { + lstWindlight = [ + + WL_WATER_COLOR, <24.0,116.0,204.0>, + WL_WATER_FOG_DENSITY_EXPONENT, 1.361316, + WL_UNDERWATER_FOG_MODIFIER, 0.310014, + WL_REFLECTION_WAVELET_SCALE, <9.080267,9.881126,4.626266>, + WL_FRESNEL_SCALE, 0.289506, + WL_FRESNEL_OFFSET, 0.465959, + WL_REFRACT_SCALE_ABOVE, 0.1, + WL_REFRACT_SCALE_BELOW, 0.2, + WL_BLUR_MULTIPLIER, 0.068954, + WL_BIG_WAVE_DIRECTION, <0.5025839,0.519449,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <0.5020831,0.51808,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.6, + WL_BLUE_DENSITY, <0.452756,0.744644,0.876003,0.148455>, + WL_HORIZON, <0.1,0.015,0.015,0.5>, + WL_DENSITY_MULTIPLIER, 0.01, + WL_DISTANCE_MULTIPLIER, 5, + WL_MAX_ALTITUDE, 286, + WL_SUN_MOON_COLOR, <0.500000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.044625, + WL_EAST_ANGLE, 0.0, + WL_SUN_GLOW_SIZE, 0.566237, + WL_SUN_GLOW_FOCUS, 0.062125, + WL_SCENE_GAMMA, 1.317128, + WL_STAR_BRIGHTNESS, 0.179336, + WL_CLOUD_COLOR, <0.2,0.5,0.98,0.5>, + WL_CLOUD_XY_DENSITY, <0.325122,0.528978,0.082439>, + WL_CLOUD_COVERAGE, 0.452798, + WL_CLOUD_SCALE, 0.317025, + WL_CLOUD_DETAIL_XY_DENSITY, <0.593138,0.719283,0.743420>, + WL_CLOUD_SCROLL_X, 0.5, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 1.154176 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + + + if (message == "Sunset") + { + lstWindlight = [ + WL_WATER_COLOR, <24.0,116.0,204.0>, + WL_WATER_FOG_DENSITY_EXPONENT, 1.361316, + WL_UNDERWATER_FOG_MODIFIER, 0.310014, + WL_REFLECTION_WAVELET_SCALE, <9.080267,9.881126,4.626266>, + WL_FRESNEL_SCALE, 0.489506, + WL_FRESNEL_OFFSET, 0.465959, + WL_REFRACT_SCALE_ABOVE, 0.1, + WL_REFRACT_SCALE_BELOW, 0.2, + WL_BLUR_MULTIPLIER, 0.068954, + WL_BIG_WAVE_DIRECTION, <0.625839,0.75449,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <0.5831,0.61808,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.3, + WL_BLUE_DENSITY, <0.1,0.2,0.96003,0.5>, + WL_HORIZON, <0.6,0.35,0.05,0.5>, + WL_DENSITY_MULTIPLIER, 0.01, + WL_DISTANCE_MULTIPLIER, 5, + WL_MAX_ALTITUDE, 1000, + WL_SUN_MOON_COLOR, <0.600000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.5,0.2,0.2,0.250000>, + WL_SUN_MOON_POSITION, 0.044625, + WL_EAST_ANGLE, 0.5, + WL_SUN_GLOW_SIZE, 0.566237, + WL_SUN_GLOW_FOCUS, 0.062125, + WL_SCENE_GAMMA, 1.0, + WL_STAR_BRIGHTNESS, 0.179336, + WL_CLOUD_COLOR, <0.9,0.01,0.01,0.5>, + WL_CLOUD_XY_DENSITY, <0.325122,0.528978,0.082439>, + WL_CLOUD_COVERAGE, 0.4, + WL_CLOUD_SCALE, 0.317025, + WL_CLOUD_DETAIL_XY_DENSITY, <0.593138,0.719283,0.743420>, + WL_CLOUD_SCROLL_X, 0.6, + WL_CLOUD_SCROLL_Y, 0.6, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 1.154176 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + if (message == "Auroras") + { + lstWindlight = [ + WL_WATER_COLOR, <4,45,59>, + WL_WATER_FOG_DENSITY_EXPONENT, 4.546884, + WL_UNDERWATER_FOG_MODIFIER, 0.512493, + WL_REFLECTION_WAVELET_SCALE, <4.469752,8.397901,6.772451>, + WL_FRESNEL_SCALE, 0.740427, + WL_FRESNEL_OFFSET, 0.429028, + WL_REFRACT_SCALE_ABOVE, 0.163292, + WL_REFRACT_SCALE_BELOW, 0.255536, + WL_BLUR_MULTIPLIER, 0.036157, + WL_BIG_WAVE_DIRECTION, <1.0337,1.097433,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <1.064652,1.104659,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.555065, + WL_BLUE_DENSITY, <0.533372,0.948385,0.035603,0.789831>, + WL_HORIZON, <0.205941,0.659320,0.440049,0.893509>, + WL_DENSITY_MULTIPLIER, 0.008022, + WL_DISTANCE_MULTIPLIER, 1.312191, + WL_MAX_ALTITUDE, 851, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.522986, + WL_EAST_ANGLE, 0.070157, + WL_SUN_GLOW_SIZE, 0.923597, + WL_SUN_GLOW_FOCUS, 0.214807, + WL_SCENE_GAMMA, 1.352096, + WL_STAR_BRIGHTNESS, 0.779212, + WL_CLOUD_COLOR, <0.613282,0.836680,0.582055,0.301782>, + WL_CLOUD_XY_DENSITY, <0.775693,0.040026,0.609956>, + WL_CLOUD_COVERAGE, 0.10, + WL_CLOUD_SCALE, 0.30, + WL_CLOUD_DETAIL_XY_DENSITY, <0.398200,0.118275,0.867201>, + WL_CLOUD_SCROLL_X, 1.5, + WL_CLOUD_SCROLL_Y, -1.21, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 3.053385 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + if (message == "Blazing") + { + lstWindlight = [ + WL_WATER_COLOR, <12.000000,11.000000,242.000000>, + WL_WATER_FOG_DENSITY_EXPONENT, 3.2, + WL_UNDERWATER_FOG_MODIFIER, 0.2, + WL_REFLECTION_WAVELET_SCALE, <5.003543,3.677973,7.428368>, + WL_FRESNEL_SCALE, 0.364123, + WL_FRESNEL_OFFSET, 0.806711, + WL_REFRACT_SCALE_ABOVE, 0.25, + WL_REFRACT_SCALE_BELOW, 0.41, + WL_BLUR_MULTIPLIER, 0.122565, + WL_BIG_WAVE_DIRECTION, <1.190023,1.169864,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <1.294151,0.332772,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.14245, + WL_BLUE_DENSITY, <0.12,0.22,0.6,0.38>, + WL_HORIZON, <0.01,0.01,0.95,0.473398>, + WL_DENSITY_MULTIPLIER, 0.015, + WL_DISTANCE_MULTIPLIER, 5.983785, + WL_MAX_ALTITUDE, 1273, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.421118, + WL_EAST_ANGLE, 0.465805, + WL_SUN_GLOW_SIZE, 1.843351, + WL_SUN_GLOW_FOCUS, 0.100182, + WL_SCENE_GAMMA, 0.799964, + WL_STAR_BRIGHTNESS, 1.688747, + WL_CLOUD_COLOR, <0.926600,0.639131,0.015565,0.787496>, + WL_CLOUD_XY_DENSITY, <0.378630,0.555684,0.376508>, + WL_CLOUD_COVERAGE, 0.664558, + WL_CLOUD_SCALE, 0.538342, + WL_CLOUD_DETAIL_XY_DENSITY, <0.638437,0.377386,0.066438>, + WL_CLOUD_SCROLL_X, 0.5, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 0.411159 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + if (message == "Tropical") + { + lstWindlight = [ + WL_WATER_COLOR, <2,92,118>, + WL_WATER_FOG_DENSITY_EXPONENT, 0.857744, + WL_UNDERWATER_FOG_MODIFIER, 0.302291, + WL_REFLECTION_WAVELET_SCALE, <0.122116,4.969574,4.639734>, + WL_FRESNEL_SCALE, 0.5, + WL_FRESNEL_OFFSET, 0.144779, + WL_REFRACT_SCALE_ABOVE, 0.1, + WL_REFRACT_SCALE_BELOW, 0.227461, + WL_BLUR_MULTIPLIER, 0.129715, + WL_BIG_WAVE_DIRECTION, <1.120768,0.014471,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <1.127961,1.176837,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.482459, + WL_BLUE_DENSITY, <0.138669,0.079370,0.226809,0.355229>, + WL_HORIZON, <0.517153,0.785614,0.787254,0.499298>, + WL_DENSITY_MULTIPLIER, 0.008614, + WL_DISTANCE_MULTIPLIER, 5.11371, + WL_MAX_ALTITUDE, 1725, + WL_SUN_MOON_COLOR, <0.180000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.476858, + WL_EAST_ANGLE, 0.44213, + WL_SUN_GLOW_SIZE, 0.15, + WL_SUN_GLOW_FOCUS, 0.14, + WL_SCENE_GAMMA, 1.773116, + WL_STAR_BRIGHTNESS, 0.3, + WL_CLOUD_COLOR, <0.284874,0.453412,0.481085,0.697756>, + WL_CLOUD_XY_DENSITY, <0.679722,0.296304,0.077528>, + WL_CLOUD_COVERAGE, 0.6683, + WL_CLOUD_SCALE, 0.490673, + WL_CLOUD_DETAIL_XY_DENSITY, <0.767853,0.485206,0.288665>, + WL_CLOUD_SCROLL_X, 0.5, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 2.711425 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + if (message == "Alien I") + { + lstWindlight = [ + WL_WATER_COLOR, <255.000000,140.000000,120.000000>, + WL_WATER_FOG_DENSITY_EXPONENT, 4.275422, + WL_UNDERWATER_FOG_MODIFIER, 0.753856, + WL_REFLECTION_WAVELET_SCALE, <9.072795,9.057376,8.325322>, + WL_FRESNEL_SCALE, 0.437583, + WL_FRESNEL_OFFSET, 0.039738, + WL_REFRACT_SCALE_ABOVE, 0.113699, + WL_REFRACT_SCALE_BELOW, 0.229843, + WL_BLUR_MULTIPLIER, 0.012684, + WL_BIG_WAVE_DIRECTION, <1.102530,1.014892,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <1.057676,1.151330,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.104257, + WL_BLUE_DENSITY, <0.732192,0.577070,0.895777,0.441964>, + WL_HORIZON, <0.688909,0.056618,0.010287,0.913922>, + WL_DENSITY_MULTIPLIER, 0.045303, + WL_DISTANCE_MULTIPLIER, 3.912289, + WL_MAX_ALTITUDE, 1078, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.261623, + WL_EAST_ANGLE, 0.858494, + WL_SUN_GLOW_SIZE, 1.025843, + WL_SUN_GLOW_FOCUS, 0.184915, + WL_SCENE_GAMMA, 1.237678, + WL_STAR_BRIGHTNESS, 1.977334, + WL_CLOUD_COLOR, <0.915072,0.525595,0.508093,0.894061>, + WL_CLOUD_XY_DENSITY, <0.601834,0.601545,0.901130>, + WL_CLOUD_COVERAGE, 0.968258, + WL_CLOUD_SCALE, 0.659125, + WL_CLOUD_DETAIL_XY_DENSITY, <0.887841,0.966825,0.325718>, + WL_CLOUD_SCROLL_X, 0.5, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 1.529225 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + if (message == "Alien II") + + { + lstWindlight = [ + + WL_WATER_COLOR, <20.000000,20.000000,250.000000>, + WL_WATER_FOG_DENSITY_EXPONENT, 2.189766, + WL_UNDERWATER_FOG_MODIFIER, 0.55, + WL_REFLECTION_WAVELET_SCALE, <9.715599,4.410477,2.864550>, + WL_FRESNEL_SCALE, 0.117491, + WL_FRESNEL_OFFSET, 0.41, + WL_REFRACT_SCALE_ABOVE, 0.347905, + WL_REFRACT_SCALE_BELOW, 0.691796, + WL_BLUR_MULTIPLIER, 0.070381, + WL_BIG_WAVE_DIRECTION, <1.066186,1.072411,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <1.695046,1.454970,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.07781, + WL_BLUE_DENSITY, <0.895898,0.132409,0.903198,0.217329>, + WL_HORIZON, <0.803396,0.375369,0.049990,0.507849>, + WL_DENSITY_MULTIPLIER, 0.014775, + WL_DISTANCE_MULTIPLIER, 1.773642, + WL_MAX_ALTITUDE, 1918, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.176223, + WL_EAST_ANGLE, 0.887109, + WL_SUN_GLOW_SIZE, 1.905627, + WL_SUN_GLOW_FOCUS, 0.459043, + WL_SCENE_GAMMA, 1.2, + WL_STAR_BRIGHTNESS, 0.239079, + WL_CLOUD_COLOR, <0.829880,0.622903,0.147659,0.231128>, + WL_CLOUD_XY_DENSITY, <0.082016,0.924883,0.472532>, + WL_CLOUD_COVERAGE, 0.549067, + WL_CLOUD_SCALE, 0.466998, + WL_CLOUD_DETAIL_XY_DENSITY, <0.447306,0.118532,0.447821>, + WL_CLOUD_SCROLL_X, 0.5, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 3.542748 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + if (message == "Pastel") + { + lstWindlight = [ + + WL_WATER_COLOR, <70,70,255>, + WL_WATER_FOG_DENSITY_EXPONENT, 1.859902, + WL_UNDERWATER_FOG_MODIFIER, 0.05484, + WL_REFLECTION_WAVELET_SCALE, <2.332820,1.450380,6.004194>, + WL_FRESNEL_SCALE, 0.821228, + WL_FRESNEL_OFFSET, 0.974064, + WL_REFRACT_SCALE_ABOVE, 0.202604, + WL_REFRACT_SCALE_BELOW, 0.445756, + WL_BLUR_MULTIPLIER, 0.140242, + WL_BIG_WAVE_DIRECTION, <1.169339,1.304617,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <1.226967,1.201977,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.293679, + WL_BLUE_DENSITY, <0.818531,0.225085,0.270699,0.814529>, + WL_HORIZON, <0.542345,0.630488,0.999437,0.482495>, + WL_DENSITY_MULTIPLIER, 0.025901, + WL_DISTANCE_MULTIPLIER, 7.389419, + WL_MAX_ALTITUDE, 3546, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.576888, + WL_EAST_ANGLE, 0.301374, + WL_SUN_GLOW_SIZE, 1.467226, + WL_SUN_GLOW_FOCUS, 0.028611, + WL_SCENE_GAMMA, 1.161464, + WL_STAR_BRIGHTNESS, 0.694566, + WL_CLOUD_COLOR, <0.097070,0.037996,0.922019,0.376037>, + WL_CLOUD_XY_DENSITY, <0.504887,0.903854,0.333629>, + WL_CLOUD_COVERAGE, 0.507194, + WL_CLOUD_SCALE, 0.324423, + WL_CLOUD_DETAIL_XY_DENSITY, <0.362944,0.505987,0.381911>, + WL_CLOUD_SCROLL_X, 0.5, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 0.375798 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + if (message == "Green") + { + lstWindlight = [ + + WL_WATER_COLOR, <143.000000,8.000000,244.000000>, + WL_WATER_FOG_DENSITY_EXPONENT, 4.596728, + WL_UNDERWATER_FOG_MODIFIER, 0.903586, + WL_REFLECTION_WAVELET_SCALE, <6.190049,9.343415,8.273363>, + WL_FRESNEL_SCALE, 0.734167, + WL_FRESNEL_OFFSET, 0.92322, + WL_REFRACT_SCALE_ABOVE, 0.198997, + WL_REFRACT_SCALE_BELOW, 0.425253, + WL_BLUR_MULTIPLIER, 0.156237, + WL_BIG_WAVE_DIRECTION, <1.007799,1.063067,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <0.086489,1.027987,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.017827, + WL_BLUE_DENSITY, <0.169330,0.881638,0.542157,0.667066>, + WL_HORIZON, <0.135497,0.635862,0.281199,0.813000>, + WL_DENSITY_MULTIPLIER, 0.02348, + WL_DISTANCE_MULTIPLIER, 1.833835, + WL_MAX_ALTITUDE, 1067, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.492108, + WL_EAST_ANGLE, 0.679085, + WL_SUN_GLOW_SIZE, 1.707343, + WL_SUN_GLOW_FOCUS, 0.157667, + WL_SCENE_GAMMA, 0.55, + WL_STAR_BRIGHTNESS, 1.90, + WL_CLOUD_COLOR, <0.364116,0.509619,0.694290,0.294289>, + WL_CLOUD_XY_DENSITY, <0.317294,0.397761,0.014796>, + WL_CLOUD_COVERAGE, 0.675815, + WL_CLOUD_SCALE, 0.65418, + WL_CLOUD_DETAIL_XY_DENSITY, <0.724749,0.791208,0.833693>, + WL_CLOUD_SCROLL_X, 0.5, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 0.154653 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + if (message == "Stormy I") + { + lstWindlight = [ + + WL_WATER_COLOR, <10,20,100>, + WL_WATER_FOG_DENSITY_EXPONENT, 4.949285, + WL_UNDERWATER_FOG_MODIFIER, 0.841768, + WL_REFLECTION_WAVELET_SCALE, <2.556013,7.317167,6.218210>, + WL_FRESNEL_SCALE, 0.498239, + WL_FRESNEL_OFFSET, 0.341853, + WL_REFRACT_SCALE_ABOVE, 0.040897, + WL_REFRACT_SCALE_BELOW, 0.350035, + WL_BLUR_MULTIPLIER, 0.063045, + WL_BIG_WAVE_DIRECTION, <1.516222,1.043062,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <1.479535,1.904096,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.526211, + WL_BLUE_DENSITY, <0.315234,0.927577,0.049778,0.362574>, + WL_HORIZON, <0.253345,0.080743,0.062392,0.760345>, + WL_DENSITY_MULTIPLIER, 0.052131, + WL_DISTANCE_MULTIPLIER, 8.036792, + WL_MAX_ALTITUDE, 110, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.434187, + WL_EAST_ANGLE, 0.354136, + WL_SUN_GLOW_SIZE, 1.5, + WL_SUN_GLOW_FOCUS, 0.110, + WL_SCENE_GAMMA, 0.443614, + WL_STAR_BRIGHTNESS, 0.01, + WL_CLOUD_COLOR, <0.955256,0.549615,0.807651,0.774151>, + WL_CLOUD_XY_DENSITY, <0.044507,0.831330,0.026146>, + WL_CLOUD_COVERAGE, 0.563004, + WL_CLOUD_SCALE, 0.203409, + WL_CLOUD_DETAIL_XY_DENSITY, <0.668823,0.474131,0.670602>, + WL_CLOUD_SCROLL_X, 1.5, + WL_CLOUD_SCROLL_Y, 1.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 3.05443 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + if (message == "Stormy II") + { + lstWindlight = [ + + WL_WATER_COLOR, <10.000000,20.000000,30.000000>, + WL_WATER_FOG_DENSITY_EXPONENT, 3.927478, + WL_UNDERWATER_FOG_MODIFIER,0.25, + WL_REFLECTION_WAVELET_SCALE, <8.648945,0.320922,5.837881>, + WL_FRESNEL_SCALE, 0.999, + WL_FRESNEL_OFFSET, 0.283757, + WL_REFRACT_SCALE_ABOVE, 0.1, + WL_REFRACT_SCALE_BELOW, 0.2, + WL_BLUR_MULTIPLIER, 0.145278, + WL_BIG_WAVE_DIRECTION, <0.320949,1.728583,0.000000>, + WL_LITTLE_WAVE_DIRECTION, <1.215789,1.939170,0.000000>, + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, 0.598074, + WL_BLUE_DENSITY, <0.640521,0.168140,0.110020,0.799253>, + WL_HORIZON, <0.427968,0.986404,0.132727,0.118051>, + WL_DENSITY_MULTIPLIER, 0.003264, + WL_DISTANCE_MULTIPLIER, 7.389575, + WL_MAX_ALTITUDE, 1350, + WL_SUN_MOON_COLOR, <0.210000,0.230000,0.290000,0.290000>, + WL_AMBIENT, <0.090000,0.150000,0.250000,0.250000>, + WL_SUN_MOON_POSITION, 0.877433, + WL_EAST_ANGLE, 0.618273, + WL_SUN_GLOW_SIZE, 0.78664, + WL_SUN_GLOW_FOCUS, 0.184933, + WL_SCENE_GAMMA, 1.5, + WL_STAR_BRIGHTNESS, 0.01, + WL_CLOUD_COLOR, <0.299142,0.668265,0.691254,0.564617>, + WL_CLOUD_XY_DENSITY, <0.624777,0.693689,0.023239>, + WL_CLOUD_COVERAGE, 0.88998, + WL_CLOUD_SCALE, 0.6050092, + WL_CLOUD_DETAIL_XY_DENSITY, <0.982330,0.496900,0.855927>, + WL_CLOUD_SCROLL_X, 1.7, + WL_CLOUD_SCROLL_Y, -1.8, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, 2.713881 + + ]; + + lsSetWindlightScene(lstWindlight); + + } + + //------------------------ + + if (message == "Random") //unlike other choices the Random option generates a new windlight each time + { + + lstWindlight = [ + WL_WATER_COLOR, , + WL_WATER_FOG_DENSITY_EXPONENT, llFrand(5.0), + WL_UNDERWATER_FOG_MODIFIER, llFrand(1.0), + WL_REFLECTION_WAVELET_SCALE, , + WL_FRESNEL_SCALE, llFrand(1.0), + WL_FRESNEL_OFFSET, llFrand(1.0), + WL_REFRACT_SCALE_ABOVE, llFrand(1.0), + WL_REFRACT_SCALE_BELOW, llFrand(1.0), + WL_BLUR_MULTIPLIER, llFrand(0.160), + WL_BIG_WAVE_DIRECTION, , + WL_LITTLE_WAVE_DIRECTION, , + WL_NORMAL_MAP_TEXTURE, "822ded49-9a6c-f61c-cb89-6df54f42cdf4", + WL_HAZE_HORIZON, llFrand(0.65), + WL_BLUE_DENSITY, , + WL_HORIZON, , + WL_DENSITY_MULTIPLIER, llFrand(0.2), + WL_DISTANCE_MULTIPLIER, llFrand(10.0), + WL_MAX_ALTITUDE, llRound(llFrand(4000)), + WL_SUN_MOON_COLOR, <0.21,0.23,0.29,0.29>, + WL_AMBIENT, <0.09,0.15,0.25,0.25>, + WL_SUN_MOON_POSITION, llFrand(1.000), + WL_EAST_ANGLE, llFrand(1.0), + WL_SUN_GLOW_SIZE, llFrand(1.99), + WL_SUN_GLOW_FOCUS, llFrand(0.50), + WL_SCENE_GAMMA, llFrand(3.0), + WL_STAR_BRIGHTNESS, llFrand(2.0), + WL_CLOUD_COLOR, , + WL_CLOUD_XY_DENSITY, , + WL_CLOUD_COVERAGE, llFrand(1.0), + WL_CLOUD_SCALE, llFrand(0.65)+0.01, + WL_CLOUD_DETAIL_XY_DENSITY, , + WL_CLOUD_SCROLL_X, 0.50, + WL_CLOUD_SCROLL_Y, 0.51, + WL_CLOUD_SCROLL_Y_LOCK, 0, + WL_CLOUD_SCROLL_X_LOCK, 0, + WL_DRAW_CLASSIC_CLOUDS, 1, + WL_HAZE_DENSITY, llFrand(4.0) + ]; + + lsSetWindlightScene(lstWindlight); + + //llSay(0, llDumpList2String(lstWindlight,";")); //used to retrieve windlight settings in local chat + } + + //------------------------ + + if (message == "Default") + + { + lsClearWindlightScene(); + llSetTimerEvent(0); //Disabling periodic reading in regionwindlight database table (unless timerDelay is set 0) + } + + if (message != "Default" && message != "Next" && message != "Previous" && message != strDeactivateNext) + + { + llSetTimerEvent(timerDelay); + } + + if (message == "Next" && blnActivateNext == TRUE) + { + llDialog(ToucherID, dialogInfo, buttons2, dialogChannel); + } + + if (message == "Previous" && blnActivateNext == TRUE) + { + llDialog(ToucherID, dialogInfo, buttons, dialogChannel); + } + + if (message != "Next" && message != "Previous" && message != strDeactivateNext) + { + llSetText("Touch To Set Windlight\n(Lightshare Required)\n" + message,<0,1,1>,1.0); + blnActivateNext = FALSE; //reset until next user touch + } + + + } + + timer() + + { + // apply last windlight periodically to insure it will show on new arrival + settings = lsGetWindlightScene(settingsToRead); + lsSetWindlightScene (settings); + + } +} + + +//------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------------- +//SETTINGS DESCRIPTIONS + +// WL_WATER_COLOR: The water colour. It expects a vector containing values between 0 and 255. <0,0,0> is black, <255,255,255> is white. <4,38,64> is the default colour. +// WL_WATER_FOG_DENSITY_EXPONENT: The "cloudiness" of the water. It expects a float value between 0.0 and 10.0. The default is 4.0. +// WL_UNDERWATER_FOG_MODIFIER: When underwater, this controls how foggy the water is. It expects a float between 0.0 and 2.0. The default is 0.25. +// WL_REFLECTION_WAVELET_SCALE: How big do you want the waves on the water to appear? This is a vector containing three values between 0.0 and 10.0. The components of the vector represent water layers 1,2 and 3. The default is <2.0,2.0,2.0>. +// WL_FRESNEL_SCALE: This controls size of the part of the wavelet that reflects light. At 0.0, the water is very reflective. At 1.0, it isn't reflective at all. It's a float between 0.0 and 1.0. The default is 0.40. +// WL_FRESNEL_OFFSET: This controls how much light to reflect. It's a float between 0.0 and 1.0, the default is 0.50. +// WL_REFRACT_SCALE_ABOVE +// WL_REFRACT_SCALE_BELOW +// WL_BLUR_MULTIPLIER: This controls how the wavelets blur in the distance. 0.0 means no blur, and values above 0.040 all seem to represent the highest amount of blur, however the float is between 0.000 and 0.160. The default is 0.040. +// WL_BIG_WAVE_DIRECTION: Which direction do the bigger waves travel in? This parameter expects a float with the first two parameters representing the X and Y value (the Z parameter can be anything). The default is <1.05,-0.42,0>. +// WL_LITTLE_WAVE_DIRECTION: Which direction do the smaller waves travel in? This parameter expects a float with the first two parameters representing the X and Y value (the Z parameter can be anything). The default is <1.11,-1.16,0>. +// WL_NORMAL_MAP_TEXTURE: This is the texture that's used for the surface of the water. It's a key, and the default is 822ded49-9a6c-f61c-cb89-6df54f42cdf4. +// WL_HORIZON: The colour of the horizon. ("Blue Horizon" in the windlight panel). This expects a faux-quaternion with the X,Y,Z,W parameters representing R,G,B,I respectively, each a float between 0.0 and 1.0. The default is <0.25,0.25,0.32,0.32>. +// WL_HAZE_HORIZON: Controls the amount of haze on the horizon. It's a float between 0.00 and 1.00. The default is 0.19. +// WL_BLUE_DENSITY: Misleadingly, this controls the density of the colour on the horizon (which isn't always blue!) and expects a faux-quaternion of four floats between 0.0 and 1.0. The default is <0.12,0.22,0.38,0.38>. +// WL_HAZE_DENSITY: This controls the density of the haze on the horizon. It's a single float between 0.0 and 4.0. The default is 0.70. +// WL_DENSITY_MULTIPLIER: This controls the density of the entire sky. A setting of 0.0 makes the sky black. It's a float between 0.0 and 0.90. The default is 0.18. +// WL_DISTANCE_MULTIPLIER: Want to bring the horizon right up to your doorstep? This controls how far away the sky is! It's a float between 0.0 and 100.0. The default is 0.8. +// WL_MAX_ALTITUDE: This controls the height of the atmosphere. It's an integer value between 0 and 4000. The default is 1605. +// WL_SUN_MOON_POSITION: The position of the sun/mooon in the sky (Please also see WL_EAST_ANGLE). This can be used to create a day/night cycle. It's a float between 0.000 and 1.000. +// WL_SUN_MOON_COLOR: Pretty self explanatory. Try a pink sun - go on, you know you want to. It's a faux-quaternion expecting four floats between 0.0 and 1.0. The default is <0.24,0.26,0.30,0.30>. +// WL_AMBIENT: This controls the ambient lighting. To a certain extent it also influences the horizon colour. Again, it's a faux-quaternion expecting four floats between 0.0 and 1.0. The default is <0.35,0.35,0.35,0.35>. +//WL_EAST_ANGLE: This controls "which way is east".. affecting the horizontal position of the sun (or moon) in the sky. It's a float between 0.00 and 1.00. The default is 0.00. +// WL_SUN_GLOW_FOCUS: This controls how blurry the suns' corona is. It's a float between 0.0 and 0.50, and the default is 0.10. +// WL_SUN_GLOW_SIZE: This controls the size of the sun's corona. It's a float between 1.00 and 1.99, and the default is 1.75. +// WL_SCENE_GAMMA: This controls the scene gamma correction. It's a float between 0.0 and 10.00, and the default is 1.00. +// WL_STAR_BRIGHTNESS: Starry starry night! Or day! You be the boss. This is a float between 0.00 and 2.00. The default is 0.00. +// WL_CLOUD_COLOR: A faux-quaternion representing cloud colour. Four floats between 0.0 and 1.0. The default is <0.41,0.41,0.41,0.41>. +// WL_CLOUD_XY_DENSITY: This is a vector of three components, . The X and Y positions control the location of the "cloud mass" in the sky, which may be useless if you use WL_CLOUD_SCROLL_X. The Density however is more useful and controls the thickness of the cloud masses. Three floats between 0.0 and 1.0. The default is <1.00,0.53,1.0>. +// WL_CLOUD_COVERAGE: This simply controls how cloudy the sky is. It's a float between 0.0 and 1.0, and the default is 0.27. +// WL_CLOUD_SCALE: This controls the size of the clouds. It's a float between 0.01 and 1.00, and the default is 0.42. +// WL_CLOUD_DETAIL_XY_DENSITY: Much like WL_CLOUD_XY_DENSITY, except it doesn't control the "cloud mass" but instead affects the density of cloud whisps with those masses. Three floats between 0.0 and 1.0, the default is <1.00,0.53,0.12>. +// WL_CLOUD_SCROLL_X: How fast (and in what direction on the X axis) do the clouds move? It's a float between -10.00 and 10.00, and the default is 0.20. +// WL_CLOUD_SCROLL_Y:How fast (and in what direction on the Y axis) do the clouds move? It's a float between -10.00 and 10.00, and the default is 0.01. +// WL_DRAW_CLASSIC_CLOUDS: Currently non functional, but accepts TRUE or FALSE. May be implemented in the future. Default is TRUE. +// WL_CLOUD_SCROLL_X_LOCK: This allows you to lock clouds in place. It's the same as setting WL_CLOUD_SCROLL_X to 0.0. It accepts TRUE or FALSE. Default is FALSE. +// WL_CLOUD_SCROLL_Y_LOCK: This allows you to lock clouds in place. It's the same as setting WL_CLOUD_SCROLL_Y to 0.0. It accepts TRUE or FALSE. Default is FALSE. +//------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------------- + diff --git a/New folder/Flash.lsl b/New folder/Flash.lsl new file mode 100644 index 00000000..7661580e --- /dev/null +++ b/New folder/Flash.lsl @@ -0,0 +1,34 @@ +integer primnum = 0 ; // change to the number of a prim that you want to flash +integer counter = 0; +Off() { + llSetLinkPrimitiveParamsFast(0,[PRIM_POINT_LIGHT, TRUE, <1,1,1>, 1.0, 10, .1, PRIM_FULLBRIGHT, ALL_SIDES,1, PRIM_GLOW, ALL_SIDES, 1.0]); +} +On() { + llSetLinkPrimitiveParamsFast(0,[PRIM_POINT_LIGHT, FALSE, <1,1,1>, 1.0, 10, .1, PRIM_FULLBRIGHT, ALL_SIDES,0, PRIM_GLOW, ALL_SIDES, 0.0]); +} +default +{ + state_entry() + { + Off(); + } + touch_start(integer total_number) + { + llSetTimerEvent(.1); // 1/10 a second between events + } + timer() + { + if (counter == 0) + On(); + else if (counter == 1) + Off(); + else if (counter == 2) + On(); + else if (counter == 2) { + Off(); + llSetTimerEvent(0); + } + counter++; + } + +} \ No newline at end of file diff --git a/Opensim Partners/Opensim Partners.sol b/Opensim Partners/Opensim Partners.sol new file mode 100644 index 00000000..7215056e --- /dev/null +++ b/Opensim Partners/Opensim Partners.sol @@ -0,0 +1,3 @@ + + + diff --git a/Opensim Partners/Opensim Partners/Object/Opensim Partners.lsl b/Opensim Partners/Opensim Partners/Object/Opensim Partners.lsl new file mode 100644 index 00000000..3718424e --- /dev/null +++ b/Opensim Partners/Opensim Partners/Object/Opensim Partners.lsl @@ -0,0 +1,201 @@ +//:AUTHOR: Digiworldz.com +//:DESCRIPTION: Opensim Partnership program +// :REVISION: 2 +//:CODE: +// Put this in a box. When two people touch it, they can make a partership. +// Mods by Ferd Frederix for Dreamgrid + +// A SETTING YOU HAVE TO SET FOR SECURITY +// It works when blank, but it is possible for someone with this script to make or drop partners! + +// Set this to your Unique grid identifier from the Settings panel. +string PW = ""; + +// CODE follows, the rest of this should probably not be modified. +// If you want to see a lot of messages, set this to TRUE +integer debug = FALSE; + +// variables +string URL = ""; +// Default = 8001 for Dreamgrid. :80 or blank for other grids +string PORT = ":8001"; +// How long you have to convince him/her to click the box +float TIMEOUT = 20.0; // seconds + + +list PAR = []; +key id1; // 1st user +string name1; // 1st user +key id2; // 2nd user +string name2; // 2nd user +key id3; // partner of 2nd user +string name3; // partner of 2nd user + +key http_request_id1; // get_partner; 1st user +key http_request_id2; // begin: get_partner; 2nd user +key http_request_id3; // begin: set_partner; 1st user +key http_request_id4; // begin: set_partner; 2nd user +key http_request_id5; // dissolve: set_partner; 1st user +key http_request_id6; // dissolve: set_partner; 2nd user + + +DEBUG(string msg) { + if (debug) { + llSay(0,msg); + }; +} + +string left(string src, string divider) { + integer index = llSubStringIndex( src, divider ); + if(~index) + return llDeleteSubString( src, index, -1); + return src; +} +string right(string src, string divider) { + integer index = llSubStringIndex( src, divider ); + if(~index) + return llDeleteSubString( src, 0, index + llStringLength(divider) - 1); + return src; +} +// default state +default { + state_entry() { + //Grid Gatekeeper Uri + URL = "http:" + left(right(osGetGridGatekeeperURI(),":"),":"); + DEBUG(URL); + + llSetText("Click here to begin or\ndissolve partnership", <1,1,1>, 1); + } + touch_start(integer num_detected) { + id1 = llDetectedKey(0); + name1 = llDetectedName(0); + string req = URL + PORT + "/get_partner?PW=" + PW + "&User=" + (string)id1; + DEBUG(req); + http_request_id1 = llHTTPRequest(req, PAR, ""); + } + + // called for all HTTP responses of all states + http_response(key request_id, integer status, list metadata, string body) { + + if (request_id == http_request_id1) { + // get_partner; 1st user + DEBUG("Partner = " + body); + id2 = (key)body; + name2 = llGetDisplayName(id2); + if (!name2) name2 = (string)id2; + + if (id2 == NULL_KEY) + { + llSay(0, name1 + ", you have no partnership at the moment"); + state begin_partnership; + } else { + llSay(0, name1 + ", your partner is " + name2); + state dissolve_partnership; + } + } else if (request_id == http_request_id2) { + // begin: get_partner; 2nd user + id3 = (key)body; + DEBUG("Partner = " + body); + + name3 = llGetDisplayName(id3); + if (!name3) name3 = (string)id3; + + if (id3 == NULL_KEY) + { + string req = URL + PORT + "/set_partner?PW=" + PW + "&User=" + (string)id1 + "&Partner=" + (string)id2; + DEBUG(req); + http_request_id3 = llHTTPRequest(req, PAR, ""); + } else { + llSay(0, name2 + ", you have " + name3 + " as partner already"); + state default; + } + } else if (request_id == http_request_id3) { + // begin: set_partner; 1st user + string req = URL +PORT + "/set_partner?PW=" + PW + "&User=" + (string)id2 + "&Partner=" + (string)id1; + DEBUG(req); + http_request_id4 = llHTTPRequest(req, PAR, ""); + } else if (request_id == http_request_id4) { + // begin: set_partner; 2nd user + llSay(0, name1 + " and " + name2 + " are now partners. Relog to see your new relationship status in your profiles."); + state default; + } else if (request_id == http_request_id5) { + // dissolve: set_partner; 2nd user + id2 = (key)body; + string req = URL+PORT + "/set_partner?PW=" + PW + "&User=" + (string)id2 + "&Partner=" + (string)NULL_KEY; + DEBUG(req); + http_request_id6 = llHTTPRequest(req, PAR, ""); + } else if (request_id == http_request_id6) { + // dissolve: set_partner; 2nd user + llSay(0, name1 + " and " + name2 + " are not partners anymore"); + state default; + } else { + // unknown response + llOwnerSay("Error: unknown response"); + } + } +} + +state begin_partnership{ + state_entry() { + llSetText("Future partner of\n" + name1 + "\nplease click here", <1,1,1>, 1.0); + llSay(0,"Future partner of " + name1 + ", please click the box"); + llSetTimerEvent(TIMEOUT); + } + + timer() { + llSay(0, "Timeout, please try again"); + llSetTimerEvent(0.0); + state default; + } + + touch_start(integer num_detected) { + llSetTimerEvent(0.0); + id2 = llDetectedKey(0); + name2 = llDetectedName(0); + + if ((string)id1 == (string)id2) + { + llSay(0, "canceled"); + state default; + } + + // check if new partner has no partnership + string req = URL +PORT + "/get_partner?PW=" + PW + "&User=" + (string)id2; + DEBUG(req); + http_request_id2 = llHTTPRequest(req, PAR, ""); + state default; + } +} + +// dissolve partnership + +state dissolve_partnership{ + state_entry() { + llSetText(name1 + ", click \nif you want to dissolve\nyour current partnership", <1,1,1>, 1.0); + llSay(0,name1 + ", click if you want to dissolve your current partnership"); + llSetTimerEvent(TIMEOUT); + } + + timer() { + llSay(0, "Timeout, please try again"); + llSetTimerEvent(0.0); + state default; + } + + touch_start(integer num_detected) { + llSetTimerEvent(0.0); + id2 = llDetectedKey(0); + name2 = llDetectedName(0); + + if ((string)id1 != (string)id2) + { + llSay(0, "canceled"); + state default; + } + + string req = URL +PORT + "/set_partner?PW=" + PW + "&User=" + (string)id1 + "&Partner=" + (string)NULL_KEY; + DEBUG(req); + http_request_id5 = llHTTPRequest(req, PAR, ""); + state default; + } +} diff --git a/Opensim Partners/Opensim Partners/Opensim Partners.prj b/Opensim Partners/Opensim Partners/Opensim Partners.prj new file mode 100644 index 00000000..5c2ed40c --- /dev/null +++ b/Opensim Partners/Opensim Partners/Opensim Partners.prj @@ -0,0 +1,6 @@ + + + + +