Slurl Maker

Expired

//UnderX McMillan
 
string escape(string msg)
{
        return llDumpList2String(llParseString2List(msg, [" "], []), "%20");
}
 
string getSLUrl() {
        string nameSim = llGetRegionName();
        vector localPos = llGetPos();
        string slurl = "http://slurl.com/secondlife/";
 
        slurl += escape(nameSim) + "/";
        slurl += (string)llRound(localPos.x) + "/";
        slurl += (string)llRound(localPos.y) + "/";
        slurl += (string)llRound(localPos.z) + "/";
 
        return slurl;
}
 
default
{
        state_entry()
        {
                llListen(12,"",llGetOwner(),"");
        }
 
        listen( integer channel, string name, key id, string message )
        {
                if( id != llGetOwner() ) { return; }
 
                if( llToUpper(message) == "SLURL" )
                {
                        llOwnerSay(getSLUrl());
                }
        }
 
}

 

Teleport On Click

Expired

//  Teleport Sit Hack
//  Created by Water Rogers for IBM/Opensource
 
//  Purpose
//  --------------------------------------------------------------
//  This is a quick example of how you can make a teleporter type
//  object using the "Sit Hack".
 
//  Requirements
//  --------------------------------------------------------------
//  A single prim is all that is necessary for this example.
 
//  Usage
//  --------------------------------------------------------------
//  We set up this object to "Sit on object when left clicked" making
//  it easier on the user.  Otherwise, you could right click and chose
//  "sit" from the pie menu.
 
//  GLOBALS
//  --------------------------------------------------------------
string      g_SitText   =  "Teleport";          //  This changes the text on the pie menue when rightclicked on the object
vector      g_SitOffset =  <0.0, 0.0, 10.0>;    //  This is the sit offset, also considered the teleport location from the object
 
//  EVENTS
//  --------------------------------------------------------------
default
{
    state_entry()
    {
        //  Set up the llSitTarget() and sit text first
        llSetSitText(g_SitText);
        llSitTarget(g_SitOffset, ZERO_ROTATION);
    }
 
    changed(integer change)
    {
        key id = llAvatarOnSitTarget();
        if(change & CHANGED_LINK)
        {
            //  We detect that the avatar sat on the object, so we
            //  unsit them right away thus giving the illusion of a
            //  teleport.
 
            //  Adjust the sleep time depending on the distance of
            //  the teleport.  The further the teleport, the higher
            //  the sleep value should be.  Note that the furtherst
            //  'teleport' distance is 300 meters.
            llSleep(1);
            llUnSit(id);
        }
    }
}

 

Pay To Teleport

Expired

//Pay 2 Teleport by Haplo Voss
//Greetings! Thanks be to all that helped me along the way with answers to questions!
//Without further ado... here it is!!
 
//Please pay attention to notes following script!!
 
//-------------------------
 
vector gTargetPos;
integer cost;
string desc;
string hovertext;
key agent;
key gAvatarID=NULL_KEY;
integer gReturnToStartPos=TRUE;
vector gStartPos;
integer paid = 1;
integer access=0;
integer public_access;
integer origin_access;
float elapsed;
key gID;
 
warpPos( vector destpos)
{ //R&D by Keknehv Psaltery, 05/25/2006
//Additions by Strife, Talarus Luan
//and final cleanup by Keknehv Psaltery
integer jumps = (integer)(llVecDist(destpos, llGetPos()) / 10.0) + 1;
if (jumps > 100 )
jumps = 100;
list rules = [ PRIM_POSITION, destpos ];
integer count = 1;
while ( ( count = count << 1 ) < jumps)
rules = (rules=[]) + rules + rules;
llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
}
 
default
{
 
dataserver(key query_id, string desc){
list desc_list = llParseString2List(desc, [";"], []);
gTargetPos = (vector)llList2String(desc_list, 0);
cost = (integer)llList2String(desc_list, 1);
hovertext = llList2String(desc_list, 2) + "\n" +
llList2String(desc_list, 3) + "\n" +
llList2String(desc_list, 4) + "\n" +
llList2String(desc_list, 5) + "\n" +
llList2String(desc_list, 6);
public_access = (integer)llList2String(desc_list, 7);
origin_access = public_access;
}
 
money (key id, integer amount){
paid=amount;
 
if (paid < cost && public_access == 0){
llSay(0,"Sorry, but this class costs " + (string)cost + ". Full amount is required before access.");
llGiveMoney(id,paid);
llUnSit(llAvatarOnSitTarget());
}
else if (paid > cost && public_access == 0){
integer refund = paid - cost;
llSay(0,"This class only costs " + (string)cost + "! Refunding you L$" + (string)refund );
llSay(0,"Access Granted!");
llSetSitText("Teleport");
llGiveMoney(id,refund);
gID = id;
public_access = 1;
}
else if (paid != 0 && origin_access == 1){
integer refund = paid;
llSay(0,"This teleporter is public access!");
llSay(0,"Access Granted!");
llSetSitText("Teleport");
llGiveMoney(id,refund);
public_access = 1;
}
else{
llSay(0,"Access Granted!");
llSetSitText("Teleport");
gID = id;
public_access = 1;
 
}
 
}
 
on_rez(integer rez){
llResetScript();
}
 
state_entry(){
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT );
desc = llGetNotecardLine("TPInfo",0);
llSitTarget(<0,0,1>,ZERO_ROTATION);
gStartPos = llGetPos();
}
 
touch_start(integer touched){
llSetSitText("\n");
llSetText(hovertext, <0,1,0>, 1);
if (public_access == 1){llSetSitText("Teleport");}
elapsed = llGetAndResetTime();
}
touch(integer num_detected) {
if (llDetectedKey(0) == llGetOwner()){
elapsed = llGetTime();
if (elapsed > 2.0) {
llOwnerSay("Description has changed - resetting script");
llSetTimerEvent(120);
llResetScript();
}
 
}}
touch_end(integer num_detected)
{}
 
timer()
{
llSetTimerEvent(0.0);
}
 
changed(integer change){
if(change & CHANGED_LINK)
gAvatarID = llAvatarOnSitTarget();
if(public_access == 0){llSetSitText("\n");llUnSit(gAvatarID);}
if(gAvatarID != NULL_KEY & public_access == 1 & gID == gAvatarID) {
warpPos(gTargetPos);
llSleep(.25);
llUnSit(gAvatarID);
llSleep(.25);
 
if (gReturnToStartPos) {
warpPos(gStartPos);
}
if(origin_access == 0){llSetSitText("\n");public_access = 0;}
if(origin_access == 1){llSetSitText("Teleport");}
}
}
}
 
//------------------------------
 
//As you can see in the script, you will need to create a notecard called "TPInfo" (no quotes). It must contain the following information, IN THE FOLLOING ORDER.
 
//;price to charge;text line1;line2;line3;line4;line5;public access switch
 
//EXAMPLE:
 
//<1 ,2,3>;100;WELCOME!;Right Click And;Pay L$100 to;Teleport to Island!; ; ;0
 
//vector = <1 ,2,3>
//price = 100
//text =
//WELCOME!
//Right Click And
//Pay L$100 to
//Teleport to Island!