Difference between revisions of "Talk:BuildSlurl (NewAge)"
Jump to navigation
Jump to search
Fred Gandt (talk | contribs) (The page of which this is the talk (O.o) depicts what I considered to be an inefficient method of creating a slurl from string & vector data. I posted an alt suggestion.) |
Fred Gandt (talk | contribs) (→Alternative slurl type links: Changed function since being educated by Rand & Babbage (thanx again)) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{KBnote|This page has been moved from [[llSLURL (NewAge)]]. See [[Suggested For Deletion/LlSLURL (NewAge)|here]] for the related discussion.}} | |||
== Alternative slurl type links == | |||
A thrown-together script example showing 3 different types of destination/teleport links. | |||
<lsl>string message_1 = "Click this link for destination information and teleport option:\n"; | <lsl>string message_1 = "Click this link for destination information and teleport option:\n"; | ||
Line 30: | Line 22: | ||
string SLURL(string region, vector pos) | string SLURL(string region, vector pos) | ||
{ | { | ||
return (llEscapeURL(region) + "/" + ((string) | return (llEscapeURL(region) + "/" + ((string)((integer)pos.x)) + "/" + ((string)((integer)pos.y)) + "/" + ((string)llCeil(pos.z))); | ||
} | } | ||
Line 74: | Line 66: | ||
} | } | ||
} | } | ||
}</lsl>-- '''[[User:Fred_Gandt|Fred Gandt]]''' <sup><small>([[User talk:Fred_Gandt|talk]]|[[Special:Contributions/Fred_Gandt|contribs]])</small></sup> | }</lsl>-- '''[[User:Fred_Gandt|Fred Gandt]]''' <sup><small>([[User talk:Fred_Gandt|talk]]|[[Special:Contributions/Fred_Gandt|contribs]])</small></sup> 19:41, 4 September 2010 (UTC) |
Latest revision as of 16:08, 9 September 2010
Note: This page has been moved from llSLURL (NewAge). See here for the related discussion. |
Alternative slurl type links
A thrown-together script example showing 3 different types of destination/teleport links.
<lsl>string message_1 = "Click this link for destination information and teleport option:\n";
string message_2 = "Click this link for instant teleport:\n";
string message_3 = "This link can be used on a web site to direct users in-world:\n";
string method_1 = "secondlife://"; // Usable in-world only
string method_2 = "secondlife:///app/teleport/"; // Instant teleport
string method_3 = "http://slurl.com/secondlife/"; // Genuine slurl usable in and out-world
string region_name;
vector coords;
string SLURL(string region, vector pos) {
return (llEscapeURL(region) + "/" + ((string)((integer)pos.x)) + "/" + ((string)((integer)pos.y)) + "/" + ((string)llCeil(pos.z)));
}
default {
on_rez(integer param) { llResetScript(); } changed(integer change) { if(change & CHANGED_REGION) { llResetScript(); } } state_entry() { // The user simply adds the destination region name and landing pos as the description of the prim (comma separated). list destination = llCSV2List(llGetObjectDesc()); if(llGetListLength(destination) == 2) { // Various checks could be employed to varify the user has added the destination to the prim desc correctly (idiot proofing!) region_name = llList2String(destination, 0); coords = ((vector)llList2String(destination, 1)); return; } else { // Otherwise the destination defaults to the prim position (Useful? Better than nothing). region_name = llGetRegionName(); coords = llGetPos(); } } touch_start(integer nd) { while(nd) { string dest = SLURL(region_name, coords); llInstantMessage(llDetectedKey(--nd), ("\n" + message_1 + method_1 + dest + "\n" + message_2 + method_2 + dest + "\n" + message_3 + method_3 + dest)); } }
}</lsl>-- Fred Gandt (talk|contribs) 19:41, 4 September 2010 (UTC)