'Open Source Scripting' group (Second Life) wiki

Need a SLURL. This script will make them

Modified: 24/01/2007 08:18 by sparti.
Put this in an object where you want the SURL to be, then click it and it will tell you the SURL of that place.

This demonstrates a central 'say()' routine which uses a global flag to switch between llOwnerSay(string) and llSay(0,string). It's a good idea to use functions like this to avoid testing flags all over the place - which makes code less maintainable.

// SLURL MAKER - Originally from Tribal Toland
// 24jan07 sC some enhancements by sparti Carroll

integer iFlagOwnerOnly = 0;

say(string sOut) { if (iFlagOwnerOnly) { llOwnerSay(sOut); } else { llSay(0, sOut); } }

default {

touch_start(integer num_detected) { say("One moment, retrieving data..."); string sName = llGetRegionName(); vector vWhere = llGetPos(); string sX = (string)vWhere.x; string sY = (string)vWhere.y; string sZ = (string)vWhere.z; string sSLURL = "http://slurl.com/secondlife/" + sName + "/" + sX + "/" + sY + "/" + sZ + "/?title=" + sName; say(sSLURL); }

}

ScrewTurn Wiki version 1.0.11. Some of the icons created by FamFamFam.