Changes

Jump to navigation Jump to search
<br>
 
* Create a prim in world
* Add a new script to the prim
* Make a new notecard called Location and add it to the prims contents
* Adjust the notecard to your requirements
* Edit the two lists in the User Variables to change the fixed and dynamic button names
<br>
 
=== Script On Github ===
[https://github.com/Fire-And-Ice-Grid/LSL-And-OSSL-Script-Library LSL And OSSL Script Library On GitHub]
==== Licence ====
vector landing;
vector lookAt;
string gridUri= "";string regionName= "";string destination= "";integer debug = FALSE;integer mainMenuChannel; //global integer for menu channel integer mainMenuChannelListen;//clobal control integer for turning menu listen on and offkey imageUUID;string name;
SetUpListeners()
llListenControl (mainMenuChannelListen, FALSE); //turns off listeners for main menu channel
}//close set up listeners
 
string locationTestString(string input)
{
string testValue = "TpLocation_";
string testString = llGetSubString(input, 0, llStringLength(testValue)-1);
string locationName = "";
if (testString == testValue)
{
list elements = llParseStringKeepNulls(input, "_", "!");
locationName = llList2String(elements, 1);
}
return locationName;
}
string CleanUpString(string inputString)
string cleanString = llStringTrim( llToLower(inputString), STRING_TRIM );
return cleanString;
}
 
ProcessInstructionLine(string instruction, string data)
{
if (debug)
{
llOwnerSay("Debug:ProcessInstruction: Instruction:" + instruction + " Data:" + data);
}
if (instruction == "landing")
{
landing = (vector)data;
}
else if (instruction == "lookat")
{
lookAt = (vector)data;
}
else if (instruction == "griduri")
{
gridUri = data;
}
else if (instruction == "region")
{
regionName = data;
}
else if (instruction =="image")
{
imageUUID = data;
}
else if (instruction == "name")
{
name = data;
}
}
}//close error the notecard does not exist
}//close read config card.
 
Teleport(key aviUUID)
{
if (gridUri == "")
{
destination = regionName;
}
else
{
destination = gridUri + "/" + regionName;
}
if (destination == "" || destination == "/")
{
if (debug)
{
llOwnerSay("Debug:Teleport: No Desination, same region tp");
}
osTeleportAgent(aviUUID, landing, lookAt);
}
else
{
if (debug)
{
llOwnerSay("Debug:Teleport: Desitination Set as: " + destination);
}
osTeleportAgent(aviUUID, destination, landing, lookAt);
}
llRegionSayTo(aviUUID, 0, "Teleporting you to" + name);
}
 
string SetLocationName()
{
if (debug) llOwnerSay("Debug:SetLocationName:Entered");
string locationName = "";
if (name == "")
{
if (debug) llOwnerSay("Debug:SetLocationName:Empty Name string found");
if (regionName == "")
{
if (debug) llOwnerSay("Debug:SetLocationName:Empty Region Name found, location name set to the region name");
locationName += llGetRegionName();
}
else
{
if (debug) llOwnerSay("Debug:SetLocationName:location name set to the region name");
locationName += regionName;
}
if (gridUri == "")
{
locationName += "@" + osGetGridName();
}
else
{
locationName += gridUri;
}
}
else
{
locationName = name;
}
if (debug) llOwnerSay("Debug:SetLocationName:LocationName: " + locationName);
return locationName;
}
DeliverInfo(key aviUUID)
{
list inventoryItems=[];
integer inventoryNumber = llGetInventoryNumber(INVENTORY_ALL);
integer index;
{
string itemName = llGetInventoryName(INVENTORY_ALL, index);
if (debug) { llOwnerSay("Debug:DeliverInfo:ItemName: " + itemName ); } if (!(itemName == llGetScriptName() && || itemName !== "LocationTpLocation"))
{
if (debug)
{
llOwnerSay("Debug:DevliverInfo:" + itemName + "added to deliverables");
}
if (llGetInventoryPermMask(itemName, MASK_OWNER) & PERM_COPY)
{
}
}
if (inventoryItems == [] ) llSay { llRegionSayTo(0aviUUID, PUBLIC_CHANNEL, "No copiable items found, sorry."); }
else llGiveInventoryList(aviUUID, llGetObjectName(), inventoryItems); // 3.0 seconds delay
llResetScript();
}
ProcessInstructionLineUpdateImage(string instruction, string data)
{
if llSetLinkPrimitiveParamsFast(instruction == "landing"ALL_SIDES, [PRIM_TEXTURE, ALL_SIDES, imageUUID, <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0]) { landing = (vector)data; } else if (instruction == "lookat") { lookAt = (vector)data; } else if (instruction == "griduri") { gridUri = (data); } else if (instruction == "regoin") { regionName = (data); } destination = gridUri + "/" + regionName;
}
TeleportProcessMenuChoices(key aviUUID, string message)
{
if (destination message == "" || destination == "/Teleport")
{
llOwnerSay("Debug:Teleport: No Desination"); osTeleportAgent(aviUUID, landing, lookAt);
}
elseif (message == "GetInfo")
{
llOwnerSay("Debug:Teleport: Desitination Set"); osTeleportAgentDeliverInfo(aviUUID, destination, landing, lookAt);
}
llRegionSayTo(aviUUID, 0, "Teleporting you to : " + destination);
}
default
{
on_rez(integer start_param) { llResetScript(); }  changed (integer change)// something changed, take action { if (change & (CHANGED_OWNER | CHANGED_REGION_RESTART | CHANGED_INVENTORY | CHANGED_OWNER | CHANGED_REGION_START)) { llResetScript(); } } state_entry() { SetUpListeners(); ReadConfigCards("TpLocation"); UpdateImage(); llSetObjectName(SetLocationName() + " Teleport Board"); } touch_start(integer num_detected) { llListenControl (mainMenuChannelListen, TRUE); list buttons = ["Teleport", "GetInfo"]; llDialog(llDetectedKey(0), "Please select from the following options", buttons, mainMenuChannel); llSetTimerEvent(30); } listen(integer channel, string name, key uuid, string message) {//listens on the set channels, then depending on the heard channel sends the message for processing. if (channel == mainMenuChannel) { ProcessMenuChoices(uuid, message); } }//close listen
on_rez(integer start_param) { llResetScript(); } state_entry() { SetUpListeners(); ReadConfigCards("Location"); } touch_start(integer count) { //someones touched the prim llListenControl (mainMenuChannelListen, TRUE); list buttons = ["Teleport", "GetInfo"]; llDialog(llDetectedKey(0), "Please select from the following options", buttons, mainMenuChannel); llSetTimerEvent(30); }// close touch start listen(integer channel, string name, key id, string message) {//listens on the set channels, then depending on the heard channel sends the message for processing. if (channel == mainMenuChannel) { llOwnerSay(message); if (message == "Teleport") Teleport(id); else if (message == "GetInfo") DeliverInfo(id); } }//close listen timer() { llWhisper(PUBLIC_CHANNEL, "sorry the menu timed out, please click again"); llResetScript(); }  }// close state default
</syntaxhighlight>
==== Notecard (notecard name must me TpLocation) ====
<syntaxhighlight lang="ini" line>
#Fire And Ice Teleport Board - Single Location Config Card#============================== #Will work on the same sim / to another sim on the same grid or a location on another grid. #All locations needs a landing point and looking at #Teleport In the same region:#----------------------------------# Leave the region name and the grid uri empty #Teleport To Another Region On The Same Grid#--------------------------------------------------------#Fill in the region name but not the Grid Uri,
# Blank lines are ignoredTeleport To Another Region On A Different Grid# Lines starting with a --------------------------------------------------------# are ingoredFill in the region name and the grid uri
#To make a TP inside the same region leave the GRIDURI Options Description#--------------------------#Blank Lines and Region blanklines starting with # are ignored#Landing : point is the region position a vector <x,y,z>which represents the landing point on the destination region. #LookAt : is the direction <x,y,z> - this doesn't always workthe avatar will face when they land (assuming its ever fixed)#Grid Uri Examp;eGridUri: is the URI for the destination grid. Example: http://fireandicegrid.net:8002#Region : is the name of the destination region . Example: Covey Stores#Image: this is the UUID/Key of the image you wish to display. #Name: a descriptive nameused to tell people where they are being teleported to, the board will also rename its self using this.
Landing = <1132.76846,1128.44232,2523.36178>LookAt = <0648.81219,084.31132,044.19897>GRIDURI GridUri = Region = Norse AdventureImage = ede3919d-433e-4cc6-841b-04e5f75bd179Name =
</syntaxhighlight>

Navigation menu