SLURL Maker

Expired

// SLURL Maker 0.4
// by Dyne Talamasca

vector Where;
string Name;
string SLURL;
integer X;
integer Y;
integer Z;

default 
{
    touch_start(integer numtouching) 
    {
        llOwnerSay("One moment, retrieving data...");
        Name = llGetRegionName();
        Where = llGetPos();

        X = (integer)Where.x;
        Y = (integer)Where.y;
        Z = (integer)Where.z;


        // I don't replace any spaces in Name with %20 and so forth.

        SLURL = "http://slurl.com/secondlife/" + Name + "/" + (string)X + "/" + (string)Y + "/" + (string)Z + "/?title=" + Name;

        llOwnerSay(SLURL);
    }

}

 

Basic Physical Sliding Door Script

Expired

// ********************************************************************
//
// Basic Physical Sliding Door Script
// by SimonT Quinnell 
// 11/07/2009
//
// NOTE: If you are going to reposition the door, do it while the door is closed.
//  Otherwise it will try and use the old close position as a reference point.
//
// Licensed under the "OpenCollar License"
// Ie. Licensed under the GPLv2, with the additional requirement that these scripts remain "full perms" in Second Life.
//
// Edit: Simplified the script to be just a basic move script .. removed the sound triggers (5/1/2010)
//
// ********************************************************************
 
 
// ********************************************************************
// CONSTANTS
// ********************************************************************
 
// Movement Constants
vector      OFFSET = <-2.0, 0.0, 0.0>;      // Directional offset for moving the door in x,y,z coordinates
float       OPENTIME = 3.5;                 // Time taken to open door
float       CLOSETIME = 3.5;                // Time taken to close door
 
 
// ********************************************************************
// Variables
// ********************************************************************
 
vector      vPosition;
rotation    rRot;
float       omega=0.0;
vector      vTargetPos;
integer     bOpen = FALSE;
integer     bMoving = FALSE;
 
 
// ********************************************************************
// Functions
// ********************************************************************
 
 
MoveDoor()
{    
    if(!bOpen)
    {   // Initial conditions
        bOpen = TRUE;                
        rRot = llGetRot();
        vPosition = llGetPos();
 
        // Target Position
        omega=OPENTIME/llVecDist(<0,0,0>,OFFSET);
        vTargetPos = vPosition+OFFSET*rRot;
 
        // Set the timer to cleanup position
        llSetTimerEvent(OPENTIME);        
    }else
    {        
        bOpen = FALSE;
 
        // Target Position
        omega=CLOSETIME/llVecDist(<0,0,0>,OFFSET);
        vTargetPos = vPosition;
 
        // Set the timer to cleanup position
        llSetTimerEvent(CLOSETIME);
    }
 
    // Set Door Physical and move it
    bMoving = TRUE;
    llSetStatus(STATUS_PHANTOM, TRUE);
    llSetStatus(STATUS_PHYSICS, TRUE);
    llMoveToTarget(vTargetPos,omega);
}
 
 
default
{            
    state_entry()
    {   // Initial conditions
        rRot = llGetRot();
        vPosition = llGetPos();
    }    
 
    touch_start(integer num_detected)
    {
        MoveDoor();
    } 
 
    timer()
    {
        // Clean up Position
        bMoving = FALSE;
        llSetTimerEvent(0.0);
        llSetStatus(STATUS_PHYSICS, FALSE);
        llSetStatus(STATUS_PHANTOM, FALSE);         
        llSetPrimitiveParams();        
    }
}

 

Landownder Border Detector

Expired

//
// LandownerBorderDetector
// Version 20070217-1
// Copyright (c) 2007 by Second Life resident Badpenguin Posthorn
//
// Plop this script in an object and touch the object to display border
// lines and boundary coordinates of contiguous land owned by the same
// landowner. Works by detecting changes in land ownership and is
// accurate up to 0.5 meters. Note that it will only detect boundaries
// on the direct X and Y coordinates from where the scripted object
// resides, so only expect useful results when the boundaries of the
// measured parcel(s) are straight lines. Works on group deeded land
// also.
//
//
// LICENSE:
// 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.
//
// 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.
// 59 Temple Place Suite 330
// Boston, MA 02111-1307, USA.
// (Also available at http://www.gnu.org/copyleft/gpl.html)
//
//
// Global variables, feel free to customize
//
float gJumpAmount = 0.5;

// *************************************************
// Find a land border by searching out from a
// specific coordinate for a change in land ownership.
// *************************************************
vector findBorder(string axis, vector start_vec, float jump_amount) {
float x = 0;
float y = 0;
float z = 0;
float num = 0;
vector newVec = ZERO_VECTOR;
vector lastVec = ZERO_VECTOR;
key owner1 = NULL_KEY;
key owner2 = NULL_KEY;
//
// Validate axis
//
if ((axis != "x") && (axis != "y")) {
// llSay(0,"Invalid axis passed to findBorder()");
return ZERO_VECTOR;
}
//
// Validate jump_amount
//
if ((integer)jump_amount >= 255) {
// llSay(0,"Invalid jump amount");
return ZERO_VECTOR;
}
//
// Validate start_vec
//
x = getVectorAxis(0,start_vec);
y = getVectorAxis(1,start_vec);
z = getVectorAxis(2,start_vec);
if (x <= 0 || y <= 0 || z <= 0) {
// llSay(0,"Invalid vector passed to findBorder()");
return ZERO_VECTOR;
}
if (x >= 255 || y >= 255 || z >= 255) {
// llSay(0,"Invalid vector passed to findBorder()");
return ZERO_VECTOR;
}
//
// Are we too close to a sim border?
//
if (axis == "x") {
if ((x + jump_amount >= 255) ||(x + jump_amount <= 0)) {
return ZERO_VECTOR;
}
} else {
if ((y + jump_amount >= 255) ||(y + jump_amount <= 0)) {
return ZERO_VECTOR;
}
}
//
// Get owner of land at start vector
//
owner1 = llGetLandOwnerAt(start_vec);
if (owner1 == NULL_KEY) {
// llSay(0,"Could not determine land owner at the location");
return ZERO_VECTOR;
}
//
// Assign initial values
//
lastVec = start_vec;
if (axis == "x") {
num = x;
} else {
num = y;
}
//
// Loop through until we find a different landowner
//
while ((num >= 0) && (num <= 255)) {
if (axis == "x") {
newVec =  + ;
} else {
newVec =  + <0, jump_amount, 0>;
}
owner2 = llGetLandOwnerAt(newVec);
if ((owner2 == NULL_KEY) || (owner1 != owner2)) {
return lastVec;
}
num += jump_amount;
if ((num <= 0) || (num >= 255)) {
return lastVec;
}
lastVec = newVec;
}
return ZERO_VECTOR;
}

// *************************************************
// Return a particular axis from a vector
// *************************************************
float getVectorAxis(integer axis, vector vec) {
if ((axis <0) || (axis > 2)) {
return -1;
}
list junk = llParseString2List((string)vec,[",","<",">"], []);
if (llGetListLength(junk) != 3) {
return -1;
}
return llList2Float(junk,axis);
}


//
// default state starts here
//
default {
state_entry() {
llSay(0,"Touch the object to determine borders");
}

touch_start(integer num_detected) {
// Uncomment to disallow anyone but the owner to use it
//if (llDetectedKey(0) != llGetOwner()) {
// return;
// }
vector BOUND_EAST = ZERO_VECTOR;
vector BOUND_NORTH = ZERO_VECTOR;
vector BOUND_SOUTH = ZERO_VECTOR;
vector BOUND_WEST = ZERO_VECTOR;
string msg;
vector HOME_POS = llGetPos();
//
// Determine the northern boundary
//
BOUND_NORTH = findBorder("y",HOME_POS,gJumpAmount);
if (BOUND_NORTH == ZERO_VECTOR) {
llSay(0,"Failed to locate northern boundary");
llResetScript();
}
//
// Determine the southern boundary
//
BOUND_SOUTH = findBorder("y",HOME_POS,-gJumpAmount);
if (BOUND_SOUTH == ZERO_VECTOR) {
llSay(0,"Failed to locate southern boundary");
llResetScript();
}
//
// Determine the eastern boundary
//
BOUND_EAST = findBorder("x",HOME_POS,gJumpAmount);
if (BOUND_EAST == ZERO_VECTOR) {
llSay(0,"Failed to locate eastern boundary");
llResetScript();
}
//
// Determine the western boundary
//
BOUND_WEST = findBorder("x",HOME_POS,-gJumpAmount);
if (BOUND_WEST == ZERO_VECTOR) {
llSay(0,"Failed to locate western boundary");
llResetScript();
}
//
// Format some results for displaying
//
float borderNorth = getVectorAxis(1,BOUND_NORTH);
float borderSouth = getVectorAxis(1,BOUND_SOUTH);
float borderEast = getVectorAxis(0,BOUND_EAST);
float borderWest = getVectorAxis(0,BOUND_WEST);
float zCoord = getVectorAxis(2,HOME_POS);
vector vectorNW = ;
vector vectorNE = ;
vector vectorSE = ;
vector vectorSW = ;
//
// Display the results
//
llSay(0,"");
llSay(0,"Northern Boundary Detected: " + (string)BOUND_NORTH);
llSay(0,"Southern Boundary Detected: " + (string)BOUND_SOUTH);
llSay(0,"Eastern Boudary Detected: " + (string)BOUND_EAST);
llSay(0,"Western Boundary Detected: " + (string)BOUND_WEST);
llSay(0,"");
llSay(0,"Northern Border Line: " + (string)borderNorth);
llSay(0,"Southern Border Line: " + (string)borderSouth);
llSay(0,"Eastern Border Line: " + (string)borderEast);
llSay(0,"Western Border Line: " + (string)borderWest);
llSay(0,"");
llSay(0,"Northwest Coords: " + (string)vectorNW);
llSay(0,"Northeast Coords: " + (string)vectorNE);
llSay(0,"Southeast Coords: " + (string)vectorSE);
llSay(0,"Southwest Coords: " + (string)vectorSW);
}

on_rez(integer num) {
llResetScript();
}

}