/AuroraDocs/OSSLFunctions/osTeleportAgent.lsl
Unknown | 77 lines | 74 code | 3 blank | 0 comment | 0 complexity | 9647022dc5617db50830a59714896668 MD5 | raw file
1// ---------------------------------------------------------------- 2// Example / Sample Script to show function use. 3// 4// Script Title: osTeleportAgent.lsl 5// Script Author: WhiteStar Magic 6// Threat Level: High 7// Script Source: 8// 9// Notes: See Script Source reference for more detailed information 10// This sample is full opensource and available to use as you see fit and desire. 11// Threat Levels only apply to OSSL & AA Functions 12// 13// ================================================================ 14// NOTE: This is a Polymorphic function. It has different command strings depending on usage. 15// 16// C# Source Lines: 17// public DateTime osTeleportAgent(string agent, int regionX, int regionY, vector position, vector lookat) 18// public DateTime osTeleportAgent(string agent, string regionName, vector position, vector lookat) 19// public DateTime osTeleportAgent(string agent, vector position, vector lookat) 20// 21// Inworld Script Lines: 22// osTeleportAgent(string agent, int regionX, int regionY, vector position, vector lookat); 23// osTeleportAgent(string agent, string regionName, vector position, vector lookat); 24// osTeleportAgent(string agent, vector position, vector lookat); 25// osTeleportAgent(string agent, string Ip_or_DNS:Port:RegionName, vector lookat); 26// 27// Example osTeleportAgent Script 28// 29// Set Destination as described below, There are a Few Options depending on Application: 30// Destination = "1000,1000"; = In-Grid Map XXXX,YYYY coordinates 31// Destination = "RegionName"; = In-Grid-TP to RegionName 32// Destination = <2560100.0, 2560100.0, 50.0>;= In-Grid to X,Y,Z Vector coordinates 33// 34// Destination = "TcpIpAddr:Port:RegionName"; = HyperGrid-TP method 35// Destination = "DNSname:Port:RegionName"; = HyperGrid-TP method 36// 37// Note: RegionName is Optionally Specified to deliver Avatar to specific region in an instance. 38// 39// ======================================================================================== 40// === SET DESTINATION INFO HERE === 41// 42string Destination = ""; // your target destination here (SEE NEXT LINES) Can Be 43vector LandingPoint = <100,100,50>; // X,Y,Z landing point for avatar to arrive at 44vector LookAt = <1,1,1>; // which way they look at when arriving 45// 46default 47{ 48 on_rez(integer start_param) 49 { 50 llResetScript(); 51 } 52 53 state_entry() 54 { 55 Destination = llGetRegionName(); 56 llWhisper(0, "Touch to osTeleportAgent to destination "+Destination+" @ Landing Point "+(string)LandingPoint); 57 } 58 59 changed(integer change) // something changed, take action 60 { 61 if(change & CHANGED_OWNER) 62 { 63 llResetScript(); 64 } 65 else if(change & 1024) // that bit is set during a region restart 66 { 67 llResetScript(); 68 } 69 } 70 71 touch_end(integer num_detected) 72 { 73 key avatar = llDetectedKey(0); 74 llInstantMessage(avatar, "Teleporting you to : "+Destination+" @ Landing Point "+(string)LandingPoint); 75 osTeleportAgent(avatar, Destination, LandingPoint, LookAt); 76 } 77}