Difference between revisions of "Teleporter Anywhere"
Jump to navigation
Jump to search
m |
m |
||
Line 1: | Line 1: | ||
{{LSL Header}} | {{LSL Header}} | ||
[[Category:LSL_Library]] | [[Category:LSL_Library]] | ||
<div style="padding-left: 0.3em"> | <div style="padding-left: 0.3em;"> | ||
[[Teleporter_Anywhere]] | [[Ultimate_Radar]] | [[Language_Scanner]] | [[Visitor_Counter_Tracker]] | [[Teleporter_Anywhere]] | [[Ultimate_Radar]] | [[Language_Scanner]] | [[Visitor_Counter_Tracker]] | ||
</div> | </div> | ||
<div id="box"> | <div id="box"> | ||
==Summary== | ==Summary== | ||
<div style="padding: 0.5em | <div style="padding: 0.5em;"> | ||
This teleporter can teleport anybody anywhere in your land, to an other Parcel or to an other Sim. | This teleporter can teleport anybody anywhere in your land, to an other Parcel or to an other Sim. | ||
* Copyright (C) 2017 Luxen - [[User:Luxen_Resident|Luxen_Resident]] - version 5.1 | * Copyright (C) 2017 Luxen - [[User:Luxen_Resident|Luxen_Resident]] - version 5.1 | ||
Line 13: | Line 13: | ||
<div id="box"> | <div id="box"> | ||
== Setup: == | == Setup: == | ||
<div style="padding: 0.5em"> | <div style="padding: 0.5em;"> | ||
* Setup: | * Setup: | ||
# Rez the Teleporter on your land (where you want your first location) and up it to 1 meter above the floor. | # Rez the Teleporter on your land (where you want your first location) and up it to 1 meter above the floor. | ||
Line 36: | Line 36: | ||
<div id="box"> | <div id="box"> | ||
== Code: == | == Code: == | ||
< | <div style="padding: 0.5em;"> | ||
<source lang="lsl2"> | <source lang="lsl2"> | ||
////////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////////// | ||
Line 277: | Line 277: | ||
} | } | ||
</source> | </source> | ||
</div></div> |
Revision as of 10:36, 15 January 2017
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
This teleporter can teleport anybody anywhere in your land, to an other Parcel or to an other Sim.
- Copyright (C) 2017 Luxen - Luxen_Resident - version 5.1
- Easy to use, Touch and menu system.
Setup:
- Setup:
- Rez the Teleporter on your land (where you want your first location) and up it to 1 meter above the floor.
- Click on it to open the menu.
- The "Save Dest 1" Button save the first destination coordinate.
- The "Dest name 1" Button set the first destination name.
- Take the teleporter in your inventory, and go to the second destination, rez it and up it to 1 meter above the floor.
- Click on it to open the menu.
- The "Save Dest 2" Button save the second destination coordinate.
- The "Dest name 2" Button set the second destination name.
- Take it in your inventory and Rez the Teleporter where you want on your land (not on the floor: no need to sit on it).
- Click on it to open the Menu and choose the "Ready" Button.
- To use your teleporter:
- click on the teleporter
- click one of the 2 links (in the popup) to teleport at the first or at the second destination.
- "Ready" Button:
This button lock temporarily the setup menu: the setup menu will be unavailable until the next rez.
- Important:
To allow avatars to teleport anywhere in your land: you need to allow the teleport feature in your Land Settings (Options tab and Teleport routing): Anywhere (teleports may arrive at any location on the parcel). And if your land is "Group owned", you can allow the teleport feature for this group only: to disallow the teleport feature in the Land Settings and to allow it just for this Group: Group Profile -> "Roles" section -> "Abilities" tab...
Code:
//////////////////////////////////////////////////////////////////////////////
// Zx Teleporter Anywhere v5.1 //
// //
// Copyright (C) 2017 Luxen - Zonyx Technology //
// This program is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License version 3, as //
// published by the Free Software Foundation. //
// //
// 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, see <http://www.gnu.org/licenses/> //
//////////////////////////////////////////////////////////////////////////////
key owner = NULL_KEY;
integer New_Key = TRUE;
integer Ready = TRUE;
integer Zchan = -58846;
integer CTimer = FALSE;
integer ZxMenu = FALSE;
integer ZxText1 = FALSE;
integer ZxText2 = FALSE;
integer TOwner = FALSE;
integer TMember = FALSE;
string TDest1 = "Banyan/70/79/96";
string MDest1 = "Gadgets:";
string TDest2 = "Banyan/70/79/96";
string MDest2 = "Freebies:";
integer listenHandle;
FCTimer()
{
if (CTimer)
{
llSetTimerEvent(0.0);
CTimer = FALSE;
}
}
ChangeColor(vector Tcolor)
{
vector SColor = llGetColor(2);
if (SColor != Tcolor) llSetColor(Tcolor, 2);
}
string SetDest(vector VDest)
{
return llEscapeURL(llGetRegionName()) + "/" + (string)llRound(VDest.x) + "/" + (string)llRound(VDest.y) + "/" + (string)llRound(VDest.z);
}
default
{
state_entry()
{
if (owner) ;
else
{
owner = llGetOwner();
ChangeColor(<0.239, 0.600, 0.439>);
}
if (New_Key)
{
New_Key = FALSE;
Ready = TRUE;
Zchan = 0x80000000 | (integer)("0x"+(string)llGetKey());
}
FCTimer();
ZxMenu = FALSE;
ZxText1 = FALSE;
ZxText2 = FALSE;
}
on_rez(integer start_param)
{
if (owner != llGetOwner()) llResetScript();
else
{
New_Key = TRUE;
state restart_scr;
}
}
changed(integer change)
{
if (change & CHANGED_REGION_START)
{
llSleep(5.0);
state restart_scr;
}
}
touch_start(integer num_detected)
{
key ZTouch = llDetectedKey(0);
integer Zpass = FALSE;
if (TOwner)
{
if (ZTouch == owner) Zpass = TRUE;
}
else if (TMember)
{
integer ObjectGroup = FALSE;
list details = llGetObjectDetails(llGetKey(),[OBJECT_GROUP]);
if (llList2Key(details, 0)) ObjectGroup = TRUE;
if (llSameGroup(ZTouch) && ObjectGroup) Zpass = TRUE;
else if (ZTouch == owner) Zpass = TRUE;
}
else Zpass = TRUE;
if (Zpass)
{
string Dest = "\n " + "\n " + MDest1
+ "\n " + "secondlife:///app/teleport/" + TDest1
+ "\n " + "\n " + MDest2
+ "\n " + "secondlife:///app/teleport/" + TDest2;
if (Ready)
{
if (ZTouch == owner)
{
Dest = "- Click on the links below -"
+ "\n (Buttons are only visible to the Owner)" + Dest;
llListenRemove(listenHandle);
llSetTimerEvent(120.0);
CTimer = TRUE;
list Teleport_Tab = ["Public", "Member Only", "Owner Only", "Dest Name 1", "Save Dest 2", "Dest Name 2", "Reset", "Ready", "Save Dest 1", "Close"];
llDialog(ZTouch, Dest, Teleport_Tab , Zchan);
listenHandle = llListen(Zchan, "", owner, "");
ZxMenu = TRUE;
return;
}
}
Dest = "- Click on the links below -" + Dest;
llDialog(ZTouch, Dest, ["Close"], -5958);
}
}
listen(integer channel, string name, key id, string msg)
{
if (ZxMenu)
{
if(channel == Zchan && id == owner)
{
integer Tmsg = llStringLength(msg);
if (Tmsg < 50)
{
if (msg == "Public")
{
TOwner = FALSE;
TMember = FALSE;
ChangeColor(<0.239, 0.600, 0.439>);
}
else if (msg == "Member Only")
{
TOwner = FALSE;
TMember = TRUE;
ChangeColor(<0.000, 0.455, 0.851>);
}
else if (msg == "Owner Only")
{
TOwner = TRUE;
TMember = FALSE;
ChangeColor(<1.000, 0.255, 0.212>);
}
else if (msg == "Reset")
{
llSleep(0.5);
llResetScript();
}
else if (msg == "Ready") Ready = FALSE;
else if (msg == "Close") ;
else if (msg == "Save Dest 2")
{
vector VDest2 = llGetPos();
TDest2 = SetDest(VDest2);
}
else if (msg == "Dest Name 2")
{
llTextBox(owner, "Type the name of the destination 2... (Max: 50)", Zchan);
ZxText2 = TRUE;
ZxText1 = FALSE;
return;
}
else if (msg == "Save Dest 1")
{
vector VDest1 = llGetPos();
TDest1 = SetDest(VDest1);
}
else if (msg == "Dest Name 1")
{
llTextBox(owner, "Type the name of the destination 1... (Max: 50)", Zchan);
ZxText1 = TRUE;
ZxText2 = FALSE;
return;
}
else if (ZxText1)
{
msg = llStringTrim(msg, STRING_TRIM);
if (msg) MDest1 = msg;
}
else if (ZxText2)
{
msg = llStringTrim(msg, STRING_TRIM);
if (msg) MDest2 = msg;
}
else return;
llListenRemove(listenHandle);
state restart_scr;
}
}
}
}
timer()
{
llWhisper(0,"Resetting listen...\nMenu Off");
state restart_scr;
}
}
state restart_scr
{
state_entry()
{
state default;
}
on_rez(integer start_param)
{
if (owner != llGetOwner()) llResetScript();
else
{
New_Key = TRUE;
state default;
}
}
}