├── .gitignore ├── README.md └── Scripts ├── Animated Texture - Simple.lsl ├── Animated Texture Smooth.lsl ├── Answering Machine.lsl ├── Anti Push.lsl ├── Archanox's Free Music Script.lsl ├── Avatar Alert.lsl ├── Avatar Animator.lsl ├── Basic Push.lsl ├── Basic Radar.lsl ├── Blog Feed Script.lsl ├── Builders Buddy ├── Builders' Buddy (Base Script).lsl ├── Builders' Buddy 1.10 (Component Script) OpenSim.lsl ├── Builders' Buddy 1.10 (Component Script) SecondLife.lsl └── README.md ├── Button Script for Action on Touch - No Prim Buttons ├── Button Script for Action on Touch - No Prim Buttons - OSCC variation.lsl └── Button Script for Action on Touch - No Prim Buttons.lsl ├── Camera Follower.lsl ├── Chat Die.lsl ├── Chat logger(GPL).lsl ├── Check Inventory Permissions.lsl ├── Cloack.lsl ├── Color Change.lsl ├── Color Generator.lsl ├── Color Gradient.lsl ├── Color Vector on Color Change.lsl ├── Countdown To Event Timer.lsl ├── Curtain Puller.lsl ├── Cycle Textures.lsl ├── Dance.lsl ├── Detect Face Prim ├── Detect Prim Face.lsl ├── README.md └── fleepgrid_tool_primface_detector_numbergrid.jpg ├── Dialogue Menu SB Dialog.lsl ├── Digital Signs Controller ├── Digital Sign Vertical.lsl ├── Digital Sign.lsl ├── Digital Signs Controller.lsl ├── Digital Signs Horizontal.lsl ├── NOTECARD - Digital Signs README.txt ├── NOTECARD - Digital Signs Settings.txt └── README.md ├── Fade Prim to Transparent and Back Again Cycle.lsl ├── Find Link Number.lsl ├── Flame.lsl ├── Flight Script - Final Flight 2.2.lsl ├── Flight Script(Andrew Linden).lsl ├── Floating Text.lsl ├── Force Mouselook.lsl ├── Get Linknumber.lsl ├── Give All Contents 2.1.lsl ├── Give All Contents.lsl ├── Give Inventory.lsl ├── GiveAllContents 2.1 - Give to Anyone.lsl ├── Group Privacy(SL).lsl ├── Height Detector.lsl ├── Jetpack(SL).lsl ├── Play_Animation_on_Attach.lsl ├── Set Transparant Texture(SL).lsl └── Tyken Hightower's Generic Door Script.lsl /.gitignore: -------------------------------------------------------------------------------- 1 | *.sublime-project 2 | *.sublime-workspace -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LSL-OpenSim-Script-Library 2 | LSL OpenSim Script Library 3 | 4 | Library of scripts that can be used in OpenSim 5 | -------------------------------------------------------------------------------- /Scripts/Animated Texture - Simple.lsl: -------------------------------------------------------------------------------- 1 | //Animated Texture - Simple 2 | 3 | // SCRIPT_NAME = "animated texture-simple"; 4 | // DESCRIPTION = "animated the texture my offseting the texture at intervals"; 5 | 6 | //by bUTTONpUSHER Jones 7 | //Mod by BuhBuhCuh Fairchild 8 | //v 1.0 9 | 10 | // global variables 11 | integer gCellsAcross = 72; 12 | integer gCellsDown = 1; 13 | // seconds between cells 14 | float gSwitchTime = 0.000; 15 | float gOffsetU; 16 | float gOffsetV; 17 | float gScaleU; 18 | float gScaleV; 19 | 20 | key gKey; 21 | vector gScale; 22 | 23 | 24 | // all scripts start in the default state 25 | default 26 | { 27 | //this state will allow colors to be set 28 | state_entry() 29 | { 30 | 31 | gScaleU = 1/(float)gCellsAcross; 32 | gScaleV = 1/(float)gCellsDown; 33 | // U range is -0.5 to 0.5 left to right 34 | // V range is 0.5 to -0.5 top to bottom 35 | // divided by 2 to put focus at the center of the cell 36 | gOffsetU = -0.5 + gScaleU / 2; 37 | gOffsetV = 0.5 - gScaleV / 2; 38 | // next line automatically scales the texture 39 | // llScaleTexture(gScaleU, gScaleV, -1); 40 | 41 | // next line focuses the texture on the last cell - for use if this is a click-started animation 42 | // llOffsetTexture(0.5-gScaleU/2, -0.5+gScaleV/2, -1); 43 | 44 | state Movie; 45 | } 46 | 47 | } 48 | 49 | state Movie 50 | { 51 | state_entry() 52 | { 53 | integer i; 54 | integer j; 55 | integer k; 56 | float OffsetU; 57 | float OffsetV; 58 | @Loophere; 59 | // set local offset variables equal to global offset constants 60 | OffsetU = gOffsetU; 61 | OffsetV = gOffsetV; 62 | 63 | for (i=0; i, key=, " 62 | 63 | // Convert comma-separated-values into a list 64 | list msg_list = llCSV2List( message ); 65 | if( llList2String( msg_list, 0) == "Button Message" ) 66 | { 67 | 68 | string sender_name = llList2String( msg_list, 1); 69 | key user_key = llList2Key( msg_list, 2); 70 | string user_name = llList2String( msg_list, 3); 71 | 72 | if( sender_name == "leave_message_btn" ) 73 | { 74 | current_speaker_name = user_name; 75 | if( listen_id != -1 ) 76 | { 77 | llListenRemove( listen_id ); 78 | } 79 | 80 | listen_id = llListen( 0, user_name, "", "" ); 81 | llSay(0, "Leave a one-line message after the beep...BEEP!" ); 82 | } 83 | else 84 | if( sender_name == "play_messages_btn" ) 85 | { 86 | if( user_key == llGetOwner() ) 87 | { 88 | readList(); 89 | } 90 | } 91 | else 92 | if( sender_name == "erase_messages_btn" ) 93 | { 94 | if( user_key == llGetOwner() ) 95 | { 96 | resetList(); 97 | } 98 | } 99 | } 100 | } 101 | } -------------------------------------------------------------------------------- /Scripts/Anti Push.lsl: -------------------------------------------------------------------------------- 1 | //Anti-Push 2 | 3 | // AntiPush Script V1.0 4 | // Created 11/17/2003 by Sapphire Bombay 5 | // Last Updated 11/17/2003 6 | // Concept adapted from Huns Valen 7 | // Freely donated to the public domain 8 | 9 | integer locked; // TRUE if avatar is damping to current position 10 | float LOCKWAIT = 1.0; // if you don't move for this period of time, you lock into place 11 | 12 | default 13 | { 14 | state_entry() 15 | { 16 | } 17 | 18 | // request controls & prime locked condition 19 | on_rez(integer start_param) 20 | { 21 | llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS); 22 | locked = FALSE; 23 | } 24 | 25 | // if user accepts, trap control events and also allow them to pass on to the avatar for movement: 26 | // 27 | // llTakeControls(integer controls, integer accept, integer pass_on); 28 | // 29 | // If (accept == (controls & input)), send input to object. If the boolean pass_on is TRUE, also send input to avatar. 30 | 31 | run_time_permissions(integer perm) 32 | { 33 | if(perm & (PERMISSION_TAKE_CONTROLS)) 34 | { 35 | llTakeControls(CONTROL_FWD| 36 | CONTROL_BACK| 37 | CONTROL_RIGHT| 38 | CONTROL_LEFT| 39 | CONTROL_ROT_RIGHT| 40 | CONTROL_ROT_LEFT| 41 | CONTROL_UP| 42 | CONTROL_DOWN, 43 | TRUE, TRUE); 44 | // set timer to periodically check the time since the last control input 45 | llSetTimerEvent(1); 46 | } 47 | } 48 | 49 | // called any time a user moves. release the damping if the avatar is locked. reset the time since last movement. 50 | control(key id, integer level, integer edge) 51 | { 52 | if (locked) 53 | { 54 | llMoveToTarget(llGetPos(), 0); 55 | locked = FALSE; 56 | //llWhisper(0, "unlocked"); 57 | } 58 | llResetTime(); 59 | } 60 | 61 | // if the avatar is not already locked and it has been longer than the wait time since the last movement then lock the avatar 62 | timer() 63 | { 64 | if ((!locked) && (llGetTime() > LOCKWAIT)) 65 | { 66 | llMoveToTarget(llGetPos(), 0.2); 67 | locked = TRUE; 68 | //llWhisper(0, "locked"); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /Scripts/Archanox's Free Music Script.lsl: -------------------------------------------------------------------------------- 1 | /* 2 | Thanks for grabbing my music player script. I wrote this script primarily because I wasn't happy with most of the other music scripts out there, no offense. This script is a preloading script and has worked much better than most of the other music scripts i have tested against it. Please be aware that this script pauses for 10 seconds before playing, it's a necessary evil though as this makes the song skip much less. Let me know what you think! :) 3 | 4 | -Archanox Underthorn 5 | 6 | 7 | 8 | There are 6 variables that need to be set up in the script : 9 | 10 | --firstsongname and secondsongname-- 11 | These variables refer to filenames, firstsong name is the text that comes before the file number and secondsongname is what comes after it. 12 | For example: 13 | In the filename Gorillaz001.wav, firstsongname is "Gorillaz" and secondsongname is ".wav" 14 | 15 | --curfile-- 16 | This tells the script what filenumber to start on. Most don't need to change this. 17 | 18 | --digits:-- 19 | This tells the script how many digits are in the filenumbers. 20 | For Example: 21 | In the filename Gorillaz001.wav there are 3 digits for the filenumber 22 | 23 | --totalfiles-- 24 | The total number of files, pretty self-explanitory 25 | 26 | --volume-- 27 | The volume to play at, also self-explanitory :) 28 | 29 | __ 30 | */ 31 | 32 | //Archanox's Free Music Script 33 | 34 | //---------------------------------- 35 | //I am freely distributing this script with only three conditions: 36 | //1: Please do not change the name of the script 37 | //2: Please do NOT try to sell this script individually(with music is OK) 38 | //3: If you modify my script(within reason), please distribute it freely as well 39 | // 40 | //Just doing my part to improve SL's music community 41 | //Archanox Underthorn 42 | //----------------------------------- 43 | 44 | string stringnum(integer number, integer digits) 45 | { 46 | string curstring = (string)number; 47 | 48 | while(llStringLength(curstring) < digits) 49 | { 50 | curstring = "0" + curstring; 51 | } 52 | 53 | return curstring; 54 | } 55 | 56 | 57 | default 58 | { 59 | touch_start(integer total_number) 60 | { 61 | 62 | 63 | //---------------------------- 64 | //You only need to setup these 7 variables 65 | 66 | //------------ 67 | //firstsongname is the text that comes before the file number and secondsongname is what comes after it 68 | //put "" if either of them need to be blank 69 | //REMEMBER to include .wav if its there 70 | //i.e.- in Gorillaz001.wav: 71 | //firstsongname is "Gorillaz" - secondsongname is ".wav" 72 | //------------- 73 | string firstsongname = ""; 74 | string secondsongname = " - Nine Inch Nails - Closer.wav"; 75 | 76 | //only change curfile if you want the song to start off on a specific file 77 | integer curfile = 1; 78 | 79 | //digits tells the script how many digit places the file numbering is 80 | //i.e.- Gorillaz001.wav : there are 3 digits 81 | integer digits = 2; 82 | 83 | integer totalfiles = 38; 84 | float volume = 2; 85 | 86 | //--------------------------- 87 | 88 | 89 | llSetSoundQueueing(TRUE); 90 | llPreloadSound(firstsongname + stringnum(1,digits) + secondsongname); 91 | llPreloadSound(firstsongname + stringnum(2,digits) + secondsongname); 92 | llSleep(10); 93 | 94 | integer preloadfile = 3; 95 | 96 | while(curfile <= totalfiles) 97 | { 98 | llPlaySound(firstsongname + stringnum(curfile,digits) + secondsongname, volume); 99 | if(preloadfile <= totalfiles) 100 | { 101 | llPreloadSound(firstsongname + stringnum(preloadfile,digits) + secondsongname); 102 | } 103 | llSleep(9.7); 104 | curfile += 1; 105 | preloadfile += 1; 106 | } 107 | } 108 | 109 | on_rez(integer param) 110 | { 111 | llResetScript(); 112 | } 113 | } -------------------------------------------------------------------------------- /Scripts/Avatar Alert.lsl: -------------------------------------------------------------------------------- 1 | //Avatar Alert Script 2 | 3 | integer switch=0; 4 | key name; 5 | 6 | default 7 | { 8 | state_entry() 9 | { 10 | llWhisper(0,"Alert Script Active"); 11 | name = llGetOwner(); 12 | } 13 | 14 | touch_start(integer total_number) 15 | { 16 | if(switch==0) 17 | { 18 | switch=1; 19 | llSensorRepeat("","",AGENT,90.0,PI,20.0); 20 | llWhisper(0,"Alert on"); 21 | } 22 | else if(switch==1) 23 | { 24 | switch=0; 25 | llSensorRemove(); 26 | llWhisper(0,"Alert off"); 27 | } 28 | } 29 | 30 | sensor(integer total_number) 31 | { 32 | vector pos = llGetPos(); 33 | integer j; 34 | integer count = total_number; 35 | for (j = 0; j < count; j++) 36 | { 37 | if(llDetectedKey(j) != name) 38 | { 39 | float diff = llVecDist(pos,llDetectedPos(j)); 40 | integer dist = llRound(diff); 41 | string result = (llDetectedName(j)) + " " + ((string)dist) + "m"; 42 | llWhisper(0,result); 43 | } 44 | } 45 | } 46 | 47 | no_sensor() 48 | { 49 | llWhisper(0,"Nothing Found"); 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /Scripts/Avatar Animator.lsl: -------------------------------------------------------------------------------- 1 | //Animator 2 | 3 | //integer gToggle = 0; 4 | integer gAnimNumber; 5 | integer gTotalAnims; 6 | integer gTotalAnims2; 7 | integer gInList2; 8 | 9 | string gAnimName = "type"; 10 | 11 | 12 | list gAnimations = [ "aim_R_bazooka", "aim_R_handgun", "aim_R_rifle", "angry_fingerwag", 13 | "angry_tantrum", "away", "backflip", "blowkiss", "bow", "brush", "clap", 14 | "courtbow", "cross_arms", "crouch", "crouchwalk", "curtsy", 15 | "dance1", "dance2", "dance3", "dance4", "dance5", "dance6", "dance7", "dance8", 16 | "dead", "drink", "express_afraid", "express_anger", "express_bored", 17 | "express_cry", "express_embarrased", "express_laugh", "express_repulsed", 18 | "express_sad", "express_shrug", "express_surprise", "express_wink", 19 | "express_worry", "falldown", "female_walk", "fist_pump", "fly", "flyslow", 20 | "hello", "hold_R_bazooka", "hold_R_handgun", "hold_R_rifle", 21 | "hold_throw_R", "hover", "hover_down", "hover_up", "impatient", 22 | "jump", "jumpforjoy", "kick_roundhouse_R", "kissmybutt", "kneel_left", 23 | "kneel_right", "land", "musclebeach", "no_head", "no_unhappy", 24 | "nyanya", "peace", "point_me", "point_you", "prejump", "punch_L", 25 | "punch_onetwo", "punch_R", "RPS_countdown" ]; 26 | 27 | list gAnimations2 = [ "RPS_paper", "RPS_rock", 28 | "RPS_scissors", "run", "salute", "shout", "sit", "sit_ground", "sit_to_stand", 29 | "sleep", "slowwalk", "smoke_idle", "smoke_inhale", "smoke_throw_down", 30 | "snapshot", "soft_land", "stand", "standup", "stand_1", "stand_2", 31 | "stand_3", "stand_4", "stretch", "stride", "surf", "sword_strike_R", 32 | "talk", "throw_R", "tryon_shirt", "turnback_180", "turnleft", "turnright", 33 | "turn_180", "type", "uphillwalk", "walk", "whisper", "whistle", "wink_hollywood", "yell", 34 | "yes_happy", "yes_head", "yoga_float" ]; 35 | 36 | default { 37 | state_entry() { 38 | //llSay(0, "Init..."); 39 | llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); 40 | gTotalAnims = llGetListLength(gAnimations); 41 | gTotalAnims2 = llGetListLength(gAnimations2); 42 | gAnimNumber = -1; 43 | gInList2 = FALSE; 44 | llListen(0, "", llGetOwner(), ""); 45 | } 46 | 47 | on_rez(integer param) { 48 | llGiveInventory(llGetOwner(), "Animation Names"); 49 | llResetScript(); 50 | } 51 | 52 | listen(integer channel, string name, key id, string mesg) { 53 | string preamble = llGetSubString(mesg, 0, 3); 54 | if (preamble != "anim" && preamble != "stop") 55 | return; 56 | 57 | integer perm = llGetPermissions(); 58 | 59 | if ( !(perm & PERMISSION_TRIGGER_ANIMATION)) { 60 | llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); 61 | return; 62 | } 63 | 64 | list parsed = llParseString2List(mesg, [ " " ], []); 65 | //llSay(0, (string)parsed); 66 | 67 | string anim = llList2String(parsed, 1); 68 | 69 | if (preamble == "stop") { 70 | //llSay(0, "Stopping: " + llGetAnimation(llGetOwner())); 71 | //llStopAnimation(llGetAnimation(llGetOwner())); 72 | if (anim == "") 73 | anim = gAnimName; 74 | 75 | if (anim == "all") { 76 | integer i; 77 | llSay(0, "Stoping"); 78 | for (i=0; i, ZERO_VECTOR, FALSE); 6 | } 7 | } -------------------------------------------------------------------------------- /Scripts/Basic Radar.lsl: -------------------------------------------------------------------------------- 1 | // Purpose 2 | // -------------------------------------------------------------- 3 | // This is a basic example of how you can create a simple radar 4 | // to detect Avatars within a given distance around the object 5 | // that this script resides in. Names will be viewed above the 6 | // object along with distance (in meters). 7 | 8 | // Requirements 9 | // -------------------------------------------------------------- 10 | // A single prim is all that is necessary for this example. 11 | 12 | 13 | 14 | // GLOBAL VARIABLES 15 | // -------------------------------------------------------------- 16 | 17 | float g_Range = 96.0; // The range of the sensor in meters 18 | float g_Arc = PI; // The arc of the sensor 19 | float g_Rate = 1.0; // The repeat rate of the sensor in seconds 20 | vector g_TextColor = <1,1,1>; // Text color <1,1,1> = White 21 | 22 | 23 | 24 | // EVENTS 25 | // -------------------------------------------------------------- 26 | 27 | default 28 | { 29 | state_entry() 30 | { 31 | // ------------------------------------------------------ 32 | // This is the entry-point of the script. After a script 33 | // has been saved or reset, this event will fire off first 34 | // ------------------------------------------------------ 35 | 36 | // We call llSetText() first to "clear" the text above the object 37 | // passing an empty string into the text parameter. 38 | llSetText("", g_TextColor, TRUE); 39 | 40 | // We then call the llSensorRepeat() function to start detecting 41 | // avatars. This function will raise the sensor() event handle 42 | // at a rate of g_Rate seconds. 43 | llSensorRepeat("", NULL_KEY, AGENT, g_Range, g_Arc, g_Rate); 44 | 45 | // Since we passed an empty string and key value to the sensor, 46 | // this tells the sensor that we want to look for any name with 47 | // any key as long as it's an AGENT, which is a fancy name for 48 | // Avatar. If we wanted to look for a specific person only, we 49 | // could simply pass their name and/or key into these arguments. 50 | } 51 | 52 | sensor(integer num_detected) 53 | { 54 | // ------------------------------------------------------ 55 | // This event will fire off at the rate of g_Rate in seconds 56 | // after being called by either llSensor() or llSensorRepeat() 57 | // ------------------------------------------------------ 58 | 59 | // First we start out by declaring a local variable "output". This 60 | // variable will store information we want in a string until we 61 | // are ready to display it at the end. 62 | string output; 63 | 64 | // The next variable sets up the for loop 65 | integer x; 66 | 67 | // This next section will loop through each one of the num_detected 68 | // items properly sensed (in this case, it will be AGENTS or Avatars) 69 | // and store the results into the output string. 70 | for(x = 0 ; x < num_detected ; x++) 71 | { 72 | // Using llVecDist(), we can quickly figure out the distance 73 | // between 2 objects in 3D space. To make it more readable, we 74 | // store it as an integer so it truncates any decimal placements 75 | integer distance = (integer)llVecDist(llGetPos(), llDetectedPos(x)); 76 | output += llDetectedName(x) + " (" + (string)distance + "m)\n"; 77 | 78 | // output += llDetectedName(x)... 79 | // is the same as using 80 | // output = output + llDetectedName(x)... 81 | // The "\n" at the end is an escape sequence used for llSetText() 82 | // to declare a new line. 83 | } 84 | 85 | // When we have all the information collected, we can display it 86 | // above the object using llSetText() 87 | llSetText(output, g_TextColor, TRUE); 88 | } 89 | } -------------------------------------------------------------------------------- /Scripts/Blog Feed Script.lsl: -------------------------------------------------------------------------------- 1 | //Blog Feed Script 2 | 3 | default 4 | { 5 | state_entry() 6 | { 7 | llHTTPRequest("http://blog.secondlife.com/feed",[],""); 8 | } 9 | http_response(key id,integer status,list metadat,string body) 10 | { 11 | list a = llParseString2List(body,["description>"],[]); 12 | list b = llParseString2List(llList2String(a,1),[""],[]); 15 | list d = llParseString2List(llList2String(c,1),[""],[]); 19 | list f = llParseString2List(llList2String(e,1),["+0000"],[]); 20 | string Date = llList2String(f,0); 21 | f= []; 22 | list g = llParseString2List(llList2String(c,2),[""],[]); 28 | string Info = llList2String(f,0); 29 | list j = llParseString2List(Info,["#38;"],[]); 30 | if(llGetListLength(j) > 0) 31 | { 32 | Info = ""; 33 | integer i; 34 | for(i = 0;i < llGetListLength(j);i++) 35 | { 36 | Info += llList2String(j,i); 37 | } 38 | } 39 | if(llGetListLength(get) > 0) 40 | { 41 | Title = ""; 42 | integer i; 43 | for(i = 0;i < llGetListLength(get);i++) 44 | { 45 | Title += llList2String(get,i); 46 | } 47 | } 48 | j = llParseString2List(Info,["."],[]); 49 | if(llGetListLength(j) > 0 & llStringLength(Info) > 700) 50 | { 51 | llSay(0,"Second Life Blog"+"\n"+Title+"\n"+Desc+"\n"+Start+"\n"+Date); 52 | integer i; 53 | for(i = 0;i < llGetListLength(j);i++) 54 | { 55 | llSay(0,llList2String(j,i)); 56 | } 57 | } 58 | else 59 | { 60 | llSay(0,"Second Life Blog"+"\n"+Title+"\n"+Desc+"\n"+Start+"\n"+Date+"\n"+Info); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /Scripts/Builders Buddy/Builders' Buddy (Base Script).lsl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Builders' Buddy 1.10 (Base Script) 3 | // by Newfie Pendragon, 2006-2008 4 | /////////////////////////////////////////////////////////////////////////////// 5 | // 6 | // Script Purpose & Use 7 | // Functions are dependent on the "component script" 8 | // 9 | // QUICK USE: 10 | // - Drop this script in the Base. 11 | // - Drop the "Component" Script in each building part. 12 | // - Touch your Base, and choose RECORD 13 | // - Take all building parts into inventory 14 | // - Drag building parts from inventory into Base Prim 15 | // - Touch your base and choose BUILD 16 | // 17 | // OTHER COMMANDS from the Touch menu 18 | // - To reposition, move/rotate Base Prim choose POSITION 19 | // - To lock into position (removes scripts) choose DONE 20 | // - To delete building pieces: choose CLEAN 21 | /////////////////////////////////////////////////////////////////////////////// 22 | // This script is copyrighted material, and has a few (minor) restrictions. 23 | // For complete details, including a revision history, please see 24 | // http://wiki.secondlife.com/wiki/Builders_Buddy 25 | /////////////////////////////////////////////////////////////////////////////// 26 | 27 | // Channel used by Base Prim to talk to Component Prims 28 | // This channel must be the same one in the component script 29 | // A negative channel is used because it elimited accidental activations 30 | // by an Avatar talking on obscure channels 31 | integer DefaultPRIMCHAN = -192567; // Default channel to use 32 | //integer PRIMCHAN = DefaultPRIMCHAN; // Channel used by Base Prim to talk to Component Prims; 33 | integer PRIMCHAN = -192567; // OpenSim Modification - also comment out the previous line for OpenSim 34 | // ***THIS MUST MATCH IN BOTH SCRIPTS!*** 35 | 36 | //The UUID of the creator of the object 37 | //Leave this as "" unless SL displays wrong name in object properties 38 | key creatorUUID = ""; 39 | 40 | // Set to TRUE to allow group members to use the dialog menu 41 | // Set to FALSE to disallow group members from using the dialog menu 42 | integer ingroup = TRUE; 43 | 44 | // Set to TRUE to delete piece from inventory when rezzed 45 | // (WARNING) If set to FALSE, user will be able to rez multiple copies 46 | integer deleteOnRez = FALSE; 47 | 48 | // Allow non-creator to use CLEAN command? 49 | // (WARNING) If set to TRUE, it is recommended to set 50 | // deleteOnRez to FALSE, or user could lose entire building 51 | integer allowClean = TRUE; 52 | 53 | //When user selects CLEAN, delete the base prim too? 54 | integer dieOnClean = FALSE; 55 | 56 | // Set to TRUE to record piece's location based on sim 57 | // coordinates instead of relationship to base prim 58 | integer recordSimLocation = FALSE; 59 | 60 | // Set to TRUE to rez all building pieces before positioning, 61 | // or FALSE to do (slower?) one at a time 62 | integer bulkBuild = TRUE; 63 | 64 | //Set to FALSE if you dont want the script to say anything while 'working' 65 | integer chatty = TRUE; 66 | 67 | //How long to listen for a menu response before shutting down the listener 68 | float fListenTime = 30.0; 69 | 70 | //How often (in seconds) to perform any timed checks 71 | float fTimerRate = 0.25; 72 | 73 | //How long to sit still before exiting active mode 74 | float fStoppedTime = 30.0; 75 | 76 | //SL sometimes blocks rezzing to prevent "gray goo" attacks 77 | //How long we wait (seconds) before we assume SL blocked our rez attempt 78 | integer iRezWait = 10; 79 | 80 | //Specify which Menu Options will be displayed 81 | //FALSE will restrict full options to creator 82 | //TRUE will offer full options to anyone 83 | integer fullOptions = FALSE; 84 | 85 | //Set to TRUE if you want ShapeGen channel support 86 | // (Last 4 digits of channel affected) 87 | integer SGCompatible = FALSE; 88 | 89 | 90 | /////////////////////////////////////////////////////////////////////////////// 91 | //Part of KEYPAD CODE BY Andromeda Quonset....More added below in seevral places 92 | list Menu2 = [ "-", "0","enter","7","8","9","4","5","6","1","2","3"]; 93 | string Input = ""; 94 | string Sign = "+"; 95 | string SignInput = " "; 96 | string Caption = "Enter a number, include any leading 0's: "; 97 | 98 | /////////////////////////////////////////////////////////////////////////////// 99 | // DO NOT EDIT BELOW THIS LINE.... NO.. NOT EVEN THEN 100 | /////////////////////////////////////////////////////////////////////////////// 101 | 102 | //Name each option-these names will be your button names. 103 | string optRecord = "Record"; 104 | string optReset = "Reset"; 105 | string optBuild = "Build"; 106 | string optPos = "Position"; 107 | string optClean = "Clean"; 108 | string optDone = "Done"; 109 | string optChannel = "Channel"; 110 | 111 | //Menu option descriptions 112 | string descRecord = ": Record the position of all parts\n"; 113 | string descReset = ": Forgets the position of all parts\n"; 114 | string descBuild = ": Rez inv. items and position them\n"; 115 | string descPos = ": Reposition the parts to a new location\n"; 116 | string descClean = ": De-Rez all pieces\n"; 117 | string descDone = ": Remove all BB scripts and freeze parts in place.\n"; 118 | string descChannel = ": Change Channel used on base and parts.\n"; 119 | 120 | integer MENU_CHANNEL; 121 | integer MENU2_CHANNEL; 122 | integer MENU_HANDLE; 123 | integer MENU2_HANDLE; 124 | key agent; 125 | key objectowner; 126 | integer group; 127 | string title = ""; 128 | list optionlist = []; 129 | integer bMoving; 130 | vector vLastPos; 131 | rotation rLastRot; 132 | integer bRezzing; 133 | integer iListenTimeout = 0; 134 | integer iLastRez = 0; 135 | integer iRezIndex; 136 | 137 | 138 | InvertSign() 139 | { 140 | if(Sign == "+") 141 | Sign = "-"; 142 | else 143 | Sign = "+"; 144 | } 145 | 146 | //To avoid flooding the sim with a high rate of movements 147 | //(and the resulting mass updates it will bring), we used 148 | // a short throttle to limit ourselves 149 | announce_moved() 150 | { 151 | llRegionSay(PRIMCHAN, "MOVE " + llDumpList2String([ llGetPos(), llGetRot() ], "|")); 152 | llResetTime(); //Reset our throttle 153 | vLastPos = llGetPos(); 154 | rLastRot = llGetRot(); 155 | return; 156 | } 157 | 158 | 159 | rez_object() 160 | { 161 | //Rez the object indicated by iRezIndex 162 | llRezObject(llGetInventoryName(INVENTORY_OBJECT, iRezIndex), llGetPos(), ZERO_VECTOR, llGetRot(), PRIMCHAN); 163 | iLastRez = llGetUnixTime(); 164 | 165 | if(!bRezzing) { 166 | bRezzing = TRUE; 167 | //timer_on(); 168 | } 169 | } 170 | 171 | post_rez_object() 172 | { 173 | if ( creatorUUID != llGetOwner() ) { 174 | if(deleteOnRez) llRemoveInventory(llGetInventoryName(INVENTORY_OBJECT, iRezIndex)); 175 | } 176 | } 177 | 178 | heard(integer channel, string name, key id, string message) 179 | { 180 | if( channel == PRIMCHAN ) { 181 | if( message == "READYTOPOS" ) { 182 | //New prim ready to be positioned 183 | vector vThisPos = llGetPos(); 184 | rotation rThisRot = llGetRot(); 185 | llRegionSay(PRIMCHAN, "MOVESINGLE " + llDumpList2String([ vThisPos, rThisRot ], "|")); 186 | 187 | } else if( message == "ATDEST" ) { 188 | //Rez the next in the sequence (if any) 189 | iRezIndex--; 190 | if(iRezIndex >= 0) { 191 | //Attempt to rez it 192 | rez_object(); 193 | } else { 194 | //We are done building, reset our listeners 195 | iLastRez = 0; 196 | bRezzing = FALSE; 197 | state reset_listeners; 198 | } 199 | } 200 | return; 201 | 202 | } else if( channel == MENU_CHANNEL ) { //Process input from original menu 203 | if ( message == optRecord ) { 204 | PRIMCHAN = DefaultPRIMCHAN; 205 | llOwnerSay("Recording positions..."); 206 | if(recordSimLocation) { 207 | //Location in sim 208 | llRegionSay(PRIMCHAN, "RECORDABS " + llDumpList2String([ llGetPos(), llGetRot() ], "|")); 209 | } else { 210 | //Location relative to base 211 | llRegionSay(PRIMCHAN, "RECORD " + llDumpList2String([ llGetPos(), llGetRot() ], "|")); 212 | } 213 | return; 214 | } 215 | if( message == optReset ) { 216 | llOwnerSay("Forgetting positions..."); 217 | llShout(PRIMCHAN, "RESET"); 218 | return; 219 | } 220 | if ( message == optBuild ) { 221 | if(chatty) llOwnerSay("Rezzing build pieces..."); 222 | 223 | //If rezzing/positioning one at a time, we need 224 | // to listen for when they've reached their dest 225 | if(!bulkBuild) { 226 | llListen(PRIMCHAN, "", NULL_KEY, "READYTOPOS"); 227 | llListen(PRIMCHAN, "", NULL_KEY, "ATDEST"); 228 | } 229 | 230 | //Start rezzing, last piece first 231 | iRezIndex = llGetInventoryNumber(INVENTORY_OBJECT) - 1; 232 | rez_object(); 233 | return; 234 | } 235 | if ( message == optPos ) { 236 | if(chatty) llOwnerSay("Positioning"); 237 | vector vThisPos = llGetPos(); 238 | rotation rThisRot = llGetRot(); 239 | llRegionSay(PRIMCHAN, "MOVE " + llDumpList2String([ vThisPos, rThisRot ], "|")); 240 | return; 241 | } 242 | if ( message == optClean ) { 243 | llRegionSay(PRIMCHAN, "CLEAN"); 244 | if(dieOnClean) llDie(); 245 | return; 246 | } 247 | if ( message == optDone ) { 248 | llRegionSay(PRIMCHAN, "DONE"); 249 | if(chatty) llOwnerSay("Removing Builder's Buddy scripts."); 250 | return; 251 | } 252 | if ( message == optChannel ) { 253 | Sign = "+"; //default is a positive number 254 | Input = ""; 255 | llDialog( agent, Caption, Menu2, MENU2_CHANNEL ); 256 | } 257 | 258 | } else if ( channel == MENU2_CHANNEL ) { //process input from MENU2 259 | // if a valid choice was made, implement that choice if possible. 260 | // (llListFindList returns -1 if Choice is not in the menu list.) 261 | if ( llListFindList( Menu2, [ message ]) != -1 ) { 262 | if( llListFindList(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], [message]) != -1) { 263 | Input += message; 264 | SignInput = Sign + Input; 265 | llDialog( agent, Caption + SignInput, Menu2, MENU2_CHANNEL ); 266 | 267 | } else if( message == "-" ) { 268 | InvertSign(); 269 | SignInput = Sign + Input; 270 | llDialog( agent, Caption + SignInput, Menu2, MENU2_CHANNEL ); 271 | 272 | } else if( message == "enter" ) { //terminate input from menu2 273 | string CalcChan = Input; 274 | 275 | //Apply ShapeGen compatibility? 276 | if(SGCompatible) { 277 | //new assign channel number, forcing last 4 digits to 0000 278 | integer ChanSize = llStringLength(Input); //determine number of digits (chars) 279 | if(ChanSize > 5) { 280 | CalcChan = llGetSubString(Input, 0, 4); //Shorten to 5 digits 281 | } 282 | CalcChan += "0000"; //append 0000 283 | if(Sign == "-") 284 | CalcChan = Sign + CalcChan; 285 | } 286 | PRIMCHAN = (integer)CalcChan; //assign channel number 287 | llOwnerSay("Channel set to " + (string)PRIMCHAN + "."); 288 | } 289 | 290 | } else { 291 | llDialog( agent, Caption, Menu2, MENU2_CHANNEL ); 292 | } 293 | } 294 | } 295 | 296 | 297 | /////////////////////////////////////////////////////////////////////////////// 298 | /////////////////////////////////////////////////////////////////////////////// 299 | /////////////////////////////////////////////////////////////////////////////// 300 | default { 301 | /////////////////////////////////////////////////////////////////////////////// 302 | changed(integer change) { 303 | if(change & CHANGED_OWNER) 304 | llResetScript(); 305 | } 306 | 307 | /////////////////////////////////////////////////////////////////////////////// 308 | state_entry () { 309 | //Determine the creator UUID 310 | if(creatorUUID == "") creatorUUID = llGetCreator(); 311 | 312 | //Use which menu? 313 | if (creatorUUID == llGetOwner() || fullOptions) { 314 | //Display all options 315 | optionlist = [optPos, optClean, optDone, optRecord, optReset, optBuild, optChannel]; 316 | title = optRecord + descRecord; 317 | title += optReset + descReset; 318 | title += optBuild + descBuild; 319 | title += optPos + descPos; 320 | title += optClean + descClean; 321 | title += optDone + descDone; 322 | title += optChannel + descChannel; 323 | 324 | } else { 325 | //Display limited options 326 | if(allowClean) { 327 | optionlist = [optBuild, optPos, optClean, optDone]; 328 | title = optBuild + descBuild; 329 | title += optPos + descPos; 330 | title += optClean + descClean; 331 | title += optDone + descDone; 332 | } else { 333 | optionlist = [optBuild, optPos, optDone]; 334 | title = optBuild + descBuild; 335 | title += optPos + descPos; 336 | title += optDone + descDone; 337 | } 338 | } 339 | 340 | //Record our position 341 | vLastPos = llGetPos(); 342 | rLastRot = llGetRot(); 343 | 344 | llSetTimerEvent(fTimerRate); 345 | } 346 | 347 | /////////////////////////////////////////////////////////////////////////////// 348 | touch_start (integer total_number) { 349 | group = llDetectedGroup(0); // Is the Agent in the objowners group? 350 | agent = llDetectedKey(0); // Agent's key 351 | objectowner = llGetOwner(); // objowners key 352 | // is the Agent = the owner OR is the agent in the owners group 353 | if ( (objectowner == agent) || ( group && ingroup ) ) { 354 | iListenTimeout = llGetUnixTime() + llFloor(fListenTime); 355 | MENU_CHANNEL = llFloor(llFrand(-99999.0 - -100)); 356 | MENU2_CHANNEL = MENU_CHANNEL + 1; 357 | MENU_HANDLE = llListen(MENU_CHANNEL,"","",""); 358 | MENU2_HANDLE = llListen(MENU2_CHANNEL,"","",""); 359 | if ( creatorUUID == llGetOwner() || fullOptions) { 360 | llDialog(agent,title + "Now on Channel " + (string)PRIMCHAN, optionlist, MENU_CHANNEL); //display channel number if authorized 361 | } else { 362 | llDialog(agent, title, optionlist, MENU_CHANNEL); 363 | } 364 | //timer_on(); 365 | } 366 | } 367 | 368 | /////////////////////////////////////////////////////////////////////////////// 369 | listen(integer channel, string name, key id, string message) { 370 | heard(channel, name, id, message); 371 | return; 372 | } 373 | 374 | /////////////////////////////////////////////////////////////////////////////// 375 | moving_start() 376 | { 377 | if( !bMoving ) 378 | { 379 | bMoving = TRUE; 380 | //timer_on(); 381 | announce_moved(); 382 | } 383 | } 384 | 385 | /////////////////////////////////////////////////////////////////////////////// 386 | object_rez(key id) { 387 | //The object rezzed, perform any post-rez processing 388 | post_rez_object(); 389 | 390 | //Rezzing it all before moving? 391 | if(bulkBuild) { 392 | //Move on to the next object 393 | //Loop through backwards (safety precaution in case of inventory change) 394 | iRezIndex--; 395 | if(iRezIndex >= 0) { 396 | //Attempt to rez it 397 | rez_object(); 398 | 399 | } else { 400 | //Rezzing complete, now positioning 401 | iLastRez = 0; 402 | bRezzing = FALSE; 403 | if(chatty) llOwnerSay("Positioning"); 404 | llRegionSay(PRIMCHAN, "MOVE " + llDumpList2String([ llGetPos(), llGetRot() ], "|")); 405 | } 406 | } 407 | } 408 | 409 | /////////////////////////////////////////////////////////////////////////////// 410 | timer() { 411 | //Did we change position/rotation? 412 | if( (llGetRot() != rLastRot) || (llGetPos() != vLastPos) ) 413 | { 414 | if( llGetTime() > fTimerRate ) { 415 | announce_moved(); 416 | } 417 | } 418 | 419 | //Are we rezzing? 420 | if(bRezzing) { 421 | //Did the last one take too long? 422 | if((llGetUnixTime() - iLastRez) >= iRezWait) { 423 | //Yes, retry it 424 | if(chatty) llOwnerSay("Reattempting rez of most recent piece"); 425 | rez_object(); 426 | } 427 | } 428 | 429 | //Open listener? 430 | if( iListenTimeout != 0 ) 431 | { 432 | //Past our close timeout? 433 | if( iListenTimeout <= llGetUnixTime() ) 434 | { 435 | iListenTimeout = 0; 436 | llListenRemove(MENU_HANDLE); 437 | } 438 | } 439 | } 440 | 441 | /////////////////////////////////////////////////////////////////////////////// 442 | on_rez(integer iStart) 443 | { 444 | //Reset ourselves 445 | llResetScript(); 446 | } 447 | } 448 | 449 | 450 | ////////////////////////////////////////////////////////////////////////////////////////// 451 | ////////////////////////////////////////////////////////////////////////////////////////// 452 | ////////////////////////////////////////////////////////////////////////////////////////// 453 | state reset_listeners 454 | { 455 | ////////////////////////////////////////////////////////////////////////////////////////// 456 | state_entry() 457 | { 458 | state default; 459 | } 460 | } -------------------------------------------------------------------------------- /Scripts/Builders Buddy/Builders' Buddy 1.10 (Component Script) OpenSim.lsl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Builders' Buddy 1.10 (Component Script) 3 | // by Newfie Pendragon, 2006-2008 4 | /////////////////////////////////////////////////////////////////////////////// 5 | // 6 | // Script Purpose & Use 7 | // Functions are dependent on the "component script" 8 | // 9 | // QUICK USE: 10 | // - Drop this script in the Base. 11 | // - Drop the "Component" Script in each building part. 12 | // - Touch your Base, and choose RECORD 13 | // - Take all building parts into inventory 14 | // - Drag building parts from inventory into Base Prim 15 | // - Touch your base and choose BUILD 16 | // 17 | // OTHER COMMANDS from the Touch menu 18 | // - To reposition, move/rotate Base Prim choose POSITION 19 | // - To lock into position (removes scripts) choose DONE 20 | // - To delete building pieces: choose CLEAN 21 | /////////////////////////////////////////////////////////////////////////////// 22 | // This script is copyrighted material, and has a few (minor) restrictions. 23 | // For complete details, including a revision history, please see 24 | // http://wiki.secondlife.com/wiki/Builders_Buddy 25 | /////////////////////////////////////////////////////////////////////////////// 26 | 27 | 28 | ////////////////////////////////////////////////////////////////////////////////////////// 29 | // Configurable Settings 30 | float fTimerInterval = 0.25; // Time in seconds between movement 'ticks' 31 | integer DefaultChannel = -192567; // Andromeda Quonset's default channel 32 | //integer PRIMCHAN = DefaultChannel; // Channel used by Base Prim to talk to Component Prims; 33 | integer PRIMCHAN = -192567; // OpenSim Modification - also comment out the previous line for OpenSim 34 | // ***THIS MUST MATCH IN BOTH SCRIPTS!*** 35 | 36 | ////////////////////////////////////////////////////////////////////////////////////////// 37 | // Runtime Variables (Dont need to change below here unless making a derivative) 38 | vector vOffset; 39 | rotation rRotation; 40 | integer bNeedMove; 41 | vector vDestPos; 42 | rotation rDestRot; 43 | integer bMovingSingle = FALSE; 44 | integer bAbsolute = FALSE; 45 | integer bRecorded = FALSE; 46 | 47 | 48 | //////////////////////////////////////////////////////////////////////////////// 49 | string first_word(string In_String, string Token) 50 | { 51 | //This routine searches for the first word in a string, 52 | // and returns it. If no word boundary found, returns 53 | // the whole string. 54 | if(Token == "") Token = " "; 55 | integer pos = llSubStringIndex(In_String, Token); 56 | 57 | //Found it? 58 | if( pos >= 1 ) 59 | return llGetSubString(In_String, 0, pos - 1); 60 | else 61 | return In_String; 62 | } 63 | 64 | //////////////////////////////////////////////////////////////////////////////// 65 | string other_words(string In_String, string Token) 66 | { 67 | //This routine searches for the other-than-first words in a string, 68 | // and returns it. If no word boundary found, returns 69 | // an empty string. 70 | if( Token == "" ) Token = " "; 71 | 72 | integer pos = llSubStringIndex(In_String, Token); 73 | 74 | //Found it? 75 | if( pos >= 1 ) 76 | return llGetSubString(In_String, pos + 1, llStringLength(In_String)); 77 | else 78 | return ""; 79 | } 80 | 81 | //////////////////////////////////////////////////////////////////////////////// 82 | do_move() 83 | { 84 | integer i = 0; 85 | vector vLastPos = ZERO_VECTOR; 86 | while( (i < 5) && (llGetPos() != vDestPos) ) 87 | { 88 | list lParams = []; 89 | 90 | //If we're not there.... 91 | if( llGetPos() != vDestPos ) 92 | { 93 | //We may be stuck on the ground... 94 | //Did we move at all compared to last loop? 95 | if( llGetPos() == vLastPos ) 96 | { 97 | //Yep, stuck...move straight up 10m (attempt to dislodge) 98 | lParams = [ PRIM_POSITION, llGetPos() + <0, 0, 10.0> ]; 99 | //llSetPos(llGetPos() + <0, 0, 10.0>); 100 | } else { 101 | //Record our spot for 'stuck' detection 102 | vLastPos = llGetPos(); 103 | } 104 | } 105 | 106 | //Try to move to destination 107 | //Upgraded to attempt to use the llSetPrimitiveParams fast-move hack 108 | //(Newfie, June 2006) 109 | integer iHops = llAbs(llCeil(llVecDist(llGetPos(), vDestPos) / 10.0)); 110 | integer x; 111 | for( x = 0; x < iHops; x++ ) { 112 | lParams += [ PRIM_POSITION, vDestPos ]; 113 | } 114 | llSetPrimitiveParams(lParams); 115 | //llSleep(0.1); 116 | i++; 117 | } 118 | 119 | //Set rotation 120 | llSetRot(rDestRot); 121 | } 122 | 123 | start_move(string sText, key kID) 124 | { 125 | //Don't move if we've not yet recorded a position 126 | if( !bRecorded ) return; 127 | 128 | //Also ignore commands from bases with a different owner than us 129 | //(Anti-hacking measure) 130 | if( llGetOwner() != llGetOwnerKey(kID) ) return; 131 | 132 | 133 | //Calculate our destination position relative to base? 134 | if(!bAbsolute) { 135 | //Relative position 136 | //Calculate our destination position 137 | sText = other_words(sText, " "); 138 | list lParams = llParseString2List(sText, [ "|" ], []); 139 | vector vBase = (vector)llList2String(lParams, 0); 140 | rotation rBase = (rotation)llList2String(lParams, 1); 141 | 142 | vDestPos = (vOffset * rBase) + vBase; 143 | rDestRot = rRotation * rBase; 144 | } else { 145 | //Sim position 146 | vDestPos = vOffset; 147 | rDestRot = rRotation; 148 | } 149 | 150 | //Make sure our calculated position is within the sim 151 | if(vDestPos.x < 0.0) vDestPos.x = 0.0; 152 | if(vDestPos.x > 255.0) vDestPos.x = 255.0; 153 | if(vDestPos.y < 0.0) vDestPos.y = 0.0; 154 | if(vDestPos.y > 255.0) vDestPos.y = 255.0; 155 | if(vDestPos.x > 768.0) vDestPos.x = 768.0; 156 | 157 | //Turn on our timer to perform the move? 158 | if( !bNeedMove ) 159 | { 160 | llSetTimerEvent(fTimerInterval); 161 | bNeedMove = TRUE; 162 | } 163 | return; 164 | } 165 | 166 | ////////////////////////////////////////////////////////////////////////////////////////// 167 | ////////////////////////////////////////////////////////////////////////////////////////// 168 | ////////////////////////////////////////////////////////////////////////////////////////// 169 | default 170 | { 171 | ////////////////////////////////////////////////////////////////////////////////////////// 172 | state_entry() 173 | { 174 | //Open up the listener 175 | llListen(PRIMCHAN, "", NULL_KEY, ""); 176 | llRegionSay(PRIMCHAN, "READYTOPOS"); 177 | } 178 | 179 | ////////////////////////////////////////////////////////////////////////////////////////// 180 | on_rez(integer iStart) 181 | { 182 | //Set the channel to what's specified 183 | if( iStart != 0 ) 184 | { 185 | PRIMCHAN = iStart; 186 | state reset_listeners; 187 | } 188 | } 189 | 190 | ////////////////////////////////////////////////////////////////////////////////////////// 191 | listen(integer iChan, string sName, key kID, string sText) 192 | { 193 | string sCmd = llToUpper(first_word(sText, " ")); 194 | 195 | if( sCmd == "RECORD" ) 196 | { 197 | //Record position relative to base prim 198 | sText = other_words(sText, " "); 199 | list lParams = llParseString2List(sText, [ "|" ], []); 200 | vector vBase = (vector)llList2String(lParams, 0); 201 | rotation rBase = (rotation)llList2String(lParams, 1); 202 | 203 | vOffset = (llGetPos() - vBase) / rBase; 204 | rRotation = llGetRot() / rBase; 205 | bAbsolute = FALSE; 206 | bRecorded = TRUE; 207 | llOwnerSay("Recorded position."); 208 | return; 209 | } 210 | 211 | if( sCmd == "RECORDABS" ) 212 | { 213 | //Record absolute position 214 | rRotation = llGetRot(); 215 | vOffset = llGetPos(); 216 | bAbsolute = TRUE; 217 | bRecorded = TRUE; 218 | llOwnerSay("Recorded sim position."); 219 | return; 220 | } 221 | 222 | ////////////////////////////////////////////////////////////////////////////////////////// 223 | if( sCmd == "MOVE" ) 224 | { 225 | start_move(sText, kID); 226 | return; 227 | } 228 | 229 | if( sCmd == "MOVESINGLE" ) 230 | { 231 | //If we haven't gotten this before, position ourselves 232 | if(!bMovingSingle) { 233 | //Record that we are a single-prim move 234 | bMovingSingle = TRUE; 235 | 236 | //Now move it 237 | start_move(sText, kID); 238 | return; 239 | } 240 | } 241 | 242 | ////////////////////////////////////////////////////////////////////////////////////////// 243 | if( sCmd == "DONE" ) 244 | { 245 | //We are done, remove script 246 | llRemoveInventory(llGetScriptName()); 247 | return; 248 | } 249 | 250 | ////////////////////////////////////////////////////////////////////////////////////////// 251 | if( sCmd == "CLEAN" ) 252 | { 253 | //Clean up 254 | llDie(); 255 | return; 256 | } 257 | 258 | ////////////////////////////////////////////////////////////////////////////////////////// 259 | if( sCmd == "RESET" ) 260 | { 261 | llResetScript(); 262 | } 263 | } 264 | 265 | ////////////////////////////////////////////////////////////////////////////////////////// 266 | timer() 267 | { 268 | //Turn ourselves off 269 | llSetTimerEvent(0.0); 270 | 271 | //Do we need to move? 272 | if( bNeedMove ) 273 | { 274 | //Perform the move and clean up 275 | do_move(); 276 | 277 | //If single-prim move, announce to base we're done 278 | if(bMovingSingle) { 279 | llRegionSay(PRIMCHAN, "ATDEST"); 280 | } 281 | 282 | //Done moving 283 | bNeedMove = FALSE; 284 | } 285 | return; 286 | } 287 | } 288 | 289 | 290 | ////////////////////////////////////////////////////////////////////////////////////////// 291 | ////////////////////////////////////////////////////////////////////////////////////////// 292 | ////////////////////////////////////////////////////////////////////////////////////////// 293 | state reset_listeners 294 | { 295 | ////////////////////////////////////////////////////////////////////////////////////////// 296 | state_entry() 297 | { 298 | state default; 299 | } 300 | } -------------------------------------------------------------------------------- /Scripts/Builders Buddy/Builders' Buddy 1.10 (Component Script) SecondLife.lsl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Builders' Buddy 1.10 (Component Script) 3 | // by Newfie Pendragon, 2006-2008 4 | /////////////////////////////////////////////////////////////////////////////// 5 | // 6 | // Script Purpose & Use 7 | // Functions are dependent on the "component script" 8 | // 9 | // QUICK USE: 10 | // - Drop this script in the Base. 11 | // - Drop the "Component" Script in each building part. 12 | // - Touch your Base, and choose RECORD 13 | // - Take all building parts into inventory 14 | // - Drag building parts from inventory into Base Prim 15 | // - Touch your base and choose BUILD 16 | // 17 | // OTHER COMMANDS from the Touch menu 18 | // - To reposition, move/rotate Base Prim choose POSITION 19 | // - To lock into position (removes scripts) choose DONE 20 | // - To delete building pieces: choose CLEAN 21 | /////////////////////////////////////////////////////////////////////////////// 22 | // This script is copyrighted material, and has a few (minor) restrictions. 23 | // For complete details, including a revision history, please see 24 | // http://wiki.secondlife.com/wiki/Builders_Buddy 25 | /////////////////////////////////////////////////////////////////////////////// 26 | 27 | 28 | ////////////////////////////////////////////////////////////////////////////////////////// 29 | // Configurable Settings 30 | float fTimerInterval = 0.25; // Time in seconds between movement 'ticks' 31 | integer DefaultChannel = -192567; // Andromeda Quonset's default channel 32 | //integer PRIMCHAN = DefaultChannel; // Channel used by Base Prim to talk to Component Prims; 33 | integer PRIMCHAN = -192567; // OpenSim Modification - also comment out the previous line for OpenSim 34 | // ***THIS MUST MATCH IN BOTH SCRIPTS!*** 35 | 36 | ////////////////////////////////////////////////////////////////////////////////////////// 37 | // Runtime Variables (Dont need to change below here unless making a derivative) 38 | vector vOffset; 39 | rotation rRotation; 40 | integer bNeedMove; 41 | vector vDestPos; 42 | rotation rDestRot; 43 | integer bMovingSingle = FALSE; 44 | integer bAbsolute = FALSE; 45 | integer bRecorded = FALSE; 46 | 47 | 48 | //////////////////////////////////////////////////////////////////////////////// 49 | string first_word(string In_String, string Token) 50 | { 51 | //This routine searches for the first word in a string, 52 | // and returns it. If no word boundary found, returns 53 | // the whole string. 54 | if(Token == "") Token = " "; 55 | integer pos = llSubStringIndex(In_String, Token); 56 | 57 | //Found it? 58 | if( pos >= 1 ) 59 | return llGetSubString(In_String, 0, pos - 1); 60 | else 61 | return In_String; 62 | } 63 | 64 | //////////////////////////////////////////////////////////////////////////////// 65 | string other_words(string In_String, string Token) 66 | { 67 | //This routine searches for the other-than-first words in a string, 68 | // and returns it. If no word boundary found, returns 69 | // an empty string. 70 | if( Token == "" ) Token = " "; 71 | 72 | integer pos = llSubStringIndex(In_String, Token); 73 | 74 | //Found it? 75 | if( pos >= 1 ) 76 | return llGetSubString(In_String, pos + 1, llStringLength(In_String)); 77 | else 78 | return ""; 79 | } 80 | 81 | //////////////////////////////////////////////////////////////////////////////// 82 | do_move() 83 | { 84 | integer i = 0; 85 | vector vLastPos = ZERO_VECTOR; 86 | while( (i < 5) && (llGetPos() != vDestPos) ) 87 | { 88 | list lParams = []; 89 | 90 | //If we're not there.... 91 | if( llGetPos() != vDestPos ) 92 | { 93 | //We may be stuck on the ground... 94 | //Did we move at all compared to last loop? 95 | if( llGetPos() == vLastPos ) 96 | { 97 | //Yep, stuck...move straight up 10m (attempt to dislodge) 98 | lParams = [ PRIM_POSITION, llGetPos() + <0, 0, 10.0> ]; 99 | //llSetPos(llGetPos() + <0, 0, 10.0>); 100 | } else { 101 | //Record our spot for 'stuck' detection 102 | vLastPos = llGetPos(); 103 | } 104 | } 105 | 106 | //Try to move to destination 107 | //Upgraded to attempt to use the llSetPrimitiveParams fast-move hack 108 | //(Newfie, June 2006) 109 | integer iHops = llAbs(llCeil(llVecDist(llGetPos(), vDestPos) / 10.0)); 110 | integer x; 111 | for( x = 0; x < iHops; x++ ) { 112 | lParams += [ PRIM_POSITION, vDestPos ]; 113 | } 114 | llSetPrimitiveParams(lParams); 115 | //llSleep(0.1); 116 | i++; 117 | } 118 | 119 | //Set rotation 120 | llSetRot(rDestRot); 121 | } 122 | 123 | start_move(string sText, key kID) 124 | { 125 | //Don't move if we've not yet recorded a position 126 | if( !bRecorded ) return; 127 | 128 | //Also ignore commands from bases with a different owner than us 129 | //(Anti-hacking measure) 130 | if( llGetOwner() != llGetOwnerKey(kID) ) return; 131 | 132 | 133 | //Calculate our destination position relative to base? 134 | if(!bAbsolute) { 135 | //Relative position 136 | //Calculate our destination position 137 | sText = other_words(sText, " "); 138 | list lParams = llParseString2List(sText, [ "|" ], []); 139 | vector vBase = (vector)llList2String(lParams, 0); 140 | rotation rBase = (rotation)llList2String(lParams, 1); 141 | 142 | vDestPos = (vOffset * rBase) + vBase; 143 | rDestRot = rRotation * rBase; 144 | } else { 145 | //Sim position 146 | vDestPos = vOffset; 147 | rDestRot = rRotation; 148 | } 149 | 150 | //Make sure our calculated position is within the sim 151 | if(vDestPos.x < 0.0) vDestPos.x = 0.0; 152 | if(vDestPos.x > 255.0) vDestPos.x = 255.0; 153 | if(vDestPos.y < 0.0) vDestPos.y = 0.0; 154 | if(vDestPos.y > 255.0) vDestPos.y = 255.0; 155 | if(vDestPos.x > 768.0) vDestPos.x = 768.0; 156 | 157 | //Turn on our timer to perform the move? 158 | if( !bNeedMove ) 159 | { 160 | llSetTimerEvent(fTimerInterval); 161 | bNeedMove = TRUE; 162 | } 163 | return; 164 | } 165 | 166 | ////////////////////////////////////////////////////////////////////////////////////////// 167 | ////////////////////////////////////////////////////////////////////////////////////////// 168 | ////////////////////////////////////////////////////////////////////////////////////////// 169 | default 170 | { 171 | ////////////////////////////////////////////////////////////////////////////////////////// 172 | state_entry() 173 | { 174 | //Open up the listener 175 | llListen(PRIMCHAN, "", NULL_KEY, ""); 176 | llRegionSay(PRIMCHAN, "READYTOPOS"); 177 | } 178 | 179 | ////////////////////////////////////////////////////////////////////////////////////////// 180 | on_rez(integer iStart) 181 | { 182 | //Set the channel to what's specified 183 | if( iStart != 0 ) 184 | { 185 | PRIMCHAN = iStart; 186 | state reset_listeners; 187 | } 188 | } 189 | 190 | ////////////////////////////////////////////////////////////////////////////////////////// 191 | listen(integer iChan, string sName, key kID, string sText) 192 | { 193 | string sCmd = llToUpper(first_word(sText, " ")); 194 | 195 | if( sCmd == "RECORD" ) 196 | { 197 | //Record position relative to base prim 198 | sText = other_words(sText, " "); 199 | list lParams = llParseString2List(sText, [ "|" ], []); 200 | vector vBase = (vector)llList2String(lParams, 0); 201 | rotation rBase = (rotation)llList2String(lParams, 1); 202 | 203 | vOffset = (llGetPos() - vBase) / rBase; 204 | rRotation = llGetRot() / rBase; 205 | bAbsolute = FALSE; 206 | bRecorded = TRUE; 207 | llOwnerSay("Recorded position."); 208 | return; 209 | } 210 | 211 | if( sCmd == "RECORDABS" ) 212 | { 213 | //Record absolute position 214 | rRotation = llGetRot(); 215 | vOffset = llGetPos(); 216 | bAbsolute = TRUE; 217 | bRecorded = TRUE; 218 | llOwnerSay("Recorded sim position."); 219 | return; 220 | } 221 | 222 | ////////////////////////////////////////////////////////////////////////////////////////// 223 | if( sCmd == "MOVE" ) 224 | { 225 | start_move(sText, kID); 226 | return; 227 | } 228 | 229 | if( sCmd == "MOVESINGLE" ) 230 | { 231 | //If we haven't gotten this before, position ourselves 232 | if(!bMovingSingle) { 233 | //Record that we are a single-prim move 234 | bMovingSingle = TRUE; 235 | 236 | //Now move it 237 | start_move(sText, kID); 238 | return; 239 | } 240 | } 241 | 242 | ////////////////////////////////////////////////////////////////////////////////////////// 243 | if( sCmd == "DONE" ) 244 | { 245 | //We are done, remove script 246 | llRemoveInventory(llGetScriptName()); 247 | return; 248 | } 249 | 250 | ////////////////////////////////////////////////////////////////////////////////////////// 251 | if( sCmd == "CLEAN" ) 252 | { 253 | //Clean up 254 | llDie(); 255 | return; 256 | } 257 | 258 | ////////////////////////////////////////////////////////////////////////////////////////// 259 | if( sCmd == "RESET" ) 260 | { 261 | llResetScript(); 262 | } 263 | } 264 | 265 | ////////////////////////////////////////////////////////////////////////////////////////// 266 | timer() 267 | { 268 | //Turn ourselves off 269 | llSetTimerEvent(0.0); 270 | 271 | //Do we need to move? 272 | if( bNeedMove ) 273 | { 274 | //Perform the move and clean up 275 | do_move(); 276 | 277 | //If single-prim move, announce to base we're done 278 | if(bMovingSingle) { 279 | llRegionSay(PRIMCHAN, "ATDEST"); 280 | } 281 | 282 | //Done moving 283 | bNeedMove = FALSE; 284 | } 285 | return; 286 | } 287 | } 288 | 289 | 290 | ////////////////////////////////////////////////////////////////////////////////////////// 291 | ////////////////////////////////////////////////////////////////////////////////////////// 292 | ////////////////////////////////////////////////////////////////////////////////////////// 293 | state reset_listeners 294 | { 295 | ////////////////////////////////////////////////////////////////////////////////////////// 296 | state_entry() 297 | { 298 | state default; 299 | } 300 | } -------------------------------------------------------------------------------- /Scripts/Builders Buddy/README.md: -------------------------------------------------------------------------------- 1 | Information from http://forums.osgrid.org/viewtopic.php?f=5&t=1364 2 | 3 | 01. PRODUCT SUMMARY 4 | 5 | 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. 6 | 7 | You prepare the unlinked items according to the easy steps below, then for distribution put them in a Packing Box. 8 | 9 | 05. USAGE SUMMARY 10 | 11 | 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. 12 | 13 | 1. Drop the base script in the Base. 14 | 2. Drop the "Component" Script in each building part. 15 | 3. Touch your Base, and choose RECORD 16 | 4. Take all building parts into inventory except for the base prim 17 | 5. Drag building parts from inventory into Base Prim 18 | 6. Touch your base and choose BUILD 19 | 20 | OTHER COMMANDS from the Touch menu 21 | 22 | To reposition, move or rotate the Base Prim choose POSITION 23 | 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; 24 | To lock into position (removes all scripts, helping to reduce work on the sim server) choose DONE 25 | To delete building pieces: choose CLEAN 26 | 27 | 28 | Alan Webb contributed a patch that enables script state persistence when taking objects into inventory, when saving OpenSim Archives (OARs) and when using attachments (r9265). -------------------------------------------------------------------------------- /Scripts/Button Script for Action on Touch - No Prim Buttons/Button Script for Action on Touch - No Prim Buttons.lsl: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Touch UV Made Easy Script 4 | // Created By: Joshewa Daniels 5 | // Join Group: College Of Scripting 6 | // Show Your Appreciation Make A Donation. 7 | // Description: 8 | // This script will allow you to create a multiple button 9 | // positions on a prims, will help to reduce prim counts 10 | // and reduce the need for multiple scripts to do what one can 11 | // Will allow you to make more dynamic creation that reduce lag 12 | // Setup Instructions: 13 | // •Step 1• Set The Vector Sender To TRUE to say the vector. 14 | // •Step 2• For each button you setup you need to get the vector 15 | // For the top Left Corner and also the bottom Right 16 | // this is done by just clicking on the prim to have it say 17 | // the vector position of the part you touched. 18 | // •Step 3• Paste the vector for each position by replacing 19 | // the ones setup for the example. 20 | 21 | // into your script for your button positions 22 | //_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 23 | //_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 24 | // Vector Sender Will Tell You The Vector Position On Touch 25 | // TRUE = On, FALSE = Off 26 | integer Vector_Sender = FALSE;// Set To TRUE To Say Vector 27 | // integer Vector_Sender = TRUE;// Set To TRUE To Say Vector 28 | //_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 29 | // Button Setup Below Change Vector For Your Buttons 30 | //_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 31 | // 32 | // Start of Row 1 33 | // 34 | // Button 1 •••••••••••••••••••••••••••••••••••••••••••••••• 35 | vector BV_1_TL = <0.01907, 0.80846, 0.00000>;// Top Left 36 | vector BV_1_BR = <0.67159, 0.65658, 0.00000>;// Bottom Right 37 | // Button 2 •••••••••••••••••••••••••••••••••••••••••••••••• 38 | vector BV_2_TL = <0.00348, 0.61155, 0.00000>;// Top Left 39 | vector BV_2_BR = <0.66824, 0.47629, 0.00000>;// Bottom Right 40 | // Button 3 •••••••••••••••••••••••••••••••••••••••••••••••• 41 | vector BV_3_TL = <0.00667, 0.43364, 0.00000>;// Top Left 42 | vector BV_3_BR = <0.66870, 0.29234, 0.00000>;// Bottom Right 43 | // Button 4 •••••••••••••••••••••••••••••••••••••••••••••••• 44 | vector BV_4_TL = <0.00764, 0.25534, 0.00000>;// Top Left 45 | vector BV_4_BR = <0.65918, 0.06151, 0.00000>;// Bottom Right 46 | // 47 | // End of Row 1 48 | // 49 | // Start of Row 2 50 | // 51 | // Button 5 •••••••••••••••••••••••••••••••••••••••••••••••• 52 | vector BV_5_TL = <0.76224, 0.71665, 0.00000>;// Top Left 53 | vector BV_5_BR = <0.97554, 0.58480, 0.00000>;// Bottom Right 54 | // Button 6 •••••••••••••••••••••••••••••••••••••••••••••••• 55 | vector BV_6_TL = <0.76463, 0.56813, 0.00000>;// Top Left 56 | vector BV_6_BR = <0.97494, 0.44000, 0.00000>;// Bottom Right 57 | // Button 7 •••••••••••••••••••••••••••••••••••••••••••••••• 58 | vector BV_7_TL = <0.77367, 0.41422, 0.00000>;// Top Left 59 | vector BV_7_BR = <0.96873, 0.29705, 0.00000>;// Bottom Right 60 | // Button 8 •••••••••••••••••••••••••••••••••••••••••••••••• 61 | vector BV_8_TL = <0.77622, 0.25989, 0.00000>;// Top Left 62 | vector BV_8_BR = <0.97104, 0.13855, 0.00000>;// Bottom Right 63 | // 64 | // End of Row 2 65 | // 66 | // Start of Row 3 67 | // 68 | // Button 9 •••••••••••••••••••••••••••••••••••••••••••••••• 69 | vector BV_9_TL = <0.00000, 0.00000, 0.00000>;// Top Left 70 | vector BV_9_BR = <0.00000, 0.00000, 0.00000>;// Bottom Right 71 | // Button 10 •••••••••••••••••••••••••••••••••••••••••••••••• 72 | vector BV_10_TL = <0.00000, 0.00000, 0.00000>;// Top Left 73 | vector BV_10_BR = <0.00000, 0.00000, 0.00000>;// Bottom Right 74 | // Button 11 •••••••••••••••••••••••••••••••••••••••••••••••• 75 | vector BV_11_TL = <0.00000, 0.00000, 0.00000>;// Top Left 76 | vector BV_11_BR = <0.00000, 0.00000, 0.00000>;// Bottom Right 77 | // Button 12 •••••••••••••••••••••••••••••••••••••••••••••••• 78 | vector BV_12_TL = <0.00000, 0.00000, 0.00000>;// Top Left 79 | vector BV_12_BR = <0.00000, 0.00000, 0.00000>;// Bottom Right 80 | // 81 | // End of Row 3 82 | // 83 | // Start of Row 4 84 | // 85 | // Button 13 •••••••••••••••••••••••••••••••••••••••••••••••• 86 | vector BV_13_TL = <0.00000, 0.00000, 0.00000>;// Top Left 87 | vector BV_13_BR = <0.00000, 0.00000, 0.00000>;// Bottom Right 88 | // Button 14 •••••••••••••••••••••••••••••••••••••••••••••••• 89 | vector BV_14_TL = <0.00000, 0.00000, 0.00000>;// Top Left 90 | vector BV_14_BR = <0.00000, 0.00000, 0.00000>;// Bottom Right 91 | // Button 15 •••••••••••••••••••••••••••••••••••••••••••••••• 92 | vector BV_15_TL = <0.00000, 0.00000, 0.00000>;// Top Left 93 | vector BV_15_BR = <0.00000, 0.00000, 0.00000>;// Bottom Right 94 | // Button 16 •••••••••••••••••••••••••••••••••••••••••••••••• 95 | vector BV_16_TL = <0.00000, 0.00000, 0.00000>;// Top Left 96 | vector BV_16_BR = <0.00000, 0.00000, 0.00000>;// Bottom Right 97 | // 98 | // End of Row 4 99 | // 100 | // Start of Row 5 101 | // 102 | // Button 17 •••••••••••••••••••••••••••••••••••••••••••••••• 103 | vector BV_17_TL = <0.08016, 0.49438, 0.00000>;// Top Left 104 | vector BV_17_BR = <0.23949, 0.43205, 0.00000>;// Bottom Right 105 | // Button 18 •••••••••••••••••••••••••••••••••••••••••••••••• 106 | vector BV_18_TL = <0.30239, 0.49438, 0.00000>;// Top Left 107 | vector BV_18_BR = <0.46172, 0.43205, 0.00000>;// Bottom Right 108 | // Button 19 •••••••••••••••••••••••••••••••••••••••••••••••• 109 | vector BV_19_TL = <0.53301, 0.49249, 0.00000>;// Top Left 110 | vector BV_19_BR = <0.69653, 0.43583, 0.00000>;// Bottom Right 111 | // Button 20 •••••••••••••••••••••••••••••••••••••••••••••••• 112 | vector BV_20_TL = <0.75524, 0.49438, 0.00000>;// Top Left 113 | vector BV_20_BR = <0.91877, 0.43016, 0.00000>;// Bottom Right 114 | // 115 | // End of Row 5 116 | // 117 | // Start of Row 6 118 | // 119 | // Button 21 •••••••••••••••••••••••••••••••••••••••••••••••• 120 | vector BV_21_TL = <0.08016, 0.38861, 0.00000>;// Top Left 121 | vector BV_21_BR = <0.24369, 0.33384, 0.00000>;// Bottom Right 122 | // Button 22 •••••••••••••••••••••••••••••••••••••••••••••••• 123 | vector BV_22_TL = <0.30658, 0.39050, 0.00000>;// Top Left 124 | vector BV_22_BR = <0.46592, 0.33573, 0.00000>;// Bottom Right 125 | // Button 23 •••••••••••••••••••••••••••••••••••••••••••••••• 126 | vector BV_23_TL = <0.53301, 0.38861, 0.00000>;// Top Left 127 | vector BV_23_BR = <0.69234, 0.33006, 0.00000>;// Bottom Right 128 | // Button 24 •••••••••••••••••••••••••••••••••••••••••••••••• 129 | vector BV_24_TL = <0.75943, 0.38861, 0.00000>;// Top Left 130 | vector BV_24_BR = <0.91457, 0.33195, 0.00000>;// Bottom Right 131 | // 132 | // End of Row 6 133 | // 134 | // Start of Row 7 135 | // 136 | // Button 25 •••••••••••••••••••••••••••••••••••••••••••••••• 137 | vector BV_25_TL = <0.07177, 0.28662, 0.00000>;// Top Left 138 | vector BV_25_BR = <0.25207, 0.23185, 0.00000>;// Bottom Right 139 | // Button 26 •••••••••••••••••••••••••••••••••••••••••••••••• 140 | vector BV_26_TL = <0.30239, 0.29229, 0.00000>;// Top Left 141 | vector BV_26_BR = <0.45753, 0.23563, 0.00000>;// Bottom Right 142 | // Button 27 •••••••••••••••••••••••••••••••••••••••••••••••• 143 | vector BV_27_TL = <0.53301, 0.28851, 0.00000>;// Top Left 144 | vector BV_27_BR = <0.69653, 0.23374, 0.00000>;// Bottom Right 145 | // Button 28 •••••••••••••••••••••••••••••••••••••••••••••••• 146 | vector BV_28_TL = <0.75524, 0.29040, 0.00000>;// Top Left 147 | vector BV_28_BR = <0.91877, 0.22807, 0.00000>;// Bottom Right 148 | // 149 | // End of Row 7 150 | // 151 | // Start of Row 8 152 | // 153 | // Button 29 •••••••••••••••••••••••••••••••••••••••••••••••• 154 | vector BV_29_TL = <0.06758, 0.18841, 0.00000>;// Top Left 155 | vector BV_29_BR = <0.24369, 0.12986, 0.00000>;// Bottom Right 156 | // Button 30 •••••••••••••••••••••••••••••••••••••••••••••••• 157 | vector BV_30_TL = <0.30239, 0.19407, 0.00000>;// Top Left 158 | vector BV_30_BR = <0.47850, 0.13364, 0.00000>;// Bottom Right 159 | // Button 31 •••••••••••••••••••••••••••••••••••••••••••••••• 160 | vector BV_31_TL = <0.52881, 0.19030, 0.00000>;// Top Left 161 | vector BV_31_BR = <0.70073, 0.12986, 0.00000>;// Bottom Right 162 | // Button 32 •••••••••••••••••••••••••••••••••••••••••••••••• 163 | vector BV_32_TL = <0.74685, 0.18463, 0.00000>;// Top Left 164 | vector BV_32_BR = <0.91038, 0.13175, 0.00000>;// Bottom Right 165 | // 166 | // End of Row 8 167 | // 168 | // Start of Row 9 169 | // 170 | // Button 33 •••••••••••••••••••••••••••••••••••••••••••••••• 171 | vector BV_33_TL = <0.07596, 0.09397, 0.00000>;// Top Left 172 | vector BV_33_BR = <0.23530, 0.02976, 0.00000>;// Bottom Right 173 | // Button 34 •••••••••••••••••••••••••••••••••••••••••••••••• 174 | vector BV_34_TL = <0.29820, 0.09397, 0.00000>;// Top Left 175 | vector BV_34_BR = <0.49108, 0.02787, 0.00000>;// Bottom Right 176 | // Button 35 •••••••••••••••••••••••••••••••••••••••••••••••• 177 | vector BV_35_TL = <0.53301, 0.08831, 0.00000>;// Top Left 178 | vector BV_35_BR = <0.70492, 0.03731, 0.00000>;// Bottom Right 179 | // Button 36 •••••••••••••••••••••••••••••••••••••••••••••••• 180 | vector BV_36_TL = <0.74685, 0.09209, 0.00000>;// Top Left 181 | vector BV_36_BR = <0.92296, 0.03165, 0.00000>;// Bottom Right 182 | // 183 | // End of Row 9 184 | // 185 | ///_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 186 | integer i;vector v; 187 | default{ 188 | state_entry(){ 189 | llSetTexture("c934b40f-c52d-3fb0-8555-7c2d1583fc6d",4); // face 4 Face's the user in Hud form 190 | } 191 | touch_start(integer UV_detected){ 192 | i=0;v=llDetectedTouchUV(i); 193 | if(Vector_Sender == TRUE){ 194 | llOwnerSay("Touch UV Vector: "+(string)llDetectedTouchUV(i));} 195 | //_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 196 | for(; i BV_1_TL.x && v.x < BV_1_BR.x && v.y < BV_1_TL.y && v.y > BV_1_BR.y){ 203 | llMapDestination("University of Cincinnati", <126, 48, 52>, ZERO_VECTOR);} 204 | // BUTTON 2 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 205 | if(v.x > BV_2_TL.x && v.x < BV_2_BR.x && v.y < BV_2_TL.y && v.y > BV_2_BR.y){ 206 | llMapDestination("University of Cincinnati", <126, 48, 42>, ZERO_VECTOR);} 207 | // BUTTON 3 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 208 | if(v.x > BV_3_TL.x && v.x < BV_3_BR.x && v.y < BV_3_TL.y && v.y > BV_3_BR.y){ 209 | llMapDestination("University of Cincinnati", <126, 48, 32>, ZERO_VECTOR);} 210 | // BUTTON 4 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 211 | if(v.x > BV_4_TL.x && v.x < BV_4_BR.x && v.y < BV_4_TL.y && v.y > BV_4_BR.y){ 212 | llMapDestination("University of Cincinnati", <117, 65, 23>, ZERO_VECTOR);} 213 | // 214 | // End of Row 1 215 | // 216 | // Start of Row 2 217 | if(v.x > BV_5_TL.x && v.x < BV_5_BR.x && v.y < BV_5_TL.y && v.y > BV_5_BR.y){ 218 | llMapDestination("University of Cincinnati", <126, 48, 52>, ZERO_VECTOR);} 219 | // BUTTON 6 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 220 | if(v.x > BV_2_TL.x && v.x < BV_6_BR.x && v.y < BV_6_TL.y && v.y > BV_6_BR.y){ 221 | llMapDestination("University of Cincinnati", <126, 48, 42>, ZERO_VECTOR);} 222 | // BUTTON 7 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 223 | if(v.x > BV_7_TL.x && v.x < BV_7_BR.x && v.y < BV_7_TL.y && v.y > BV_7_BR.y){ 224 | llMapDestination("University of Cincinnati", <126, 48, 32>, ZERO_VECTOR);} 225 | // BUTTON 8 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 226 | if(v.x > BV_8_TL.x && v.x < BV_8_BR.x && v.y < BV_8_TL.y && v.y > BV_8_BR.y){ 227 | llMapDestination("University of Cincinnati", <117, 65, 23>, ZERO_VECTOR);} 228 | // 229 | // End of Row 2 230 | // 231 | // Start of Row 3 232 | //if(v.x > BV_9_TL.x && v.x < BV_9_BR.x && v.y < BV_9_TL.y && v.y > BV_9_BR.y){ 233 | //llSay(0," ");} 234 | // BUTTON 10 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 235 | //if(v.x > BV_10_TL.x && v.x < BV_10_BR.x && v.y < BV_10_TL.y && v.y > BV_10_BR.y){ 236 | //llSay(0," ");} 237 | // BUTTON 11 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 238 | //if(v.x > BV_11_TL.x && v.x < BV_11_BR.x && v.y < BV_11_TL.y && v.y > BV_11_BR.y){ 239 | //llSay(0," ");} 240 | // BUTTON 12 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 241 | //if(v.x > BV_12_TL.x && v.x < BV_12_BR.x && v.y < BV_12_TL.y && v.y > BV_12_BR.y){ 242 | //llSay(0," ");} 243 | // 244 | // End of Row 3 245 | // 246 | // Start of Row 4 247 | //if(v.x > BV_13_TL.x && v.x < BV_13_BR.x && v.y < BV_13_TL.y && v.y > BV_13_BR.y){ 248 | //llSay(0," ");} 249 | // BUTTON 14 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 250 | //if(v.x > BV_14_TL.x && v.x < BV_14_BR.x && v.y < BV_14_TL.y && v.y > BV_14_BR.y){ 251 | //llSay(0," ");} 252 | // BUTTON 15 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 253 | //if(v.x > BV_15_TL.x && v.x < BV_15_BR.x && v.y < BV_15_TL.y && v.y > BV_15_BR.y){ 254 | //llSay(0," ");} 255 | // BUTTON 16 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 256 | //if(v.x > BV_16_TL.x && v.x < BV_16_BR.x && v.y < BV_16_TL.y && v.y > BV_16_BR.y){ 257 | //llSay(0," ");} 258 | // 259 | // End of Row 4 260 | // 261 | // Start of Row 5 262 | //if(v.x > BV_17_TL.x && v.x < BV_17_BR.x && v.y < BV_17_TL.y && v.y > BV_17_BR.y){ 263 | //llSay(0," ");} 264 | // BUTTON 18 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 265 | //if(v.x > BV_18_TL.x && v.x < BV_18_BR.x && v.y < BV_18_TL.y && v.y > BV_18_BR.y){ 266 | //llSay(0," ");} 267 | // BUTTON 19 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 268 | //if(v.x > BV_19_TL.x && v.x < BV_19_BR.x && v.y < BV_19_TL.y && v.y > BV_19_BR.y){ 269 | //llSay(0," ");} 270 | // BUTTON 20 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 271 | //if(v.x > BV_20_TL.x && v.x < BV_20_BR.x && v.y < BV_20_TL.y && v.y > BV_20_BR.y){ 272 | //llSay(0," ");} 273 | // 274 | // End of Row 5 275 | // 276 | // Start of Row 6 277 | //if(v.x > BV_21_TL.x && v.x < BV_21_BR.x && v.y < BV_21_TL.y && v.y > BV_21_BR.y){ 278 | //llSay(0," ");} 279 | // BUTTON 22 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 280 | //if(v.x > BV_22_TL.x && v.x < BV_22_BR.x && v.y < BV_22_TL.y && v.y > BV_22_BR.y){ 281 | //llSay(0," ");} 282 | // BUTTON 23 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 283 | //if(v.x > BV_23_TL.x && v.x < BV_23_BR.x && v.y < BV_23_TL.y && v.y > BV_23_BR.y){ 284 | //llSay(0," ");} 285 | // BUTTON 24 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 286 | //if(v.x > BV_24_TL.x && v.x < BV_24_BR.x && v.y < BV_24_TL.y && v.y > BV_24_BR.y){ 287 | //llSay(0," ");} 288 | // 289 | // End of Row 6 290 | // 291 | // Start of Row 7 292 | //if(v.x > BV_25_TL.x && v.x < BV_25_BR.x && v.y < BV_25_TL.y && v.y > BV_25_BR.y){ 293 | //llSay(0," ");} 294 | // BUTTON 26 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 295 | //if(v.x > BV_26_TL.x && v.x < BV_26_BR.x && v.y < BV_26_TL.y && v.y > BV_26_BR.y){ 296 | //llSay(0," ");} 297 | // BUTTON 27 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 298 | //if(v.x > BV_27_TL.x && v.x < BV_27_BR.x && v.y < BV_27_TL.y && v.y > BV_27_BR.y){ 299 | //llSay(0," ");} 300 | // BUTTON 28 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 301 | //if(v.x > BV_28_TL.x && v.x < BV_28_BR.x && v.y < BV_28_TL.y && v.y > BV_28_BR.y){ 302 | //llSay(0," ");} 303 | // 304 | // End of Row 7 305 | // 306 | // Start of Row 8 307 | //if(v.x > BV_29_TL.x && v.x < BV_29_BR.x && v.y < BV_29_TL.y && v.y > BV_29_BR.y){ 308 | //llSay(0," ");} 309 | // BUTTON 30 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 310 | //if(v.x > BV_30_TL.x && v.x < BV_30_BR.x && v.y < BV_30_TL.y && v.y > BV_30_BR.y){ 311 | //llSay(0," ");} 312 | // BUTTON 31 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 313 | //if(v.x > BV_31_TL.x && v.x < BV_31_BR.x && v.y < BV_31_TL.y && v.y > BV_31_BR.y){ 314 | //llSay(0," ");} 315 | // BUTTON 32 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 316 | //if(v.x > BV_32_TL.x && v.x < BV_32_BR.x && v.y < BV_32_TL.y && v.y > BV_32_BR.y){ 317 | //llSay(0," ");} 318 | // 319 | // End of Row 8 320 | // 321 | // Start of Row 9 322 | //if(v.x > BV_33_TL.x && v.x < BV_33_BR.x && v.y < BV_33_TL.y && v.y > BV_33_BR.y){ 323 | //llSay(0," ");} 324 | // BUTTON 34 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 325 | //if(v.x > BV_34_TL.x && v.x < BV_34_BR.x && v.y < BV_34_TL.y && v.y > BV_34_BR.y){ 326 | //llSay(0," ");} 327 | // BUTTON 35 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 328 | //if(v.x > BV_35_TL.x && v.x < BV_35_BR.x && v.y < BV_35_TL.y && v.y > BV_35_BR.y){ 329 | //llSay(0," ");} 330 | // BUTTON 36 ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 331 | //if(v.x > BV_36_TL.x && v.x < BV_36_BR.x && v.y < BV_36_TL.y && v.y > BV_36_BR.y){ 332 | //llSay(0," ");} 333 | // 334 | // End of Row 9 335 | // 336 | //_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 337 | }}}///_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ -------------------------------------------------------------------------------- /Scripts/Camera Follower.lsl: -------------------------------------------------------------------------------- 1 | // Purpose 2 | // -------------------------------------------------------------- 3 | // This script shows you how you can make an object physical, and 4 | // have it follow your camera around. 5 | 6 | // Requirements 7 | // -------------------------------------------------------------- 8 | // A single prim is all that is necessary for this example. 9 | 10 | // Usage 11 | // -------------------------------------------------------------- 12 | // Permissions to track your camera are required for it to work 13 | // correctly. Type "follow" to track the camera. Type "stop" to 14 | // stop tracking the camera. Touching the object will also start 15 | // tracking the camera. 16 | 17 | // GLOBALS 18 | // -------------------------------------------------------------- 19 | integer g_ListenChannel = 0; // This is the listen channel 20 | float g_Timer = 0.10; // This is the timer call rate 21 | 22 | // FUNCTIONS 23 | // -------------------------------------------------------------- 24 | permissions() 25 | { 26 | // Since this block of code is used more then once in the main 27 | // loop, it's a good idea to make it a function. 28 | 29 | // Get the permissions 30 | if(llGetPermissions() & PERMISSION_TRACK_CAMERA) 31 | { 32 | // Permissions were passed, so we make the object physical 33 | // and start the timer 34 | llSetStatus(STATUS_PHYSICS, TRUE); 35 | llSetTimerEvent(g_Timer); 36 | } 37 | else 38 | { 39 | // Permissions were not passed, so we make the object static, 40 | // set the timer to 0, and Request permissions. 41 | llSetStatus(STATUS_PHYSICS, FALSE); 42 | llSetTimerEvent(FALSE); 43 | llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA); 44 | } 45 | } 46 | 47 | // EVENTS 48 | // -------------------------------------------------------------- 49 | default 50 | { 51 | state_entry() 52 | { 53 | // Collision Sounds and Sprites can be replaced. We make them 54 | // empty strings so there are no sounds or sprites if the camera 55 | // happens to knock up against a wall. 56 | llCollisionSound("", 0); 57 | llCollisionSprite(""); 58 | 59 | // Make a listener to listen for commands the owner may use. 60 | llListen(g_ListenChannel, "", llGetOwner(), ""); 61 | 62 | // Call the permissions() function block 63 | permissions(); 64 | } 65 | 66 | on_rez(integer start_param) 67 | { 68 | // The object was just rezzed out of inventory, so call up the 69 | // permissions() function block 70 | permissions(); 71 | } 72 | 73 | touch_start(integer num_detected) 74 | { 75 | // The object was touched, so first we make sure that the owner 76 | // touched the object, and if so... call the permissions() 77 | // function block 78 | if(llDetectedKey(0) == llGetOwner()) permissions(); 79 | } 80 | 81 | listen(integer channel, string name, key id, string message) 82 | { 83 | // Turn all commands into lowercase using llToLower() 84 | message = llToLower(message); 85 | if(message == "stop") 86 | { 87 | // The owner said "stop", so we'll turn off the object by 88 | // making the object static, and setting the timer to 0 89 | llSetStatus(STATUS_PHYSICS, FALSE); 90 | llSetTimerEvent(FALSE); 91 | } 92 | else if(message == "follow") 93 | { 94 | // The owner said "follow", so we call up the permissions() 95 | // function block 96 | permissions(); 97 | } 98 | } 99 | 100 | run_time_permissions(integer perm) 101 | { 102 | // Permissions were requested through the permissions() function 103 | // block. Remember to use bitwise opperands when dealing with 104 | // conditional statements for permissions. 105 | if(perm & PERMISSION_TRACK_CAMERA) 106 | { 107 | // The owner granted permissions, so we set the object to 108 | // physical, and fire up the timer. 109 | llSetStatus(STATUS_PHYSICS,TRUE); 110 | llSetTimerEvent(g_Timer); 111 | } 112 | } 113 | 114 | timer() 115 | { 116 | // Here the timer uses llMoveToTarget() which simply moves the 117 | // object to wherever the owner's camera is, and about 1 meter 118 | // above (as to not obtruct the owner's view. The owner will 119 | // not be able to see the object under most circumstances, so if 120 | // the owner wants to get rid of the object, they must first say 121 | // "stop" in chat to make the object stop moving. Then they can 122 | // click on the object a lot easier to delete or take. 123 | llMoveToTarget(llGetCameraPos() + <0.0, 0.0, 1.0>, 0.20); 124 | 125 | // Since the object looks a bit awkward only moving to position and 126 | // not rotating properly, we call a simple sensor looking for the 127 | // owner's current position. 128 | llSensor("", llGetOwner(), AGENT, 96, PI); 129 | } 130 | 131 | sensor(integer num_detected) 132 | { 133 | // After we get the owner's position, we'll have the object just 134 | // look at the owner using it's forward axis. This gives a nice 135 | // effect. If you wanted to track the owners actual camera rotations 136 | // then you would have to use llGetCameraRot() and make the correct 137 | // calculations. We do it this way for simplicity. 138 | llLookAt(llDetectedPos(0), 0.32, 0.32); 139 | } 140 | } -------------------------------------------------------------------------------- /Scripts/Chat Die.lsl: -------------------------------------------------------------------------------- 1 | //Chat Die Script 2 | 3 | //This is to delete objects by chat. Place this script in an object you wish to have self delete. Say or Shout (hold ctrl while hitting enter) the word delete, and your object will self delete. 4 | 5 | 123//remove the 123 to be able to use this script. Just delete the numbers and make sure running in the lower left is checked and hit save. 6 | 7 | //Make sure you save a copy of this script and all others in this package before removing the 123. 8 | 9 | 10 | default 11 | { 12 | state_entry() 13 | { 14 | llListen(0,"",llGetOwner(),""); 15 | } 16 | 17 | listen(integer channel, string name, key id, string m) 18 | { 19 | if (m=="delete");llDie(); 20 | } 21 | } -------------------------------------------------------------------------------- /Scripts/Chat logger(GPL).lsl: -------------------------------------------------------------------------------- 1 | //Chat Logger (GPL 2 | // 3 | //Code adapted from: http://www.simteach.com/wiki/index.php?title=SL_Chat_Logger (by Patch Lamington) which is covered by GNU Free Documentation License (http://www.gnu.org/copyleft/fdl.html) in the spirit of which this script is GPL'd. Copyright (C) 2007 Nobody Fugazi/T. Rampersad 4 | 5 | //(This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The GPL license: [1] 6 | 7 | //You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 8 | 9 | //Change Log: 10 | 11 | // * March 15, 2008: Fixed memory leaks & cleaned up the whitespace. (SO) 12 | // * January 12, 2007: Text output in HTML, Requests permissions from user before logging chat. (NF/TR) 13 | 14 | list names; 15 | list speech; 16 | list colours=["002EB8","FF6633","006600","660066","660033","663300","1A9900","FF14B1","001A99","B88A00"]; 17 | list unique_names; 18 | list ignore_names; 19 | list buffer_await; 20 | 21 | list ALLOW_MENU = ["sure", "no way"]; // the main menu 22 | integer CHANNEL = 42; // Life, the Universe, and Everything. 23 | integer HandleDialogListen; 24 | 25 | default 26 | { 27 | state_entry() 28 | { 29 | llSetText("This is a GPL Chat Logger.\n We request permission before recording.",<0.0, 0.0, 0.0>, 1.0); 30 | integer i = 0; 31 | integer c = llGetListLength(names); 32 | for (;i < c;++i) 33 | { 34 | llSetObjectName("" + llList2String(names,i) ); 38 | llOwnerSay( llList2String(speech,i) + "" ); 39 | } 40 | names = speech = unique_names = []; 41 | llSetObjectName("GPL ChatLogger 0.1"); 42 | } 43 | 44 | on_rez(integer i) 45 | { 46 | llResetScript(); 47 | } 48 | 49 | touch_start(integer total_number) 50 | { 51 | if (llDetectedKey(0) == llGetOwner() ) 52 | { 53 | llSay(0, "Beginning Chat Logging."); 54 | state chat_logging; 55 | } 56 | } 57 | } 58 | 59 | state chat_logging 60 | { 61 | state_entry() 62 | { 63 | llListen(0,"",NULL_KEY,""); 64 | buffer_await = []; 65 | } 66 | 67 | on_rez(integer i) 68 | { 69 | llOwnerSay("Logging still active! Touch to get playback"); 70 | } 71 | 72 | timer() 73 | { 74 | // If the dialog is hanging out doing nothing too long, kill the llListen 75 | llListenRemove(HandleDialogListen); 76 | buffer_await = []; 77 | } 78 | 79 | touch_start(integer total_number) 80 | { 81 | if (llDetectedKey(0) == llGetOwner() ) 82 | { 83 | llSay(0, "chat logging now off - replaying log!."); 84 | buffer_await = []; 85 | state default; 86 | } 87 | } 88 | 89 | listen(integer channel, string name, key id, string message) 90 | { 91 | if (llGetOwnerKey(id) == id)//only listen to avatars (they own themselves) 92 | { 93 | // Is this a message from the permissions dialog? 94 | list temp_name = (list)name; 95 | if (channel == CHANNEL) 96 | { 97 | if (~llListFindList(ALLOW_MENU, [message])) 98 | { 99 | // we'll need this from the strided list. 100 | integer buffer_loc; 101 | 102 | if (~(buffer_loc = llListFindList(ignore_names, temp_name))) 103 | { 104 | ignore_names = llDeleteSubList(ignore_names, buffer_loc, buffer_loc); 105 | } 106 | if (~(buffer_loc = llListFindList(unique_names, temp_name))) 107 | { 108 | unique_names = llDeleteSubList(unique_names, buffer_loc, buffer_loc); 109 | } 110 | if (message == "sure") 111 | { 112 | unique_names += name; 113 | while (~(buffer_loc = llListFindList(buffer_await, temp_name))) 114 | { 115 | // buffered message is worthwhile, so add it: 116 | names += llList2String(buffer_await, buffer_loc); 117 | speech += llList2String(buffer_await, buffer_loc + 1); 118 | buffer_await = llDeleteSubList(buffer_await, buffer_loc, buffer_loc + 1); 119 | } 120 | } 121 | else 122 | { 123 | ignore_names += name; 124 | while (~(buffer_loc = llListFindList(buffer_await, temp_name))) 125 | { 126 | buffer_await = llDeleteSubList(buffer_await, buffer_loc, buffer_loc + 1); 127 | } 128 | } 129 | if (buffer_await == []) 130 | { 131 | llListenRemove(HandleDialogListen); 132 | } 133 | } 134 | } 135 | else if (!~llListFindList(ignore_names, temp_name)) 136 | { 137 | if (!~llListFindList(unique_names, temp_name)) 138 | { 139 | //Check if avatar will give permissions 140 | if (!~llListFindList(buffer_await, temp_name)) 141 | { 142 | if (buffer_await == []) 143 | { 144 | HandleDialogListen = llListen(CHANNEL, "", NULL_KEY, ""); 145 | } 146 | llDialog(id, "Hello. This is a chat logger. If you give us permission, your participation will be recorded. May we have your permission?", ALLOW_MENU, CHANNEL); 147 | // Give people 1.5 minutes to respond, 148 | // else kill the llListen in timer() 149 | llSetTimerEvent(0.0); 150 | llSetTimerEvent(90.0); 151 | } 152 | // store in strided buffer in case last message is to be permed. 153 | buffer_await += temp_name + (key)message; 154 | } 155 | else 156 | { 157 | names += name; 158 | speech += message; 159 | } 160 | } 161 | } 162 | } 163 | } -------------------------------------------------------------------------------- /Scripts/Check Inventory Permissions.lsl: -------------------------------------------------------------------------------- 1 | integer CHANNEL = 678; 2 | integer LINK_N = -12390133; 3 | integer gDesiredPerms = 0; 4 | 5 | list LIST_TYPES = [INVENTORY_NONE, INVENTORY_TEXTURE, INVENTORY_SOUND, 6 | INVENTORY_LANDMARK, INVENTORY_CLOTHING, INVENTORY_OBJECT, INVENTORY_NOTECARD, 7 | INVENTORY_SCRIPT, INVENTORY_BODYPART, INVENTORY_ANIMATION, INVENTORY_GESTURE]; 8 | list LIST_NAMES = ["None", "Texture", "Sound", "Landmark", "Clothing", "Object", "Notecard", 9 | "Script", "Body Part", "Animation", "Gesture"]; 10 | 11 | //--------------------------------------------------------------------- 12 | 13 | string inventory_type(integer n) 14 | { 15 | integer detected_type = llGetInventoryType(llGetInventoryName(INVENTORY_ALL, n)); 16 | integer type_index = llListFindList(LIST_TYPES, [detected_type]); 17 | return llList2String(LIST_NAMES, type_index); 18 | } 19 | 20 | string perm_string(integer perms) 21 | { 22 | list msg = []; 23 | if (perms & PERM_MODIFY) msg += ["mod"]; 24 | if (perms & PERM_COPY) msg += ["copy"]; 25 | if (perms & PERM_TRANSFER) msg += ["trans"]; 26 | if (msg == []) return "(no perms)"; 27 | else return llDumpList2String(msg, "/"); 28 | } 29 | 30 | list_perms(integer all) 31 | { 32 | integer f = 0; 33 | string report = ""; 34 | integer perms = 0; 35 | do { 36 | perms = llGetInventoryPermMask( 37 | llGetInventoryName(INVENTORY_ALL, f), 38 | MASK_NEXT 39 | ) & 57344; 40 | if (all || ((perms != gDesiredPerms)) && llGetInventoryName(INVENTORY_ALL, f) != llGetScriptName()) { 41 | report += ( 42 | "\n" + llGetInventoryName(INVENTORY_ALL, f) 43 | + " (" + inventory_type(f) + "): " 44 | + perm_string(perms) 45 | ); 46 | } 47 | } while (++f < llGetInventoryNumber(INVENTORY_ALL)); 48 | if (report == "") { 49 | if (all) report += "\nNo inventory objects in this prim"; 50 | else report += "\nAll inventory objects OK in this prim"; 51 | } 52 | report = "Inventory permission report for " + prim_name(llGetLinkNumber()) + report; 53 | llOwnerSay(report); 54 | if (llGetLinkNumber() <= 1) { 55 | if (all) llMessageLinked(LINK_ALL_CHILDREN, LINK_N, "checkall", NULL_KEY); 56 | else llMessageLinked(LINK_ALL_CHILDREN, LINK_N, "check", NULL_KEY); 57 | } 58 | } 59 | 60 | propagate() 61 | { 62 | // Sends out a copy of itself to every prim in the object 63 | integer f = llGetNumberOfPrims(); 64 | if (f <= 1) { 65 | llOwnerSay("There's only one prim in this object"); 66 | return; 67 | } 68 | llOwnerSay("Propagating this script throughout object..."); 69 | // Link numbers begin with 1 70 | do { 71 | if (f != llGetLinkNumber()) { 72 | llGiveInventory(llGetLinkKey(f), llGetScriptName()); 73 | llOwnerSay("Given to " + prim_name(f)); 74 | } 75 | } while (--f > 0); 76 | llOwnerSay("Done. You will now have to recompile all of the check scripts in this object before they " 77 | + "can be used - either take the object into inventory, re-rez and select 'Set all scripts to running in " 78 | + "selection' from Tools menu, or manually re-save each script."); 79 | } 80 | 81 | help() 82 | { 83 | llOwnerSay("Say commands on channel " + (string)CHANNEL + "\nhelp - this help message\n" 84 | + "send - send out copies of self to all prims in object\ncheck - check" 85 | + " inventory permissions in object against desired perms\ncheckfull - complete list of all permissions" 86 | + "for all inventory contents\nmod - set or remove mod perm desired\ncopy - set or remove copy " 87 | + "perm desired\ntrans - set or remove trans perm desired\nkillall - remove all other check scripts " 88 | + "from object (including this one)\nhighlight - go through all of the prims highlighting each one, to " 89 | + "show permission (will spoil manual alpha adjustments!)"); 90 | llOwnerSay("Current desired permissions - " + perm_string(gDesiredPerms)); 91 | } 92 | 93 | kill_all_scripts() 94 | { 95 | // Send out die message and remove this script too 96 | llOwnerSay("Sending message for other scripts to die..."); 97 | llMessageLinked(LINK_SET, LINK_N, "die", NULL_KEY); 98 | die(); 99 | } 100 | 101 | string prim_name(integer f) 102 | { 103 | return "prim #" + (string)f + " (" + llGetLinkName(f) + ")"; 104 | } 105 | 106 | die() 107 | { 108 | llOwnerSay(llGetScriptName() + " in " + prim_name(llGetLinkNumber()) + " - removing myself, goodbye!"); 109 | llRemoveInventory(llGetScriptName()); 110 | } 111 | 112 | process_command(string msg) 113 | { 114 | msg = llToLower(msg); 115 | if (msg == "help") help(); 116 | else if (msg == "send") propagate(); 117 | else if (msg == "killall") kill_all_scripts(); 118 | else if (msg == "check") list_perms(0); 119 | else if (msg == "checkall") list_perms(1); 120 | else if (msg == "mod") { 121 | toggle_flag(PERM_MODIFY); 122 | if (llGetLinkNumber() <= 1) llMessageLinked(LINK_SET, LINK_N, "perms" + (string)gDesiredPerms, NULL_KEY); 123 | } 124 | else if (msg == "copy") { 125 | toggle_flag(PERM_COPY); 126 | if (llGetLinkNumber() <= 1) llMessageLinked(LINK_SET, LINK_N, "perms" + (string)gDesiredPerms, NULL_KEY); 127 | } 128 | else if (msg == "trans") { 129 | toggle_flag(PERM_TRANSFER); 130 | if (llGetLinkNumber() <= 1) llMessageLinked(LINK_SET, LINK_N, "perms" + (string)gDesiredPerms, NULL_KEY); 131 | } 132 | else if (llGetSubString(msg, 0, 4) == "perms") { 133 | gDesiredPerms = (integer)llGetSubString(msg, 5, -1); 134 | } 135 | else if (msg == "die") die(); 136 | else if (msg == "highlight") highlight_prims(); 137 | } 138 | 139 | toggle_flag(integer perm) 140 | { 141 | gDesiredPerms = gDesiredPerms ^ perm; 142 | if (llGetLinkNumber() <= 1) llOwnerSay("Desired permissions are now " + perm_string(gDesiredPerms)); 143 | } 144 | 145 | highlight_prims() 146 | { 147 | integer f = llGetNumberOfPrims(); 148 | if (f <= 1) { 149 | llOwnerSay("There's only one prim in this object, what's the point?"); 150 | return; 151 | } 152 | llOwnerSay("Beginning prim highlighting"); 153 | llSetLinkAlpha(LINK_SET, 0.1, ALL_SIDES); 154 | // Link numbers begin with 1 155 | do { 156 | llSetLinkAlpha(f, 1.0, ALL_SIDES); 157 | llOwnerSay("Highlight " + prim_name(f)); 158 | llSleep(3.0); 159 | llSetLinkAlpha(f, 0.1, ALL_SIDES); 160 | } while (--f > 0); 161 | llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES); 162 | llOwnerSay("Done"); 163 | } 164 | 165 | //--------------------------------------------------------------------- 166 | 167 | default 168 | { 169 | state_entry() 170 | { 171 | gDesiredPerms = PERM_COPY; 172 | if (llGetLinkNumber() <= 1) { 173 | llListen(CHANNEL, "", llGetOwner(), ""); 174 | help(); 175 | } 176 | else { 177 | llOwnerSay(llGetScriptName() + " " + prim_name(llGetLinkNumber()) + " ready"); 178 | } 179 | } 180 | 181 | on_rez(integer p) 182 | { 183 | llResetScript(); 184 | } 185 | 186 | listen(integer c, string name, key id, string msg) 187 | { 188 | process_command(msg); 189 | } 190 | 191 | link_message(integer s, integer n, string msg, key id) 192 | { 193 | if (n == LINK_N && llGetLinkNumber() > 1) { 194 | process_command(msg); 195 | } 196 | } 197 | 198 | changed(integer change) 199 | { 200 | if (change & CHANGED_OWNER) { 201 | // delete if sold etc 202 | llRemoveInventory(llGetScriptName()); 203 | } 204 | else if (change & CHANGED_LINK) { 205 | llResetScript(); 206 | } 207 | } 208 | } -------------------------------------------------------------------------------- /Scripts/Cloack.lsl: -------------------------------------------------------------------------------- 1 | 2 | default 3 | { 4 | state_entry() 5 | { 6 | key owner = llGetOwner(); 7 | llWhisper(0,"Cloaking ready"); 8 | llListen(0,"",owner,""); 9 | } 10 | 11 | listen( integer channel, string name, key id, string message ) 12 | { 13 | if( message == "cloak" ) 14 | { 15 | llSetStatus(STATUS_PHANTOM, TRUE); 16 | llWhisper(0,"Cloaking"); 17 | llSetAlpha(0,ALL_SIDES); 18 | } 19 | if( message == "uncloak" ) 20 | { 21 | llSetStatus(STATUS_PHANTOM, FALSE); 22 | llWhisper(0,"Uncloaking"); 23 | llSetAlpha(1,ALL_SIDES); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Scripts/Color Change.lsl: -------------------------------------------------------------------------------- 1 | //Color Change 2 | 3 | vector c; 4 | default 5 | { 6 | state_entry() 7 | { 8 | llListen(0,"","","colors"); 9 | llListen(0,"","","stop"); 10 | c=llGetColor(0); 11 | } 12 | listen (integer channel, string name, key id, string message) 13 | { 14 | if (message == "colors") 15 | { 16 | float random = llFrand(1.9)+.5; 17 | llSetTimerEvent(random); 18 | } 19 | if (message == "stop") 20 | { 21 | llSetTimerEvent(0.0); 22 | llSetColor(c,-1); 23 | } 24 | 25 | } 26 | timer() 27 | { 28 | float x = llFrand(1.0); 29 | float y = llFrand(1.0); 30 | float z = llFrand(1.0); 31 | llSetColor(,-1); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /Scripts/Color Generator.lsl: -------------------------------------------------------------------------------- 1 | //Color Generator 2 | 3 | integer toggle = 0; // This is our toggle switch for turning the 4 | // script on and off. 0 is off, 1 is on. 5 | 6 | float base_delay = 1.0; // This is the minimum amount of delay 7 | // that will happen between color changes. 8 | // If you want a consistently longer or 9 | // shorter delay, change this value. 10 | 11 | float variable_delay = 1.5; // This is the maximum delay added to 12 | // the base_delay. If you want a wider 13 | // variation in the delay, then increase 14 | // the value. If you want less variance. 15 | // then decrease it. 16 | 17 | default 18 | { 19 | touch_start(integer counter) 20 | { 21 | toggle *= -1; // Here we multiply negative one, to change its 22 | // sign. 23 | 24 | if(toggle < 0) // We test to see if it is less than 0, and if it 25 | // is, then we turn on the color changer. 26 | { 27 | llSetTimerEvent(llFrand(variable_delay) + base_delay); 28 | } 29 | else 30 | { 31 | llSetTimerEvent(0); 32 | } 33 | } 34 | 35 | timer() 36 | { 37 | llSetColor(,ALL_SIDES); 38 | llSetTimerEvent(llFrand(variable_delay) + base_delay); 39 | } 40 | } -------------------------------------------------------------------------------- /Scripts/Color Gradient.lsl: -------------------------------------------------------------------------------- 1 | //1. Put this script in an object of at least 2 prims (the more the better, the grading will be smoother) 2 | //2. now you have to command it to grade between any two RGB's, RGB's entered as integers (0-255 scale) lets say u wanna grade from red to blue 3 | //the command will look like this: /12 grade 255 0 0 0 0 255 4 | //first 3 values first RGB, and the ending 3 are of the second RGB (duh) 5 | 6 | list colCom; 7 | default 8 | { 9 | state_entry() 10 | { 11 | llListen(12, "", "", ""); 12 | } 13 | 14 | listen(integer channel, string name, key id, string message) 15 | { 16 | if(id != llGetOwner()) return; //remove the first '//' to make it work for owner only 17 | 18 | colCom = llParseString2List(message, [" "], []); 19 | if(llList2String(colCom,0) == "grade") 20 | { 21 | vector startCol = ; 22 | vector endCol = ; 23 | vector grades = <(endCol.x - startCol.x)/llGetNumberOfPrims(), (endCol.y - startCol.y)/llGetNumberOfPrims(), (endCol.z - startCol.z)/llGetNumberOfPrims()>; 24 | 25 | integer x; 26 | for(x = 1; x < llGetNumberOfPrims()+ 1; x++) 27 | { 28 | startCol += grades; 29 | llSetLinkColor(x, startCol, ALL_SIDES); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Scripts/Color Vector on Color Change.lsl: -------------------------------------------------------------------------------- 1 | //Color Vector on Color Change 2 | 3 | //Aki-Tools 4 | //"ColorVec on ColorChange" 01/27/2004 5 | //This script is useful if you are trying to figure out a color vector. When you change the color of the object this script is on, the object will whisper the new color vector. 6 | 7 | init() 8 | { 9 | llSetColor(<1,1,1>, ALL_SIDES); 10 | } 11 | 12 | colorize() 13 | { 14 | integer s; 15 | vector color = llGetColor(1); 16 | llWhisper(0, "Current Color Vector: [ "+(string)color+" ]"); 17 | } 18 | 19 | default 20 | { 21 | state_entry() 22 | { 23 | init(); 24 | } 25 | 26 | on_rez(integer a) 27 | { 28 | init(); 29 | } 30 | 31 | touch_start(integer total_number) 32 | { 33 | colorize(); 34 | } 35 | 36 | changed(integer change) 37 | { 38 | if (change & CHANGED_COLOR) 39 | { 40 | colorize(); 41 | } 42 | } 43 | } 44 | 45 | state sold 46 | { 47 | state_entry() { } 48 | } -------------------------------------------------------------------------------- /Scripts/Countdown To Event Timer.lsl: -------------------------------------------------------------------------------- 1 | integer expires; 2 | 3 | // This function takes 8 arguments, the first six are the date and time. 4 | // GMToffset is adjust it based on the timezome. Use -8 for the SL clock. 5 | // DST should be TRUE or FALSE depending on daylight savings time. 6 | integer MakeUNIXTime( integer year, integer month, integer day, integer hour, integer minute, integer second, integer GMToffset, integer DST ) { 7 | list month_days = [ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 ]; 8 | integer time = ( year - 1970 ) * 31536000; 9 | time += ( day + llList2Integer( month_days, month - 1 ) - 1 ) * 86400; 10 | time += ( hour - GMToffset ) * 3600 + minute * 60 + second; 11 | if ( DST == TRUE ) { 12 | time += -3600; 13 | } 14 | if ( year > 1972 ) { 15 | integer past_leap_years = (integer)( ( year - 1969 ) / 4 ); 16 | time += past_leap_years * 86400; 17 | } 18 | if ( year % 4 == 0 && month > 2 ) { 19 | time += 86400; 20 | } 21 | return time; 22 | } 23 | 24 | default { 25 | state_entry() { 26 | // July 1, 2006, 12:15:00 PST/SL Time (see the function above for filling the values for this) 27 | expires = MakeUNIXTime( 2006, 7, 1, 12, 15, 0, -8, TRUE ); 28 | llSetTimerEvent( 1.0 ); 29 | } 30 | timer() { 31 | integer seconds = expires - llGetUnixTime(); 32 | if( seconds > 0 ) { 33 | integer days = seconds / 86400; 34 | integer hours = ( seconds - ( days * 86400 ) ) / 3600; 35 | integer minutes = ( seconds - ( days * 86400 ) - ( hours * 3600 ) ) / 60; 36 | seconds = ( seconds - ( days * 86400 ) - ( hours * 3600 ) - ( minutes * 60 ) ); 37 | string s1 = " days, "; 38 | if( days == 1 ) { 39 | s1 = " day, "; 40 | } 41 | string s2 = " hours, "; 42 | if ( hours == 1 ) { 43 | s2 = " hour, "; 44 | } 45 | string s3 = " minutes, and "; 46 | if ( minutes == 1 ) { 47 | s3 = " minute, and "; 48 | } 49 | string s4 = " seconds left"; 50 | if ( seconds == 1 ) { 51 | s4 = " second left"; 52 | } 53 | llSetText( (string)days + s1 + (string)hours + s2 + (string)minutes + s3 + (string)seconds + s4, <1.0,1.0,1.0>, 1.0 ); 54 | } 55 | else { 56 | state expired; 57 | } 58 | } 59 | } 60 | 61 | state expired { 62 | state_entry() { 63 | llSetText( "Expired", <1.0,1.0,1.0>, 1.0 ); 64 | } 65 | } -------------------------------------------------------------------------------- /Scripts/Curtain Puller.lsl: -------------------------------------------------------------------------------- 1 | //Curtain Puller Script 2 | 3 | //When touched the prim is retracted towards one end and when touched again stretched back out. 4 | // 5 | //Prim moves/changes size along the local coordinate specified in the offset vector below. 6 | // 7 | //To change the overall size, edit the prim when stretched out and reset the script when done. 8 | // 9 | //The script works both in unlinked and linked prims. 10 | // 11 | // Copyright (C) 2008 Zilla Larsson 12 | // This program is free software: you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License version 3, as 14 | // published by the Free Software Foundation. 15 | // 16 | // This program is distributed in the hope that it will be useful, 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | // GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU General Public License 22 | // along with this program. If not, see 23 | 24 | 25 | vector offset = <1,0,0>; //Prim moves/changes size along this local coordinate 26 | float hi_end_fixed = FALSE; //Which end of the prim should remain in place when size changes? 27 | //The one with the higher (local) coordinate? 28 | float min = 0.2; //The minimum size of the prim relative to its maximum size 29 | integer ns = 10; //Number of distinct steps for move/size change 30 | 31 | 32 | default { 33 | state_entry() { 34 | offset *= ((1.0 - min) / ns) * (offset * llGetScale()); 35 | hi_end_fixed -= 0.5; 36 | } 37 | 38 | touch_start(integer detected) { 39 | integer i; 40 | do llSetPrimitiveParams([PRIM_SIZE, llGetScale() - offset, 41 | PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]); 42 | while ((++i) < ns); 43 | offset = - offset; 44 | } 45 | } -------------------------------------------------------------------------------- /Scripts/Cycle Textures.lsl: -------------------------------------------------------------------------------- 1 | //Cycle Textures 2 | 3 | default 4 | { 5 | state_entry() 6 | { 7 | llSetText("Glass Texture Bundle", <0,1,0>,1); 8 | llSetTimerEvent(5.0); 9 | } 10 | timer() 11 | { 12 | integer number = llGetInventoryNumber(INVENTORY_TEXTURE); 13 | float rand = llFrand(number); 14 | integer choice = (integer)rand; 15 | string name = llGetInventoryName(INVENTORY_TEXTURE, choice); 16 | if (name != "") 17 | llSetTexture(name, 4); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Scripts/Dance.lsl: -------------------------------------------------------------------------------- 1 | //Dance 2 | 3 | list dances = [ "BackFlip","dance1", "dance2", "dance3", "dance4" ]; 4 | integer WHICH = 0; 5 | integer TOTAL = 5; 6 | integer PERMS = 0; 7 | integer ON = FALSE; 8 | 9 | default 10 | { 11 | state_entry() 12 | { 13 | llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); 14 | llSetTimerEvent(1.0); 15 | llListen(0, "", llGetOwner(), ""); 16 | } 17 | 18 | timer() 19 | { 20 | PERMS = llGetPermissions(); 21 | if (PERMS & PERMISSION_TRIGGER_ANIMATION) 22 | { 23 | if (ON == TRUE) 24 | { 25 | llStopAnimation(llList2String(dances, WHICH - 1)); 26 | llStartAnimation(llList2String(dances, WHICH)); 27 | WHICH++; 28 | if (WHICH >= TOTAL) 29 | { 30 | WHICH = 0; 31 | } 32 | } else if (ON == 2) 33 | { 34 | llStopAnimation(llList2String(dances, WHICH - 1)); 35 | WHICH = (integer)llFrand(TOTAL + 0.999); 36 | llStartAnimation(llList2String(dances, WHICH)); 37 | } 38 | } 39 | } 40 | 41 | listen(integer channel, string name, key id, string message) 42 | { 43 | if (channel == 0 && id == llGetOwner()) 44 | { 45 | if (message == "doff") 46 | { 47 | ON = FALSE; 48 | } else if (ON == FALSE && message == "don") 49 | { 50 | if (!(PERMS & PERMISSION_TRIGGER_ANIMATION)) 51 | { 52 | llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); 53 | } 54 | ON = TRUE; 55 | } else if (ON == FALSE && message == "dancer") 56 | { 57 | if (!(PERMS & PERMISSION_TRIGGER_ANIMATION)) 58 | { 59 | llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); 60 | } 61 | ON = 2; 62 | } 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /Scripts/Detect Face Prim/Detect Prim Face.lsl: -------------------------------------------------------------------------------- 1 | // Script Name: Put_a_number_on_all_faces_of_a_prim.lsl 2 | //This script is used to put a number of the prims face on each prim. Then you can use the prim number in scripts to texture any single face. 3 | 4 | // Downloaded from : http://www.free-lsl-scripts.com/cgi/freescripts.plx?ID=1446 5 | 6 | // This program is free software; you can redistribute it and/or modify it. 7 | // Additional Licenes may apply that prevent you from selling this code 8 | // and these licenses may require you to publish any changes you make on request. 9 | // 10 | // There are literally thousands of hours of work in these scripts. Please respect 11 | // the creators wishes and follow their license requirements. 12 | // 13 | // Any License information included herein must be included in any script you give out or use. 14 | // Licenses are included in the script or comments by the original author, in which case 15 | // the authors license must be followed. 16 | 17 | // A GNU license, if attached by the author, means the original code must be FREE. 18 | // Modifications can be made and products sold with the scripts in them. 19 | // You cannot attach a license to make this GNU License 20 | // more or less restrictive. see http://www.gnu.org/copyleft/gpl.html 21 | 22 | // Creative Commons licenses apply to all scripts from the Second Life 23 | // wiki and script library and are Copyrighted by Linden Lab. See 24 | // http://creativecommons.org/licenses/ 25 | 26 | // Please leave any author credits and headers intact in any script you use or publish. 27 | // If you don't like these restrictions, then don't use these scripts. 28 | //////////////////////// ORIGINAL AUTHORS CODE BEGINS //////////////////////////////////////////// 29 | display( integer value, integer face ) 30 | { 31 | float cell_width = 0.25; // in this example the width 32 | float cell_height = 0.25; // and height are the same 33 | 34 | llSetTexture("9e59ddf7-d7c3-5248-0894-00ce2154ee8e", face ); 35 | llScaleTexture( cell_width, cell_height, face ); 36 | if ( value == 0 ) 37 | llOffsetTexture( -1.5 * cell_width, 1.5 * cell_height, face ); 38 | else if ( value == 1 ) 39 | llOffsetTexture( -0.5 * cell_width, 1.5 * cell_height, face ); 40 | else if ( value == 2 ) 41 | llOffsetTexture( 0.5 * cell_width, 1.5 * cell_height, face ); 42 | else if ( value == 3 ) 43 | llOffsetTexture( 1.5 * cell_width, 1.5 * cell_height, face ); 44 | else if ( value == 4 ) 45 | llOffsetTexture( -1.5 * cell_width, 0.5 * cell_height, face ); 46 | else if ( value == 5 ) 47 | llOffsetTexture( -0.5 * cell_width, 0.5 * cell_height, face ); 48 | else if ( value == 6 ) 49 | llOffsetTexture( 0.5 * cell_width, 0.5 * cell_height, face ); 50 | else if ( value == 7 ) 51 | llOffsetTexture( 1.5 * cell_width, 0.5 * cell_height, face ); 52 | else if ( value == 8 ) 53 | llOffsetTexture( -1.5 * cell_width, -0.5 * cell_height, face ); 54 | else if ( value == 9 ) 55 | llOffsetTexture( -0.5 * cell_width, -0.5 * cell_height, face ); 56 | else if ( value == 10 ) 57 | llOffsetTexture( 0.5 * cell_width, -0.5 * cell_height, face ); 58 | else if ( value == 11 ) 59 | llOffsetTexture( 1.5 * cell_width, -0.5 * cell_height, face ); 60 | else if ( value == 12 ) 61 | llOffsetTexture( -1.5 * cell_width, -1.5 * cell_height, face ); 62 | else if ( value == 13 ) 63 | llOffsetTexture( -0.5 * cell_width, -1.5 * cell_height, face ); 64 | else if ( value == 14 ) 65 | llOffsetTexture( 0.5 * cell_width, -1.5 * cell_height, face ); 66 | else if ( value == 15 ) 67 | llOffsetTexture( 1.5 * cell_width, -1.5 * cell_height, face ); 68 | } 69 | 70 | default 71 | { 72 | state_entry() 73 | { 74 | integer i; 75 | 76 | for ( i = 0; i < llGetNumberOfSides(); i++ ) 77 | display( i, i ); 78 | } 79 | 80 | changed( integer changed_flag ) 81 | { 82 | if ( (changed_flag == CHANGED_SHAPE) || 83 | (changed_flag == CHANGED_SCALE) ) 84 | llResetScript(); 85 | } 86 | } -------------------------------------------------------------------------------- /Scripts/Detect Face Prim/README.md: -------------------------------------------------------------------------------- 1 | For Opensim users, you will need to upload the number texture, then copy its UUID into the script in the appropriate location. -------------------------------------------------------------------------------- /Scripts/Detect Face Prim/fleepgrid_tool_primface_detector_numbergrid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AvaCon/LSL-OpenSim-Script-Library/5f1f4d65ed0e0498288e5307351ac518b2415901/Scripts/Detect Face Prim/fleepgrid_tool_primface_detector_numbergrid.jpg -------------------------------------------------------------------------------- /Scripts/Dialogue Menu SB Dialog.lsl: -------------------------------------------------------------------------------- 1 | //Dialogue Menu SB Dialog 2 | 3 | integer sbDialog(key keyAgent, string strMessage, list lstButtons, integer intChannel) { 4 | integer intHandle; 5 | 6 | lstButtons = 7 | llList2List(lstButtons, -3, -1) + 8 | llList2List(lstButtons, -6, -4) + 9 | llList2List(lstButtons, -9, -7) + 10 | llList2List(lstButtons, -12, -10); 11 | 12 | intHandle = llListen(intChannel, "", keyAgent, ""); 13 | llDialog(keyAgent, strMessage, lstButtons, intChannel); 14 | return intHandle; 15 | } -------------------------------------------------------------------------------- /Scripts/Digital Signs Controller/Digital Sign Vertical.lsl: -------------------------------------------------------------------------------- 1 | string myID="Not Set"; 2 | integer channel=-814591; 3 | integer listen_handle; 4 | string controllerName="Digital Signs Controller"; 5 | 6 | default 7 | { 8 | state_entry() 9 | { 10 | string desc = llGetObjectDesc(); 11 | list items = llParseString2List(desc, [":"], [""]); 12 | if(llGetListLength(items)>1) 13 | { 14 | myID = llStringTrim(llList2String(items, 1),STRING_TRIM); 15 | } 16 | if(myID == "Not Set") 17 | { 18 | llWhisper(0, "Please set this sign's ID in the prim description!"); 19 | llSetObjectDesc("ID: Not Set"); 20 | } else { 21 | llWhisper(0, "Ready with ID: " + myID); 22 | } 23 | listen_handle = llListen(channel, controllerName, NULL_KEY, ""); 24 | } 25 | on_rez(integer count) 26 | { 27 | llResetScript(); 28 | } 29 | changed(integer change) 30 | { 31 | if(change & (CHANGED_REGION | CHANGED_REGION_START | CHANGED_OWNER)) llResetScript(); 32 | } 33 | listen(integer channel, string name, key id, string msg) 34 | { 35 | list items = llParseString2List(msg, [":"], [""]); 36 | if(llGetListLength(items)==1) 37 | { 38 | string cmd=llStringTrim(llList2String(items, 0),STRING_TRIM); 39 | if(cmd=="Query") llRegionSay(channel, llGetObjectName() + " : " + myID + " : " + (string)llGetPos() + " : " +(string)llGetRot() + " : " + llGetTexture(1)); 40 | if(cmd=="Reset") llResetScript(); 41 | } 42 | if(llGetListLength(items)>1) 43 | { 44 | string msgID = llStringTrim(llList2String(items, 0),STRING_TRIM); 45 | if(msgID==myID) 46 | { 47 | string textureUUID=llStringTrim(llList2String(items, 1),STRING_TRIM); 48 | llWhisper(0,"Received command to set texture UUID to: " + textureUUID); 49 | llSetLinkPrimitiveParamsFast(1, [PRIM_TEXTURE, 3, textureUUID, <1.0,1.0,1.0>, <0.0,0.0,0.0>, 270*DEG_TO_RAD ]); 50 | llSetLinkPrimitiveParamsFast(1, [PRIM_TEXTURE, 1, textureUUID, <1.0,1.0,1.0>, <0.0,0.0,0.0>, 270*DEG_TO_RAD ]); 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Scripts/Digital Signs Controller/Digital Sign.lsl: -------------------------------------------------------------------------------- 1 | string myID="Not Set"; 2 | integer channel=-814591; 3 | integer listen_handle; 4 | string controllerName="Digital Signs Controller"; 5 | 6 | default 7 | { 8 | state_entry() 9 | { 10 | string desc = llGetObjectDesc(); 11 | list items = llParseString2List(desc, [":"], [""]); 12 | if(llGetListLength(items)>1) 13 | { 14 | myID = llStringTrim(llList2String(items, 1),STRING_TRIM); 15 | } 16 | if(myID == "Not Set") 17 | { 18 | llWhisper(0, "Please set this sign's ID in the prim description!"); 19 | llSetObjectDesc("ID: Not Set"); 20 | } else { 21 | llWhisper(0, "Ready with ID: " + myID); 22 | } 23 | listen_handle = llListen(channel, controllerName, NULL_KEY, ""); 24 | } 25 | on_rez(integer count) 26 | { 27 | llResetScript(); 28 | } 29 | changed(integer change) 30 | { 31 | if(change & (CHANGED_REGION | CHANGED_REGION_START | CHANGED_OWNER)) llResetScript(); 32 | } 33 | listen(integer channel, string name, key id, string msg) 34 | { 35 | list items = llParseString2List(msg, [":"], [""]); 36 | if(llGetListLength(items)==1) 37 | { 38 | string cmd=llStringTrim(llList2String(items, 0),STRING_TRIM); 39 | if(cmd=="Query") llRegionSay(channel, llGetObjectName() + " : " + myID + " : " + (string)llGetPos() + " : " +(string)llGetRot() + " : " + llGetTexture(1)); 40 | if(cmd=="Reset") llResetScript(); 41 | } 42 | if(llGetListLength(items)>1) 43 | { 44 | string msgID = llStringTrim(llList2String(items, 0),STRING_TRIM); 45 | if(msgID==myID) 46 | { 47 | string textureUUID=llStringTrim(llList2String(items, 1),STRING_TRIM); 48 | llWhisper(0,"Received command to set texture UUID to: " + textureUUID); 49 | llSetPrimitiveParams([PRIM_TEXTURE, 3, textureUUID, <1.0,1.0,1.0>, <0.0,0.0,0.0>, 270*DEG_TO_RAD ]); 50 | llSetPrimitiveParams([PRIM_TEXTURE, 1, textureUUID, <1.0,1.0,1.0>, <0.0,0.0,0.0>, 270*DEG_TO_RAD ]); 51 | } 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /Scripts/Digital Signs Controller/Digital Signs Controller.lsl: -------------------------------------------------------------------------------- 1 | list buttons = ["Status", "Template", "Program", "Reset"]; 2 | string dialogInfo = "\nUse Scan Signs to get a list of all Digital Signs and their state in the Region via Notecard. Edit the notecard and place it in this prims inventory, then choose Program Signs to set each sign's texture. Reset instructs all signs to re-read their ID tag."; 3 | 4 | string myName="Digital Signs Controller"; 5 | 6 | integer debug=1; 7 | key ToucherID; 8 | integer dialogChannel; 9 | integer listenHandle1; 10 | 11 | integer signsChannel=-814591; 12 | integer listenHandle2; 13 | 14 | list queryResult; 15 | integer querying=0; 16 | 17 | string noteCardStatusName="Digital Signs Status Report"; 18 | string noteCardTemplateName="Digital Signs Settings Template"; 19 | string noteCardProgramName="Digital Signs Settings"; 20 | 21 | list ListItemDeleteAllButOne(list mylist, string element) 22 | { 23 | integer notdone=1; 24 | while(notdone) 25 | { 26 | integer placeinlist = llListFindList(mylist, [element]); 27 | if(placeinlist != -1) mylist = llDeleteSubList(mylist, placeinlist, placeinlist); 28 | else notdone=0; 29 | //if(debug) llWhisper(0, "ListItemDeleteAllButOne: " + element + " | " + (string)mylist + " | " + placeinlist); 30 | } 31 | mylist = [element] + mylist; 32 | return mylist; 33 | } 34 | 35 | makeStatusNotecard() 36 | { 37 | integer ll=llGetListLength(queryResult); 38 | if(ll>0) 39 | { 40 | string queryLine; 41 | list noteCard; 42 | integer i=0; 43 | noteCard = ["// This is a status notecard showing the current settings information for all Digital Signs on the region."]; 44 | noteCard += ["// Each Digital Sign has an ID in it's prim Description field in the format ID: MyStringID "]; 45 | noteCard += ["// We use MyStringID as an address to which we can send new settings for things like the sign texture."]; 46 | noteCard += [""]; 47 | for(; i0) 70 | { 71 | string queryLine; 72 | list signList; 73 | list noteCard; 74 | integer i=0; 75 | for(; i0) 119 | { 120 | for(i=1; i, 1.0); 141 | } 142 | on_rez(integer count) 143 | { 144 | llResetScript(); 145 | } 146 | touch_start(integer num_detected) 147 | { 148 | ToucherID = llDetectedKey(0); 149 | llListenRemove(listenHandle1); 150 | llListenRemove(listenHandle2); 151 | listenHandle1 = llListen(dialogChannel, "", ToucherID, ""); 152 | llDialog(ToucherID, dialogInfo, buttons, dialogChannel); 153 | llSetTimerEvent(60.0); // Here we set a time limit for responses 154 | } 155 | timer() 156 | { 157 | llSetTimerEvent(0.0); 158 | llListenRemove(listenHandle1); 159 | llListenRemove(listenHandle2); 160 | if(querying==1) 161 | { 162 | makeStatusNotecard(); 163 | querying=0; 164 | } 165 | if(querying==2) 166 | { 167 | makeTemplateNotecard(); 168 | querying=0; 169 | } 170 | } 171 | listen(integer channel, string name, key id, string msg) 172 | { 173 | if(channel==dialogChannel) 174 | { 175 | llListenRemove(listenHandle1); 176 | if(msg == llList2String(buttons, 0)) //list 177 | { 178 | listenHandle2 = llListen(signsChannel, "", NULL_KEY, ""); 179 | queryResult = []; 180 | querying=1; 181 | llRegionSay(signsChannel, "Query"); 182 | llSetTimerEvent(5.0); 183 | llWhisper(0, "Please wait while we query the status of all the Digital Signs on the region...."); 184 | } 185 | if(msg == llList2String(buttons, 1)) //template 186 | { 187 | listenHandle2 = llListen(signsChannel, "", NULL_KEY, ""); 188 | queryResult = []; 189 | querying=2; 190 | llRegionSay(signsChannel, "Query"); 191 | llSetTimerEvent(5.0); 192 | llWhisper(0, "Please wait while we create a template notecard for all of the Digital Signs on the region...."); 193 | } 194 | if(msg == llList2String(buttons, 2)) //program 195 | { 196 | list data=readProgramNotecard(); 197 | integer i=0; 198 | integer nl=llGetListLength(data); 199 | if(nl>0) 200 | { 201 | llWhisper(0,"Sending the following data to all Digital Signs:"); 202 | for(;i1) 13 | { 14 | myID = llStringTrim(llList2String(items, 1),STRING_TRIM); 15 | } 16 | if(myID == "Not Set") 17 | { 18 | llWhisper(0, "Please set this sign's ID in the prim description!"); 19 | llSetObjectDesc("ID: Not Set"); 20 | } else { 21 | llWhisper(0, "Ready with ID: " + myID); 22 | } 23 | listen_handle = llListen(channel, controllerName, NULL_KEY, ""); 24 | } 25 | on_rez(integer count) 26 | { 27 | llResetScript(); 28 | } 29 | changed(integer change) 30 | { 31 | if(change & (CHANGED_REGION | CHANGED_REGION_START | CHANGED_OWNER)) llResetScript(); 32 | } 33 | listen(integer channel, string name, key id, string msg) 34 | { 35 | list items = llParseString2List(msg, [":"], [""]); 36 | if(llGetListLength(items)==1) 37 | { 38 | string cmd=llStringTrim(llList2String(items, 0),STRING_TRIM); 39 | if(cmd=="Query") llRegionSay(channel, llGetObjectName() + " : " + myID + " : " + (string)llGetPos() + " : " +(string)llGetRot() + " : " + llGetTexture(1)); 40 | if(cmd=="Reset") llResetScript(); 41 | } 42 | if(llGetListLength(items)>1) 43 | { 44 | string msgID = llStringTrim(llList2String(items, 0),STRING_TRIM); 45 | if(msgID==myID) 46 | { 47 | string textureUUID=llStringTrim(llList2String(items, 1),STRING_TRIM); 48 | llWhisper(0,"Received command to set texture UUID to: " + textureUUID); 49 | llSetPrimitiveParams([PRIM_TEXTURE, 1, textureUUID, <16.0,24.0,2.0>, <0.0,0.0,0.0>, 0*DEG_TO_RAD ]); 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Scripts/Digital Signs Controller/NOTECARD - Digital Signs README.txt: -------------------------------------------------------------------------------- 1 | -= NOTECARD: Digital Signs README =- 2 | 3 | This is the Digital Signs Controller by Jak Daniels. 4 | 5 | License: Creative Commons Attribution-ShareAlike 3.0 6 | 7 | This controller controls any Digital Signs in the region over a chat channel. It can set a single signs' texture or a group of signs' textures by addressing individual or groups of signs using an ID tag in the signs description field. 8 | 9 | The controller can create a report of all signs in the region and also a template notecard which can then be customised, 10 | renanmed and used to re-program all the signs. This is useful on a conference grid for example where on each region 11 | there may be many many signs that need to display the same thing, but that need to be changed each year. 12 | 13 | The notecard used to program the signs must be called 'Digital Signs Settings' and placed within the inventory of this 14 | prim. I recommend that you first create a template notcard. This will list all the IDs found and the current texture UUIDs. 15 | Then edit the template with any new textures that you want, rename the notecard and use it to reprogram the signs. 16 | 17 | The template notecard explains more about the format used within the notecard for controlling the signs. 18 | 19 | Any questions? Contact Jak Daniels 20 | 21 | LICENSE: 22 | THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. 23 | BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. 24 | 1. Definitions 25 | "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. 26 | 27 | "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined below) for the purposes of this License. 28 | 29 | "Creative Commons Compatible License" means a license that is listed at http://creativecommons.org/compatiblelicenses that has been approved by Creative Commons as being essentially equivalent to this License, including, at a minimum, because that license: (i) contains terms that have the same purpose, meaning and effect as the License Elements of this License; and, (ii) explicitly permits the relicensing of adaptations of works made available under that license under this License or a Creative Commons jurisdiction license with the same License Elements as this License. 30 | 31 | "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. 32 | 33 | "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike. 34 | 35 | "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. 36 | 37 | "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. 38 | 39 | "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. 40 | 41 | "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. 42 | 43 | "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. 44 | 45 | "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. 46 | 2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. 47 | 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: 48 | to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; 49 | 50 | to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; 51 | 52 | to Distribute and Publicly Perform the Work including as incorporated in Collections; and, 53 | 54 | to Distribute and Publicly Perform Adaptations. 55 | For the avoidance of doubt: 56 | 57 | Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; 58 | 59 | Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and, 60 | 61 | Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License. 62 | The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved. 63 | 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: 64 | You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested. 65 | 66 | You may Distribute or Publicly Perform an Adaptation only under the terms of: (i) this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible License. If you license the Adaptation under one of the licenses mentioned in (iv), you must comply with the terms of that license. If you license the Adaptation under the terms of any of the licenses mentioned in (i), (ii) or (iii) (the "Applicable License"), you must comply with the terms of the Applicable License generally and the following provisions: (I) You must include a copy of, or the URI for, the Applicable License with every copy of each Adaptation You Distribute or Publicly Perform; (II) You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License; (III) You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform; (IV) when You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License. 67 | 68 | If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Ssection 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. 69 | 70 | Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise. 71 | 5. Representations, Warranties and Disclaimer 72 | UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. 73 | 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 74 | 7. Termination 75 | This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. 76 | 77 | Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. 78 | 8. Miscellaneous 79 | Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. 80 | 81 | Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. 82 | 83 | If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. 84 | 85 | No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. 86 | 87 | This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. 88 | 89 | The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. 90 | Creative Commons Notice 91 | Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. 92 | Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of the License. 93 | Creative Commons may be contacted at http://creativecommons.org/. -------------------------------------------------------------------------------- /Scripts/Digital Signs Controller/NOTECARD - Digital Signs Settings.txt: -------------------------------------------------------------------------------- 1 | // This is a template notecard containing the current settings information for all Digital Signs on the region. 2 | // Each Digital Sign has an ID in it's prim Description field in the format ID: MyStringID 3 | // In this notecard you can target one or more Digital Sign IDs and send them settings data. 4 | // The format is: 5 | // MyStringID : TextureUUID 6 | // ....one per line. MyStringID is the Sign's ID string, TextureUUID is the UUID of a texture that the sign should display. 7 | 8 | // The data below is what is in the region at the moment and is provided as a template. 9 | // You should edit this notecard to substitute new settings for each sign ID, then rename it to 'Digital Signs Settings' 10 | // before you *replace* it back in the Controller's inventory. 11 | // Please look out for signs that currently have the same ID, but different textures. 12 | // You'll *will* need to fix the ID on these signs locally if you're sure the textures should be different, because we'll 13 | // overwrite them all by the (last) ID read from this file when you hit the 'Program' button! 14 | 15 | Welcome Kiosk : 20bc0a88-89d6-44ce-8507-add3bec734b2 16 | Track Banner : 20bc0a88-89d6-44ce-8507-add3bec734b2 17 | Streetlight Banner : 20bc0a88-89d6-44ce-8507-add3bec734b2 18 | OSCC Banner : 20bc0a88-89d6-44ce-8507-add3bec734b2 19 | Booth Floor : 20bc0a88-89d6-44ce-8507-add3bec734b2 -------------------------------------------------------------------------------- /Scripts/Fade Prim to Transparent and Back Again Cycle.lsl: -------------------------------------------------------------------------------- 1 | // This delay number is the amount of time to delay in between each step while fading in and out. There are currently 10 steps. In other words, the smaller this number is the quicker the fade. Using really low numbers will result in the fastest possible fade (but may stutter/lag more visibly) By JESSICA HOPPER (@jesshop23) and CHRISTINA NG 2 | 3 | float delay = 0.20; 4 | 5 | // ******************************************* 6 | 7 | float i; 8 | float j; 9 | 10 | fadeout() 11 | { 12 | for (i = 10; i > 0; i--) 13 | { 14 | llSetLinkAlpha(LINK_SET, (i/10), ALL_SIDES); 15 | llSleep(delay); 16 | } 17 | 18 | llSetLinkAlpha(LINK_SET, 0, ALL_SIDES); 19 | } 20 | 21 | fadein() 22 | { 23 | for (j = 0; j < 10; j++) 24 | { 25 | llSetLinkAlpha(LINK_SET, (j/10), ALL_SIDES); 26 | llSleep(delay); 27 | } 28 | 29 | llSetLinkAlpha(LINK_SET, 1, ALL_SIDES); 30 | } 31 | 32 | 33 | default 34 | { 35 | 36 | state_entry() 37 | { 38 | llSetTimerEvent(5); 39 | } 40 | timer() 41 | { 42 | fadeout(); 43 | llSleep(5); 44 | fadein(); 45 | llSleep(5); 46 | 47 | } 48 | } -------------------------------------------------------------------------------- /Scripts/Find Link Number.lsl: -------------------------------------------------------------------------------- 1 | //By: Xeno Cao 2 | //(Open Source) Please Share or feel free to mod ^_^ 3 | //Please do not sell this script as is. 4 | // 5 | //This is a tool I like to use when building things I need to know wich number the prims are, for scripting. 6 | //Just drop in the Main/Adult prim of the linked object. 7 | //In this newer version the script doesn't self clean and you can now click any prim and find it's link number in the object. 8 | //Makes it a little more helpful. Enjoy. 9 | 10 | default 11 | { 12 | state_entry() 13 | { 14 | llSay(0, "My Link Number is "+(string)llGetLinkNumber()); 15 | } 16 | touch_start(integer num_detected) 17 | { 18 | integer i = 0; 19 | for(; i, FALSE); 44 | } 45 | else 46 | { 47 | vector fwd= llRot2Fwd(llGetRot()); 48 | fwd = llVecNorm(fwd); 49 | fwd *= speed; 50 | llSetForce(fwd, FALSE); 51 | } 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /Scripts/Flight Script(Andrew Linden).lsl: -------------------------------------------------------------------------------- 1 | //Flight Script - Andrew Linden 2 | 3 | // Simple airplane script example 4 | 5 | // THIS SCRIPT IS PUBLIC DOMAIN! Do not delete the credits at the top of this script! 6 | 7 | // Nov 25, 2003 - created by Andrew Linden and posted in the Second Life scripting forum 8 | // Jan 05, 2004 - Cubey Terra - minor changes: customized controls, added enable/disable physics events 9 | // Feel free to copy, modify, and use this script. 10 | 11 | // Always give credit to Andrew Linden and all people who modify it in a readme or in the object description. 12 | 13 | 14 | 15 | // assumes that the root primitive is oriented such that its 16 | // local x-axis points toward the nose of the plane, and its 17 | // local z-axis points toward the top 18 | 19 | // control flags that we set later 20 | integer gAngularControls = 0; 21 | integer gLinearControls = 0; 22 | 23 | // we keep track of angular history for more responsive turns 24 | integer gOldAngularLevel = 0; 25 | 26 | // the linear motor uses an accumulator model rather than keeping track 27 | // of the linear control level history 28 | vector gLinearMotor = <0, 0, 0>; 29 | 30 | default 31 | { 32 | state_entry() 33 | { 34 | llSetSitText("Fly"); 35 | llCollisionSound("", 0.0); 36 | 37 | // the sit and camera placement is very shape dependent 38 | // so modify these to suit your vehicle 39 | llSitTarget(<0.6, 0.0, 0.20>, ZERO_ROTATION); 40 | llSetCameraEyeOffset(<-10.0, 0.0, 2.0> ); 41 | llSetCameraAtOffset(<3.0, 0.0, 1.0> ); 42 | 43 | llSetVehicleType(VEHICLE_TYPE_AIRPLANE); 44 | 45 | // weak angular deflection 46 | llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0.1); 47 | llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 1.0); 48 | 49 | // strong linear deflection 50 | llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 1.0); 51 | llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 0.2); 52 | 53 | // somewhat responsive linear motor 54 | llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_TIMESCALE, 0.5); 55 | llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 20); 56 | 57 | // somewhat responsive angular motor, but with 3 second decay timescale 58 | llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_TIMESCALE, 0.5); 59 | llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 3); 60 | 61 | // very weak friction 62 | //llSetVehicleVectorParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, <1000.0, 1000.0, 1000.0> ); // CUBEY - original line 63 | llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <200, 20, 20> ); // CUBEY - increased friction 64 | llSetVehicleVectorParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, <1000.0, 1000.0, 1000.0> ); 65 | 66 | llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.65); // almost wobbly - CUBEY - increased from .25 to improve stability 67 | llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 1.5); // mediocre response 68 | 69 | llSetVehicleFloatParam(VEHICLE_BANKING_EFFICIENCY, 0.4); // medium strength 70 | llSetVehicleFloatParam(VEHICLE_BANKING_TIMESCALE, 0.1); // very responsive 71 | llSetVehicleFloatParam(VEHICLE_BANKING_MIX, 0.95); // more banking when moving 72 | 73 | // hover can be better than sliding along the ground during takeoff and landing 74 | // but it only works over the terrain (not objects) 75 | //llSetVehicleFloatParam(VEHICLE_HOVER_HEIGHT, 3.0); 76 | //llSetVehicleFloatParam(VEHICLE_HOVER_EFFICIENCY, 0.5); 77 | //llSetVehicleFloatParam(VEHICLE_HOVER_TIMESCALE, 2.0); 78 | //llSetVehicleFlags(VEHICLE_FLAG_HOVER_UP_ONLY); 79 | 80 | // non-zero buoyancy helps the airplane stay up 81 | // set to zero if you don't want this crutch 82 | llSetVehicleFloatParam(VEHICLE_BUOYANCY, 0.2); 83 | 84 | // define these here for convenience later 85 | // CUBEY - modified these as per Shadow's prefs 86 | gAngularControls = CONTROL_RIGHT | CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT | CONTROL_BACK | CONTROL_FWD; 87 | gLinearControls = CONTROL_UP | CONTROL_DOWN; 88 | 89 | llSetStatus(STATUS_PHYSICS, FALSE); //CUBEY - ensure that physics are disabled when plane is rezzed so it doesn't fly off 90 | } 91 | 92 | changed(integer change) 93 | { 94 | if (change & CHANGED_LINK) 95 | { 96 | key agent = llAvatarOnSitTarget(); 97 | if (agent) 98 | { 99 | if (agent != llGetOwner()) 100 | { 101 | // only the owner can use this vehicle 102 | llSay(0, "You aren't the owner -- only the owner can fly this plane."); 103 | llUnSit(agent); 104 | llPushObject(agent, <0,0,10>, ZERO_VECTOR, FALSE); 105 | } 106 | else 107 | { 108 | // clear linear motor on successful sit 109 | gLinearMotor = <0, 0, 0>; 110 | llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, gLinearMotor); 111 | 112 | //llSetStatus(STATUS_PHYSICS, TRUE); 113 | llSetVehicleFloatParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, 1000.0); 114 | llSetVehicleFloatParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, 1000.0); 115 | llRequestPermissions(agent, PERMISSION_TRIGGER_ANIMATION | PERMISSION_TAKE_CONTROLS); 116 | } 117 | } 118 | else 119 | { 120 | // stop the motors 121 | gLinearMotor = <0, 0, 0>; 122 | llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, gLinearMotor); 123 | llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, gLinearMotor); 124 | 125 | // use friction to stop the vehicle rather than pinning it in place 126 | //llSetStatus(STATUS_PHYSICS, FALSE); 127 | llSetVehicleFloatParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, 1.0); 128 | llSetVehicleFloatParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, 1.0); 129 | 130 | // driver is getting up 131 | llReleaseControls(); 132 | llStopAnimation("sit"); 133 | llSetStatus(STATUS_PHYSICS, FALSE); //CUBEY - turn off physics to make sure the parked plane can't be moved 134 | } 135 | } 136 | 137 | } 138 | 139 | run_time_permissions(integer perm) 140 | { 141 | if (perm) 142 | { 143 | llStartAnimation("sit"); 144 | llTakeControls(gAngularControls | gLinearControls, TRUE, FALSE); 145 | llSetStatus(STATUS_PHYSICS, TRUE); //CUBEY - enable physics when avatar sits 146 | } 147 | } 148 | 149 | control(key id, integer level, integer edge) 150 | { 151 | // only change linear motor if one of the linear controls are pressed 152 | vector motor; 153 | integer motor_changed = level & gLinearControls; 154 | if (motor_changed) 155 | { 156 | if(level & CONTROL_UP) //CUBEY 157 | { 158 | if (gLinearMotor.x < 0) 159 | { 160 | gLinearMotor.x = 0; 161 | } 162 | else if (gLinearMotor.x < 30) 163 | { 164 | gLinearMotor.x += 5; 165 | } 166 | motor_changed = TRUE; 167 | } 168 | if(level & CONTROL_DOWN) //CUBEY 169 | { 170 | if (gLinearMotor.x > 0) 171 | { 172 | gLinearMotor.x = 0; 173 | } 174 | else if (gLinearMotor.x > -30) 175 | { 176 | gLinearMotor.x -= 5; 177 | }; 178 | motor_changed = TRUE; 179 | } 180 | llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, gLinearMotor); 181 | } 182 | 183 | // only change angular motor if the angular levels have changed 184 | motor_changed = (edge & gOldAngularLevel) + (level & gAngularControls); 185 | if (motor_changed) 186 | { 187 | motor = <0,0,0>; 188 | if(level & (CONTROL_RIGHT|CONTROL_ROT_RIGHT)) 189 | { 190 | // add roll component ==> triggers banking behavior 191 | motor.x += 10; 192 | } 193 | if(level & (CONTROL_LEFT|CONTROL_ROT_LEFT)) 194 | { 195 | motor.x -= 10; 196 | } 197 | if(level & (CONTROL_BACK)) // CUBEY 198 | { 199 | // add pitch component ==> causes vehicle lift nose (in local frame) 200 | motor.y -= 8; 201 | } 202 | if(level & (CONTROL_FWD)) // CUBEY 203 | { 204 | motor.y += 8; 205 | } 206 | llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, motor); 207 | } 208 | // store the angular level history for the next control callback 209 | gOldAngularLevel = level & gAngularControls; 210 | } 211 | } -------------------------------------------------------------------------------- /Scripts/Floating Text.lsl: -------------------------------------------------------------------------------- 1 | //Floating Text 2 | 3 | default 4 | { 5 | state_entry() 6 | { 7 | llAllowInventoryDrop(TRUE); 8 | llSetText("FREE GIFTS!", <1,1,1>, 1.5); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /Scripts/Force Mouselook.lsl: -------------------------------------------------------------------------------- 1 | default 2 | { 3 | state_entry() 4 | { 5 | llForceMouselook(TRUE); // Forces sitting avatars into mouselook. 6 | } 7 | } -------------------------------------------------------------------------------- /Scripts/Get Linknumber.lsl: -------------------------------------------------------------------------------- 1 | // Get LinkNumber Script 2 | // 3 | // Written by Joel Gross (SL: Ringo Moonstone) 4 | // 5 | // Distributed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. 6 | // http://creativecommons.org/licenses/by-nc-sa/3.0/ 7 | // 8 | // -------------------------------------------------- 9 | 10 | default 11 | { 12 | state_entry() 13 | { 14 | llOwnerSay("Link Number:" + (string)llGetLinkNumber()); 15 | } //end state_entry 16 | 17 | link_message(integer sender_num, integer num, string dialog, key id) 18 | { 19 | // if(dialog == "getLinkNumbers"){ 20 | // llOwnerSay("Blank Panel Link Number:" + (string)llGetLinkNumber()); 21 | // } 22 | } 23 | 24 | } //end default -------------------------------------------------------------------------------- /Scripts/Give All Contents 2.1.lsl: -------------------------------------------------------------------------------- 1 | //GiveAllContents 2.1 2 | 3 | // Copyright 2004, Trimming Hedges. Released to the public domain. 4 | 5 | // This is a simple script that gives everything in a box to the person who clicked. 6 | // By default, it will only give items to the owner of the box. 7 | 8 | // I wrote this because of all the texture bundles that are given out. It's really a PAIN 9 | // to move a lot of textures or other contents out of a box. This speeds that up. 10 | 11 | // This is NOT a vending script. You can use this script to give everything in a box to someone, by changing 'owneronly' to be 0. BUT: 12 | // 13 | // I suggest not using this script in an area where several people are going to touch it at once, because giving inventory is slow. 14 | // Version 2.0 of this script now detects multiple simultaneous touches: it is still slow, but it should work better at classes or events. 15 | 16 | // THIS IS NOT A VENDING SCRIPT. It gives items away, it does NOT SELL THEM. (You don't need a script for most vending anyway.) 17 | // This script doesn't give itself away. If you want it to, put it in the box, and set it to not running. 18 | // Then rename a copy and put that in the box too. The renamed copy should be the running one. 19 | // Rename it FIRST, I had weird issues with renaming it when it was already in 20 | // the box. (version 1.2.12 of SL.) 21 | 22 | integer owneronly = 1; 23 | key owner; 24 | 25 | default 26 | { 27 | state_entry() 28 | { 29 | owner = llGetOwner(); 30 | } 31 | 32 | touch_start(integer total_number) 33 | { 34 | integer i; 35 | for (i=0;i 0) 58 | { 59 | for (k=0; k 0) 58 | { 59 | for (k=0; k, ALL_SIDES); 37 | 38 | llSay(0, "Deactivated."); 39 | 40 | llSetText("Group Privacy\nOff\n\nTouch to Turn On", <1,1,1>, 1.0); 41 | } 42 | 43 | on() 44 | { 45 | status = TRUE; 46 | 47 | llSensorRepeat("", NULL_KEY, AGENT, RANGE, PI, RATE); 48 | 49 | llSetColor(<1,0,0>, ALL_SIDES); 50 | 51 | llSay(0, "Activated while group memebers are present."); 52 | 53 | llSetText("Group Privacy\nOn\n\nTouch to Turn Off", <1,1,1>, 0.5); 54 | } 55 | 56 | boot(key id) 57 | { 58 | if (llOverMyLand(id) == TRUE) 59 | { 60 | llUnSit(id); 61 | 62 | llEjectFromLand(id); 63 | 64 | llAddToLandBanList(id, duration); // Hour of Ban 65 | } 66 | } 67 | 68 | default 69 | { 70 | state_entry() 71 | { 72 | off(); 73 | } 74 | 75 | touch_start(integer num_detected) 76 | { 77 | if (llGetLandOwnerAt(llGetPos()) != llGetOwner()) 78 | { 79 | llSay(0, "Deed device to match land group."); 80 | 81 | return; 82 | } 83 | 84 | if (llSameGroup(llDetectedKey(0)) == TRUE) 85 | { 86 | if (status == FALSE) 87 | { 88 | on(); 89 | } 90 | else 91 | { 92 | off(); 93 | } 94 | } 95 | 96 | else 97 | { 98 | llSay(0, "Authorized to group members only."); 99 | } 100 | } 101 | 102 | sensor(integer num_detected) 103 | { 104 | integer i; 105 | 106 | integer group_members = 0; 107 | 108 | for (i = 0; i != num_detected; i++) 109 | { 110 | if (llSameGroup(llDetectedKey(i)) == FALSE) 111 | { 112 | boot(llDetectedKey(i)); 113 | } 114 | 115 | else 116 | { 117 | llRemoveFromLandBanList(llDetectedKey(i)); 118 | 119 | group_members++; 120 | } 121 | } 122 | 123 | if (group_members == 0) 124 | { 125 | off(); 126 | } 127 | } 128 | 129 | no_sensor() 130 | { 131 | off(); 132 | } 133 | } -------------------------------------------------------------------------------- /Scripts/Height Detector.lsl: -------------------------------------------------------------------------------- 1 | //Height Detector 2 | 3 | //Title: Height Detector 4 | //Date:11-16-2003 7:24 PM 5 | //Scripter: Francis Chung 6 | //ATTENTION GET RID OF THE // IN FRONT OF "DEFAULT" TO ACTIVATE THIS SCRIPT 7 | 8 | //default 9 | { 10 | state_entry() 11 | { 12 | llSetStatus(STATUS_PHANTOM, TRUE); 13 | llSetText( "Touch to find out your height", < 1,1,1>, 1 ); 14 | } 15 | 16 | touch_start(integer total_number) 17 | { 18 | key avatar; 19 | string name; 20 | vector size; 21 | vector pos; 22 | string saeheight = ""; 23 | float heightfeet; 24 | 25 | avatar = llDetectedKey(0); 26 | size = llGetAgentSize( avatar ); 27 | name = llDetectedName(0); 28 | pos = llDetectedPos(0); 29 | 30 | heightfeet = size.z * 3.28083; 31 | saeheight = (string)((integer) llFloor(heightfeet)) + " feet "; 32 | 33 | heightfeet -= llFloor(heightfeet); 34 | saeheight += (string)((integer)(llRound(heightfeet * 12))) + " inches"; 35 | 36 | llSay( 0, name + " is " + (string)size.z + " m (" + saeheight + ") tall. (counting your shoes)" ); 37 | 38 | size.x = 0.5; 39 | size.y = 0.5; 40 | llSetScale( size ); 41 | // pos.x += 0.5; 42 | llSetPos( pos ); 43 | 44 | } 45 | } -------------------------------------------------------------------------------- /Scripts/Jetpack(SL).lsl: -------------------------------------------------------------------------------- 1 | integer moving = FALSE; 2 | integer flying = FALSE; 3 | 4 | default 5 | { 6 | attach(key on) 7 | { 8 | if (on != NULL_KEY) 9 | { 10 | llLoopSound("boom", 1.0); 11 | moving = TRUE; 12 | integer perm = llGetPermissions(); 13 | 14 | if (perm != (PERMISSION_TAKE_CONTROLS)) 15 | { 16 | llRequestPermissions(on, PERMISSION_TAKE_CONTROLS); 17 | } 18 | else 19 | { 20 | llTakeControls(CONTROL_FWD | CONTROL_ML_LBUTTON, TRUE, TRUE); 21 | llSetTimerEvent(0.5); 22 | } 23 | } 24 | else 25 | { 26 | moving = FALSE; 27 | llStopSound(); 28 | llReleaseControls(); 29 | llSetTimerEvent(0.0); 30 | } 31 | } 32 | 33 | timer() 34 | { 35 | if(llGetAgentInfo(llGetOwner()) & AGENT_FLYING) 36 | { 37 | if(flying == FALSE) 38 | { 39 | 40 | 41 | vector I_start_color = <1,1,1>; 42 | vector I_end_color = <0.5,0,0.2>; 43 | 44 | float I_start_alpha = 0.0; 45 | float I_end_alpha = 1.0; 46 | 47 | vector I_start_scale = <0.3,0.3,0.0>; 48 | vector I_end_scale = <0,0,0>; 49 | 50 | float I_particle_age = 1.5; 51 | 52 | float I_inner_angle = PI; 53 | float I_outer_angle = PI; 54 | vector I_spin_speed = <0.0,0.0,0.0>; 55 | 56 | vector I_particle_accel = <0.0,0.0,0.0>; 57 | 58 | float I_burst_rate = 0.1; 59 | integer I_burst_count = 50; 60 | float I_burst_radius = 0.05; 61 | float I_min_speed = 0.1; 62 | float I_max_speed = 0.65; 63 | 64 | float I_source_age = 0.0; // 0.0 = forever 65 | 66 | string I_particle_texture = "particle_glowWhite2"; //if not defined, the default particle 67 | 68 | key I_target; //the target of your particles if they use a follow mask 69 | 70 | 71 | llParticleSystem([ 72 | PSYS_PART_FLAGS, 73 | PSYS_PART_INTERP_COLOR_MASK | 74 | PSYS_PART_INTERP_SCALE_MASK | 75 | 76 | PSYS_PART_FOLLOW_SRC_MASK | 77 | PSYS_PART_FOLLOW_VELOCITY_MASK | 78 | 79 | PSYS_PART_EMISSIVE_MASK, 80 | 81 | 82 | PSYS_PART_START_COLOR, I_start_color, 83 | PSYS_PART_END_COLOR, I_end_color, 84 | 85 | 86 | 87 | PSYS_PART_START_SCALE, I_start_scale, 88 | PSYS_PART_END_SCALE, I_end_scale, 89 | 90 | PSYS_PART_MAX_AGE, I_particle_age, 91 | 92 | 93 | PSYS_SRC_PATTERN, 94 | PSYS_SRC_PATTERN_ANGLE_CONE, 95 | 96 | PSYS_SRC_INNERANGLE, I_inner_angle, 97 | PSYS_SRC_OUTERANGLE, I_outer_angle, 98 | PSYS_SRC_OMEGA, I_spin_speed, 99 | 100 | PSYS_SRC_ACCEL, I_particle_accel, 101 | 102 | PSYS_SRC_TEXTURE, I_particle_texture, 103 | 104 | PSYS_SRC_BURST_RATE, I_burst_rate, 105 | PSYS_SRC_BURST_PART_COUNT, I_burst_count, 106 | PSYS_SRC_BURST_RADIUS, I_burst_radius, 107 | PSYS_SRC_BURST_SPEED_MIN, I_min_speed, 108 | PSYS_SRC_BURST_SPEED_MAX, I_max_speed, 109 | 110 | PSYS_SRC_MAX_AGE, I_source_age 111 | ]); 112 | } 113 | 114 | flying = TRUE; 115 | llMessageLinked(LINK_SET, 0, "fly", ""); 116 | //..................IDLE............................... 117 | 118 | } 119 | else 120 | { 121 | flying = FALSE; 122 | llMessageLinked(LINK_SET, 0, "nofly", ""); 123 | llParticleSystem([]); 124 | } 125 | } 126 | 127 | 128 | 129 | run_time_permissions(integer perm) 130 | { 131 | if (perm) 132 | { 133 | llTakeControls(CONTROL_FWD | CONTROL_ML_LBUTTON, TRUE, TRUE); 134 | llSetTimerEvent(0.1); 135 | } 136 | } 137 | 138 | control(key owner, integer level, integer edge) 139 | { 140 | if(flying) 141 | { // Look for the jump key going down for the first time. 142 | if (!(level & CONTROL_FWD)) 143 | { 144 | llMessageLinked(LINK_SET, FALSE, "stop", ""); 145 | 146 | 147 | //..................IDLE............................... 148 | 149 | 150 | vector I_start_color = <1,1,1>; 151 | vector I_end_color = <0.5,0,0.2>; 152 | 153 | float I_start_alpha = 0.0; 154 | float I_end_alpha = 1.0; 155 | 156 | vector I_start_scale = <0.3,0.3,0.0>; 157 | vector I_end_scale = <0,0,0>; 158 | 159 | float I_particle_age = 1.5; 160 | 161 | float I_inner_angle = PI; 162 | float I_outer_angle = PI; 163 | vector I_spin_speed = <0.0,0.0,0.0>; 164 | 165 | vector I_particle_accel = <0.0,0.0,0.0>; 166 | 167 | float I_burst_rate = 0.1; 168 | integer I_burst_count = 50; 169 | float I_burst_radius = 0.05; 170 | float I_min_speed = 0.1; 171 | float I_max_speed = 0.65; 172 | 173 | float I_source_age = 0.0; // 0.0 = forever 174 | 175 | string I_particle_texture = "particle_glowWhite2"; //if not defined, the default particle 176 | 177 | key I_target; //the target of your particles if they use a follow mask 178 | 179 | 180 | llParticleSystem([ 181 | PSYS_PART_FLAGS, 182 | PSYS_PART_INTERP_COLOR_MASK | 183 | PSYS_PART_INTERP_SCALE_MASK | 184 | 185 | PSYS_PART_FOLLOW_SRC_MASK | 186 | PSYS_PART_FOLLOW_VELOCITY_MASK | 187 | 188 | PSYS_PART_EMISSIVE_MASK, 189 | 190 | 191 | PSYS_PART_START_COLOR, I_start_color, 192 | PSYS_PART_END_COLOR, I_end_color, 193 | 194 | 195 | 196 | PSYS_PART_START_SCALE, I_start_scale, 197 | PSYS_PART_END_SCALE, I_end_scale, 198 | 199 | PSYS_PART_MAX_AGE, I_particle_age, 200 | 201 | 202 | PSYS_SRC_PATTERN, 203 | PSYS_SRC_PATTERN_ANGLE_CONE, 204 | 205 | PSYS_SRC_INNERANGLE, I_inner_angle, 206 | PSYS_SRC_OUTERANGLE, I_outer_angle, 207 | PSYS_SRC_OMEGA, I_spin_speed, 208 | 209 | PSYS_SRC_ACCEL, I_particle_accel, 210 | 211 | PSYS_SRC_TEXTURE, I_particle_texture, 212 | 213 | PSYS_SRC_BURST_RATE, I_burst_rate, 214 | PSYS_SRC_BURST_PART_COUNT, I_burst_count, 215 | PSYS_SRC_BURST_RADIUS, I_burst_radius, 216 | PSYS_SRC_BURST_SPEED_MIN, I_min_speed, 217 | PSYS_SRC_BURST_SPEED_MAX, I_max_speed, 218 | 219 | PSYS_SRC_MAX_AGE, I_source_age 220 | ]); 221 | 222 | } 223 | else 224 | { 225 | 226 | llMessageLinked(LINK_SET, TRUE, "burst", ""); 227 | vector start_color = <1,1,1>; 228 | vector end_color = <0.65,0.3,0.0>; 229 | 230 | float start_alpha = 1.0; 231 | float end_alpha = 0.0; 232 | 233 | vector start_scale = <0.25,0.25,0.0>; 234 | vector end_scale = <0.1,0.1,0.0>; //scale (z is ignored) 235 | 236 | float particle_age = 2.5; 237 | 238 | float inner_angle = PI; 239 | float outer_angle = PI; 240 | vector spin_speed = <0.0,0.0,0.0>; 241 | vector particle_accel = <0.0,0.0,0.0>; 242 | 243 | float burst_rate = 0.01; 244 | integer burst_count = 20; 245 | float burst_radius = 0.1; 246 | float min_speed = 1; 247 | float max_speed = 1.5; 248 | 249 | float source_age = 0.0; // 0.0 = forever 250 | 251 | string particle_texture = "particle_glowOrange4"; 252 | 253 | key target; 254 | 255 | 256 | { 257 | 258 | { 259 | 260 | llParticleSystem([ 261 | PSYS_PART_FLAGS, 262 | PSYS_PART_INTERP_COLOR_MASK | 263 | PSYS_PART_INTERP_SCALE_MASK | 264 | //PSYS_PART_WIND_MASK | 265 | //PSYS_PART_BOUNCE_MASK | 266 | PSYS_PART_FOLLOW_SRC_MASK | 267 | PSYS_PART_FOLLOW_VELOCITY_MASK | 268 | //PSYS_PART_TARGET_POS_MASK | 269 | PSYS_PART_EMISSIVE_MASK, 270 | //PSYS_PART_TARGET_LINEAR_MASK, 271 | 272 | PSYS_PART_START_COLOR, start_color, 273 | PSYS_PART_END_COLOR, end_color, 274 | 275 | PSYS_PART_START_ALPHA, start_alpha, 276 | PSYS_PART_END_ALPHA, end_alpha, 277 | 278 | PSYS_PART_START_SCALE, start_scale, 279 | PSYS_PART_END_SCALE, end_scale, 280 | 281 | PSYS_PART_MAX_AGE, particle_age, 282 | 283 | 284 | PSYS_SRC_PATTERN, 285 | //PSYS_SRC_PATTERN_DROP, 286 | //PSYS_SRC_PATTERN_EXPLODE, 287 | //PSYS_SRC_PATTERN_ANGLE, 288 | PSYS_SRC_PATTERN_ANGLE_CONE, 289 | 290 | PSYS_SRC_INNERANGLE, inner_angle, 291 | PSYS_SRC_OUTERANGLE, outer_angle, 292 | PSYS_SRC_OMEGA, spin_speed, 293 | 294 | // PSYS_SRC_ACCEL, particle_accel, 295 | 296 | PSYS_SRC_TEXTURE, particle_texture, 297 | 298 | PSYS_SRC_BURST_RATE, burst_rate, 299 | PSYS_SRC_BURST_PART_COUNT, burst_count, 300 | PSYS_SRC_BURST_RADIUS, burst_radius, 301 | PSYS_SRC_BURST_SPEED_MIN, min_speed, 302 | PSYS_SRC_BURST_SPEED_MAX, max_speed, 303 | 304 | PSYS_SRC_MAX_AGE, source_age//, 305 | 306 | //PSYS_SRC_TARGET_KEY, target 307 | 308 | ]); 309 | 310 | }} 311 | 312 | } 313 | 314 | 315 | 316 | 317 | 318 | } 319 | } 320 | } -------------------------------------------------------------------------------- /Scripts/Play_Animation_on_Attach.lsl: -------------------------------------------------------------------------------- 1 | string animation = "name of your anim"; 2 | 3 | default{ 4 | 5 | attach(key id){ 6 | if (id){ // is a valid key and not NULL_KEY 7 | llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); 8 | }else{ 9 | llStopAnimation(animation); // stop the started animation 10 | llResetScript(); // release the avatar animation permissions 11 | } 12 | } 13 | 14 | run_time_permissions(integer perm){ 15 | if (perm & PERMISSION_TRIGGER_ANIMATION){ 16 | llStartAnimation(animation); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Scripts/Set Transparant Texture(SL).lsl: -------------------------------------------------------------------------------- 1 | default 2 | { 3 | 4 | state_entry() 5 | { 6 | llSetTexture("38b86f85-2575-52a9-a531-23108d8da837", ALL_SIDES); //The number is the UUID of the 7 | //invisible Texture 8 | 9 | 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /Scripts/Tyken Hightower's Generic Door Script.lsl: -------------------------------------------------------------------------------- 1 | //start_unprocessed_text 2 | /*/|/ Generic Door 3 | /|/ "N" was here 4 | 5 | 6 | 7 | /|/ Information 8 | /|/ ---------------------------------------------------------------- 9 | /|/ The door prim can be either a root or child (although a child will only rotate itself, not the linkset). 10 | /|/ The script operates assuming that the 'front' of the door is its positive x-axis, the positive y-axis shoots from the hinges through the door, and the z-axis is up. 11 | /|/ 12 | /|/ To make a very simple one-prim door to use, give a box the following parameters and drop the script in: 13 | /|/ Size X: 0.1 14 | /|/ Size Y: 3.0 15 | /|/ Size Z: 3.0 16 | /|/ Path Cut Begin: 0.375 17 | /|/ Path Cut End: 0.875 18 | /|/ 19 | /|/ The door doesn't require any 'reset;' if you want to move it, go right ahead. Moving or rotating the door doesn't change its operation or open/closed status. 20 | /|/ Changing and recompiling the script or resetting it makes the door assume it is in the 'closed' position. 21 | /|/ ---------------------------------------------------------------- 22 | 23 | 24 | 25 | /|/ User-customizable constants 26 | /|/ ---------------------------------------------------------------- 27 | /|/ Sets whether the door can be opened by touch 28 | integer touch_to_open = TRUE; 29 | 30 | /|/ Sets whether the door can be opened by collision 31 | integer collide_to_open = TRUE; 32 | 33 | /|/ Sets whether the door should use a sensor automatically open for nearby agents, the sensor range (in meters), and the sensor scan rate (in seconds) 34 | integer sensor_open = TRUE; 35 | float sensor_open_range = 3.0; 36 | float sensor_open_scanrate = 1.0; 37 | 38 | /|/ Seconds until an open door shuts itself automatically (set to 0.0 to let doors stay open forever) 39 | float door_timeout = 5.0; 40 | 41 | /|/ Which direction the door opens around the Z axis 42 | /|/ Both can be set; the the direction will then depend on the position of the person opening it 43 | integer open_clockwise = TRUE; 44 | integer open_anticlockwise = TRUE; 45 | /|/ Sets whether the door opens away (TRUE) from or toward (FALSE) the avatar opening it (only has an effect when both opening direction options above are TRUE) 46 | integer open_away = TRUE; 47 | 48 | /|/ Angle (in degrees) the door opens for each direction (use only positive values) 49 | float clockwise_angle = 90.0; 50 | float anticlockwise_angle = 90.0; 51 | 52 | /|/ Sound effect inventory names (or asset UUIDs) and volume levels (0.0 to 1.0) 53 | string open_sound = ""; 54 | float open_volume = 1.0; 55 | string close_sound = ""; 56 | float close_volume = 1.0; 57 | /|/ ---------------------------------------------------------------- 58 | 59 | 60 | 61 | /|/ Internal script variables - do not edit 62 | /|/ ---------------------------------------------------------------- 63 | integer opened = FALSE; 64 | integer opened_clockwise = FALSE; 65 | 66 | integer timeout_waiting = FALSE; 67 | 68 | rotation clockwise_rot = <0.0, 0.0, 0.0, 1.0>; 69 | rotation inv_clockwise_rot = <0.0, 0.0, 0.0, 1.0>; 70 | rotation anticlockwise_rot = <0.0, 0.0, 0.0, 1.0>; 71 | rotation inv_anticlockwise_rot = <0.0, 0.0, 0.0, 1.0>; 72 | /|/ ---------------------------------------------------------------- 73 | 74 | 75 | 76 | init() { 77 | /|/ Prepare internal rotation values to save calculations 78 | clockwise_rot = llEuler2Rot(<0.0, 0.0, -clockwise_angle> * DEG_TO_RAD); 79 | inv_clockwise_rot = ZERO_ROTATION / clockwise_rot; 80 | anticlockwise_rot = llEuler2Rot(<0.0, 0.0, anticlockwise_angle> * DEG_TO_RAD); 81 | inv_anticlockwise_rot = ZERO_ROTATION / anticlockwise_rot; 82 | 83 | if (sensor_open) { 84 | llSensorRepeat("", "", AGENT, sensor_open_range, PI, sensor_open_scanrate); 85 | } 86 | } 87 | 88 | /|/ Perform the actual opening, clockwise 89 | do_open_clockwise() { 90 | if (open_sound != "") { 91 | llTriggerSound(open_sound, open_volume); 92 | } 93 | llSetLocalRot(clockwise_rot * llGetLocalRot()); 94 | 95 | opened_clockwise = TRUE; 96 | } 97 | 98 | /|/ Perform the actual opening, anticlockwise 99 | do_open_anticlockwise() { 100 | if (open_sound != "") { 101 | llTriggerSound(open_sound, open_volume); 102 | } 103 | llSetLocalRot(anticlockwise_rot * llGetLocalRot()); 104 | 105 | opened_clockwise = FALSE; 106 | } 107 | 108 | open(vector agent_pos) { 109 | llSetTimerEvent(door_timeout); 110 | /|/ Don't try to open the door if it's already opened 111 | if (opened) return; 112 | 113 | /|/ If necessary, determine whether to open clockwise or anticlockwise based on the agent's position 114 | if (open_clockwise && open_anticlockwise) { 115 | float agent_angle = llRot2Angle(llRotBetween(llRot2Fwd(llGetRot()), llVecNorm(agent_pos - llGetPos()))); 116 | if (agent_angle > PI_BY_TWO) { /|/ Agent is 'behind' the door (negative on the door's x-axis) 117 | if (open_away) { /|/ Default behavior; agent behind door opens it 'away,' thus clockwise 118 | do_open_clockwise(); 119 | } else { /|/ Agent is behind door, but opens it toward themselves, thus anticlockwise 120 | do_open_anticlockwise(); 121 | } 122 | } else { /|/ Agent is 'in front of' the door (positive on the door's x-axis) 123 | if (open_away) { /|/ Default behavior, agent in front of door opens it 'away,' thus anticlockwise 124 | do_open_anticlockwise(); 125 | } else { /|/ Agent is in front of door, but opens it toward themselves, thus clockwise 126 | do_open_clockwise(); 127 | } 128 | } 129 | /|/ Otherwise, open in a simple predetermined manner. 130 | } else if (open_clockwise) { 131 | do_open_clockwise(); 132 | } else { 133 | do_open_anticlockwise(); 134 | } 135 | 136 | opened = TRUE; 137 | timeout_waiting = FALSE; 138 | start_timeout(); 139 | } 140 | 141 | close() { 142 | llSetTimerEvent(0.0); 143 | /|/ Don't try to close the door if it's already closed 144 | if (!opened) return; 145 | 146 | if (close_sound != "") { 147 | llTriggerSound(close_sound, close_volume); 148 | } 149 | 150 | if (opened_clockwise) { 151 | llSetLocalRot(inv_clockwise_rot * llGetLocalRot()); 152 | } else { 153 | llSetLocalRot(inv_anticlockwise_rot * llGetLocalRot()); 154 | } 155 | 156 | opened = FALSE; 157 | timeout_waiting = FALSE; 158 | } 159 | 160 | start_timeout() { 161 | if (timeout_waiting) return; 162 | 163 | llSetTimerEvent(door_timeout); 164 | timeout_waiting = TRUE; 165 | } 166 | 167 | default 168 | { 169 | state_entry() { 170 | init(); 171 | } 172 | 173 | on_rez(integer start) { 174 | llResetScript(); 175 | } 176 | 177 | /|/ Touching can either open or close the door 178 | touch_start(integer touches) { 179 | if (touch_to_open) { 180 | if (opened) { 181 | close(); 182 | } else { 183 | open(llDetectedPos(0)); 184 | } 185 | } 186 | } 187 | 188 | /|/ Collisions will open the door or keep it open by resetting the timer 189 | collision_start(integer colliders) { 190 | if (collide_to_open) { 191 | open(llDetectedPos(0)); 192 | } 193 | } 194 | 195 | /|/ Sensor matches will open the door or keep it open by resetting the timer 196 | sensor(integer matches) { 197 | open(llDetectedPos(0)); 198 | } 199 | 200 | /|/ Avatars have left door scan range, allowing timeout to begin 201 | no_sensor() { 202 | start_timeout(); 203 | } 204 | 205 | /|/ Timeout reached, close the door 206 | timer() { 207 | close(); 208 | } 209 | }*/ 210 | //end_unprocessed_text 211 | //nfo_preprocessor_version 0 212 | //program_version Emerald Viewer 213 | //mono 214 | 215 | 216 | integer touch_to_open = TRUE; 217 | integer timeout_waiting = FALSE; 218 | float sensor_open_scanrate = 1.0; 219 | float sensor_open_range = 3.0; 220 | integer sensor_open = TRUE; 221 | integer opened_clockwise = FALSE; 222 | integer opened = FALSE; 223 | float open_volume = 1.0; 224 | string open_sound = ""; 225 | integer open_clockwise = TRUE; 226 | integer open_away = TRUE; 227 | integer open_anticlockwise = TRUE; 228 | rotation inv_clockwise_rot = <0.0, 0.0, 0.0, 1.0>; 229 | rotation inv_anticlockwise_rot = <0.0, 0.0, 0.0, 1.0>; 230 | float door_timeout = 5.0; 231 | integer collide_to_open = TRUE; 232 | float close_volume = 1.0; 233 | string close_sound = ""; 234 | rotation clockwise_rot = <0.0, 0.0, 0.0, 1.0>; 235 | float clockwise_angle = 90.0; 236 | rotation anticlockwise_rot = <0.0, 0.0, 0.0, 1.0>; 237 | float anticlockwise_angle = 90.0; 238 | 239 | 240 | 241 | do_open_clockwise() { 242 | if (open_sound != "") { 243 | llTriggerSound(open_sound, open_volume); 244 | } 245 | llSetLocalRot(clockwise_rot * llGetLocalRot()); 246 | 247 | opened_clockwise = TRUE; 248 | } 249 | 250 | 251 | 252 | do_open_anticlockwise() { 253 | if (open_sound != "") { 254 | llTriggerSound(open_sound, open_volume); 255 | } 256 | llSetLocalRot(anticlockwise_rot * llGetLocalRot()); 257 | 258 | opened_clockwise = FALSE; 259 | } 260 | 261 | 262 | start_timeout() { 263 | if (timeout_waiting) return; 264 | 265 | llSetTimerEvent(door_timeout); 266 | timeout_waiting = TRUE; 267 | } 268 | 269 | 270 | open(vector agent_pos) { 271 | llSetTimerEvent(door_timeout); 272 | 273 | if (opened) return; 274 | 275 | 276 | if (open_clockwise && open_anticlockwise) { 277 | float agent_angle = llRot2Angle(llRotBetween(llRot2Fwd(llGetRot()), llVecNorm(agent_pos - llGetPos()))); 278 | if (agent_angle > PI_BY_TWO) { 279 | if (open_away) { 280 | do_open_clockwise(); 281 | } else { 282 | do_open_anticlockwise(); 283 | } 284 | } else { 285 | if (open_away) { 286 | do_open_anticlockwise(); 287 | } else { 288 | do_open_clockwise(); 289 | } 290 | } 291 | 292 | } else if (open_clockwise) { 293 | do_open_clockwise(); 294 | } else { 295 | do_open_anticlockwise(); 296 | } 297 | 298 | opened = TRUE; 299 | timeout_waiting = FALSE; 300 | start_timeout(); 301 | } 302 | 303 | 304 | 305 | 306 | 307 | init() { 308 | 309 | clockwise_rot = llEuler2Rot(<0.0, 0.0, -clockwise_angle> * DEG_TO_RAD); 310 | inv_clockwise_rot = ZERO_ROTATION / clockwise_rot; 311 | anticlockwise_rot = llEuler2Rot(<0.0, 0.0, anticlockwise_angle> * DEG_TO_RAD); 312 | inv_anticlockwise_rot = ZERO_ROTATION / anticlockwise_rot; 313 | 314 | if (sensor_open) { 315 | llSensorRepeat("", "", AGENT, sensor_open_range, PI, sensor_open_scanrate); 316 | } 317 | } 318 | 319 | 320 | close() { 321 | llSetTimerEvent(0.0); 322 | 323 | if (!opened) return; 324 | 325 | if (close_sound != "") { 326 | llTriggerSound(close_sound, close_volume); 327 | } 328 | 329 | if (opened_clockwise) { 330 | llSetLocalRot(inv_clockwise_rot * llGetLocalRot()); 331 | } else { 332 | llSetLocalRot(inv_anticlockwise_rot * llGetLocalRot()); 333 | } 334 | 335 | opened = FALSE; 336 | timeout_waiting = FALSE; 337 | } 338 | 339 | 340 | default 341 | { 342 | state_entry() { 343 | init(); 344 | } 345 | 346 | on_rez(integer start) { 347 | llResetScript(); 348 | } 349 | 350 | 351 | touch_start(integer touches) { 352 | if (touch_to_open) { 353 | if (opened) { 354 | close(); 355 | } else { 356 | open(llDetectedPos(0)); 357 | } 358 | } 359 | } 360 | 361 | 362 | collision_start(integer colliders) { 363 | if (collide_to_open) { 364 | open(llDetectedPos(0)); 365 | } 366 | } 367 | 368 | 369 | sensor(integer matches) { 370 | open(llDetectedPos(0)); 371 | } 372 | 373 | 374 | no_sensor() { 375 | start_timeout(); 376 | } 377 | 378 | 379 | timer() { 380 | close(); 381 | } 382 | } --------------------------------------------------------------------------------