<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kerik+Rau</id>
	<title>Second Life Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kerik+Rau"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/wiki/Special:Contributions/Kerik_Rau"/>
	<updated>2026-04-08T05:38:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=250432</id>
		<title>User:Kerik Rau/n2k.AppSpot</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=250432"/>
		<updated>2009-02-20T02:16:44Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
This service is designed to provide effortless name to key and the inverse conversions.  It does so by utilizing web services that are readily available and acts as a proxy that strips things down to where they are easily usable within LSL (or any other application).  It is hosted on Google&#039;s AppEngine, which means that it should easily scale with most demands placed on it.&lt;br /&gt;
&lt;br /&gt;
The base url is http://n2k.AppSpot.com&lt;br /&gt;
&lt;br /&gt;
==Name 2 Key==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.AppSpot.com/n2k/Kerik%20Rau&lt;br /&gt;
&lt;br /&gt;
The response will either be the key or an empty string.&lt;br /&gt;
&lt;br /&gt;
==Key 2 Name==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.appspot.com/k2n/cc62e3dd-a3e0-4556-9585-bfcbc7997f77&lt;br /&gt;
&lt;br /&gt;
Note: Some keys will not resolve.  This is due to world.secondlife.com/resident/ not returning the profile.  See http://jira.secondlife.com/browse/WEB-952 for the status of this issue.&lt;br /&gt;
&lt;br /&gt;
==Data Validity==&lt;br /&gt;
&lt;br /&gt;
- You should always check to see if the response returned 200.  App Engine will send out a temporarily unavailable at times until the application wakes up.&lt;br /&gt;
&lt;br /&gt;
- For Name2Key you can validate their length.  All avatars have a key length of 36.&lt;br /&gt;
&lt;br /&gt;
- Key2Name will not always resolve, until LL modifies things upstream this will not change.&lt;br /&gt;
&lt;br /&gt;
==Example Script==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//&lt;br /&gt;
//      Example Query Script, tells the avatar that clicks it their &lt;br /&gt;
//      key and name based on reverse lookups.  &lt;br /&gt;
//&lt;br /&gt;
//      The service caches lookups in memcached, which means if you &lt;br /&gt;
//      click it a second time it should be a lot faster.&lt;br /&gt;
//&lt;br /&gt;
//      Sometimes App Engine just craps out, so you should always &lt;br /&gt;
//      check for a status code of 200.  If you are concerned with &lt;br /&gt;
//      data integrety you should verify the key length.&lt;br /&gt;
//&lt;br /&gt;
//&lt;br /&gt;
//      The Key2Name portion of the service is not fully functional,&lt;br /&gt;
//      currently LL plans on adding in web profiles for all avatars.&lt;br /&gt;
//&lt;br /&gt;
//      see http://jira.secondlife.com/browse/WEB-952&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
//      - Kerik&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
string gLookupUrl = &amp;quot;http://n2k.appspot.com&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
key gKeyRequestID;&lt;br /&gt;
key gNameRequestID;&lt;br /&gt;
&lt;br /&gt;
integer gLocked = 0;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if(gLocked == FALSE)&lt;br /&gt;
        {&lt;br /&gt;
            key avatar = llDetectedKey(0);&lt;br /&gt;
            &lt;br /&gt;
            gNameRequestID = llHTTPRequest( gLookupUrl + &amp;quot;/k2n/&amp;quot; + (string) avatar, [], &amp;quot;&amp;quot; );&lt;br /&gt;
            gKeyRequestID = llHTTPRequest( gLookupUrl + &amp;quot;/n2k/&amp;quot; +  llEscapeURL(llKey2Name(avatar)), [], &amp;quot;&amp;quot; );&lt;br /&gt;
            &lt;br /&gt;
            llSetTimerEvent(15);&lt;br /&gt;
            &lt;br /&gt;
            gLocked == TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            llWhisper(0, &amp;quot;Please wait for my request to finish&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    http_response( key request_id, integer status, list metadata, string body )&lt;br /&gt;
    {&lt;br /&gt;
        //it is best to check if the response was correct (ie status == 200), sometimes app engine &lt;br /&gt;
        //gets a little fidgety (particuarly when it hasn&#039;t been requested in awhile)&lt;br /&gt;
        &lt;br /&gt;
        if(status == 200)&lt;br /&gt;
        {&lt;br /&gt;
            if(request_id == gKeyRequestID)&lt;br /&gt;
            {&lt;br /&gt;
                integer length = llStringLength(body);&lt;br /&gt;
                &lt;br /&gt;
                if(length == 36)  // a proper key is 36 characters long&lt;br /&gt;
                    llWhisper(0, &amp;quot;Your key is \&amp;quot;&amp;quot; + body + &amp;quot;\&amp;quot;&amp;quot;);&lt;br /&gt;
                &lt;br /&gt;
                //ideally the service will return an empty string if no key is found&lt;br /&gt;
                else if(length == 0) &lt;br /&gt;
                    llWhisper(0, &amp;quot;No key was returned, this shouldn&#039;t happen!&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                else&lt;br /&gt;
                    llWhisper(0, &amp;quot;An invalid response was returned, this shouldn&#039;t happen!&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                gKeyRequestID = NULL_KEY;&lt;br /&gt;
                    &lt;br /&gt;
            }&lt;br /&gt;
            else if(request_id == gNameRequestID)&lt;br /&gt;
            {&lt;br /&gt;
                if(body == &amp;quot;&amp;quot;)&lt;br /&gt;
                    llWhisper(0, &amp;quot;No name was returned, this happens sometimes, particuarly on older avatars.&amp;quot;);&lt;br /&gt;
                else&lt;br /&gt;
                    llWhisper(0, &amp;quot;Your name is \&amp;quot;&amp;quot; + body + &amp;quot;\&amp;quot;&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                gNameRequestID = NULL_KEY;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            llWhisper(0, &amp;quot;The request was invalid!&amp;quot;);&lt;br /&gt;
            &lt;br /&gt;
    &lt;br /&gt;
        //Release the lock when both requests are finished&lt;br /&gt;
        if(gNameRequestID == NULL_KEY &amp;amp;&amp;amp; gKeyRequestID == NULL_KEY)&lt;br /&gt;
        {&lt;br /&gt;
            gLocked = FALSE;&lt;br /&gt;
            llSetTimerEvent(0);   &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper(0, &amp;quot;The request timed out&amp;quot;);&lt;br /&gt;
        gLocked = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=250422</id>
		<title>User:Kerik Rau/n2k.AppSpot</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=250422"/>
		<updated>2009-02-20T02:15:28Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This service is designed to provide effortless name to key and the inverse conversions.  It does so by utilizing web services that are readily available and acts as a proxy that strips things down to where they are easily usable within LSL (or any other application).  It is hosted on Google&#039;s AppEngine, which means that it should easily scale with most demands placed on it.&lt;br /&gt;
&lt;br /&gt;
The base url is http://n2k.AppSpot.com&lt;br /&gt;
&lt;br /&gt;
==Name 2 Key==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.AppSpot.com/n2k/Kerik%20Rau&lt;br /&gt;
&lt;br /&gt;
The response will either be the key or an empty string.&lt;br /&gt;
&lt;br /&gt;
==Key 2 Name==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.appspot.com/k2n/cc62e3dd-a3e0-4556-9585-bfcbc7997f77&lt;br /&gt;
&lt;br /&gt;
Note: Some keys will not resolve.  This is due to world.secondlife.com/resident/ not returning the profile.  See http://jira.secondlife.com/browse/WEB-952 for the status of this issue.&lt;br /&gt;
&lt;br /&gt;
==Data Validity==&lt;br /&gt;
&lt;br /&gt;
- You should always check to see if the response returned 200.  App Engine will send out a temporarily unavailable at times until the application wakes up.&lt;br /&gt;
&lt;br /&gt;
- For Name2Key you can validate their length.  All avatars have a key length of 36.&lt;br /&gt;
&lt;br /&gt;
- Key2Name will not always resolve, until LL modifies things upstream this will not change.&lt;br /&gt;
&lt;br /&gt;
==Example Script==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//&lt;br /&gt;
//      Example Query Script, tells the avatar that clicks it their &lt;br /&gt;
//      key and name based on reverse lookups.  &lt;br /&gt;
//&lt;br /&gt;
//      The service caches lookups in memcached, which means if you &lt;br /&gt;
//      click it a second time it should be a lot faster.&lt;br /&gt;
//&lt;br /&gt;
//      Sometimes App Engine just craps out, so you should always &lt;br /&gt;
//      check for a status code of 200.  If you are concerned with &lt;br /&gt;
//      data integrety you should verify the key length.&lt;br /&gt;
//&lt;br /&gt;
//&lt;br /&gt;
//      The Key2Name portion of the service is not fully functional,&lt;br /&gt;
//      currently LL plans on adding in web profiles for all avatars.&lt;br /&gt;
//&lt;br /&gt;
//      see http://jira.secondlife.com/browse/WEB-952&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
//      - Kerik&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
string gLookupUrl = &amp;quot;http://n2k.appspot.com&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
key gKeyRequestID;&lt;br /&gt;
key gNameRequestID;&lt;br /&gt;
&lt;br /&gt;
integer gLocked = 0;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if(gLocked == FALSE)&lt;br /&gt;
        {&lt;br /&gt;
            key avatar = llDetectedKey(0);&lt;br /&gt;
            &lt;br /&gt;
            gNameRequestID = llHTTPRequest( gLookupUrl + &amp;quot;/k2n/&amp;quot; + (string) avatar, [], &amp;quot;&amp;quot; );&lt;br /&gt;
            gKeyRequestID = llHTTPRequest( gLookupUrl + &amp;quot;/n2k/&amp;quot; +  llEscapeURL(llKey2Name(avatar)), [], &amp;quot;&amp;quot; );&lt;br /&gt;
            &lt;br /&gt;
            llSetTimerEvent(15);&lt;br /&gt;
            &lt;br /&gt;
            gLocked == TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            llWhisper(0, &amp;quot;Please wait for my request to finish&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    http_response( key request_id, integer status, list metadata, string body )&lt;br /&gt;
    {&lt;br /&gt;
        //it is best to check if the response was correct (ie status == 200), sometimes app engine &lt;br /&gt;
        //gets a little fidgety (particuarly when it hasn&#039;t been requested in awhile)&lt;br /&gt;
        &lt;br /&gt;
        if(status == 200)&lt;br /&gt;
        {&lt;br /&gt;
            if(request_id == gKeyRequestID)&lt;br /&gt;
            {&lt;br /&gt;
                integer length = llStringLength(body);&lt;br /&gt;
                &lt;br /&gt;
                if(length == 36)  // a proper key is 36 characters long&lt;br /&gt;
                    llWhisper(0, &amp;quot;Your key is \&amp;quot;&amp;quot; + body + &amp;quot;\&amp;quot;&amp;quot;);&lt;br /&gt;
                &lt;br /&gt;
                //ideally the service will return an empty string if no key is found&lt;br /&gt;
                else if(length == 0) &lt;br /&gt;
                    llWhisper(0, &amp;quot;No key was returned, this shouldn&#039;t happen!&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                else&lt;br /&gt;
                    llWhisper(0, &amp;quot;An invalid response was returned, this shouldn&#039;t happen!&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                gKeyRequestID = NULL_KEY;&lt;br /&gt;
                    &lt;br /&gt;
            }&lt;br /&gt;
            else if(request_id == gNameRequestID)&lt;br /&gt;
            {&lt;br /&gt;
                if(body == &amp;quot;&amp;quot;)&lt;br /&gt;
                    llWhisper(0, &amp;quot;No name was returned, this happens sometimes, particuarly on older avatars.&amp;quot;);&lt;br /&gt;
                else&lt;br /&gt;
                    llWhisper(0, &amp;quot;Your name is \&amp;quot;&amp;quot; + body + &amp;quot;\&amp;quot;&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                gNameRequestID = NULL_KEY;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            llWhisper(0, &amp;quot;The request was invalid!&amp;quot;);&lt;br /&gt;
            &lt;br /&gt;
    &lt;br /&gt;
        //Release the lock when both requests are finished&lt;br /&gt;
        if(gNameRequestID == NULL_KEY &amp;amp;&amp;amp; gKeyRequestID == NULL_KEY)&lt;br /&gt;
        {&lt;br /&gt;
            gLocked = FALSE;&lt;br /&gt;
            llSetTimerEvent(0);   &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper(0, &amp;quot;The request timed out&amp;quot;);&lt;br /&gt;
        gLocked = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=250412</id>
		<title>User:Kerik Rau/n2k.AppSpot</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=250412"/>
		<updated>2009-02-20T02:14:16Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This service is designed to provide effortless name to key and the inverse conversions.  It does so by utilizing web services that are readily available and acts as a proxy that strips things down to where they are easily usable within LSL (or any other application).  It is hosted on Google&#039;s AppEngine, which means that it should easily scale with most demands placed on it.&lt;br /&gt;
&lt;br /&gt;
The base url is http://n2k.AppSpot.com&lt;br /&gt;
&lt;br /&gt;
==Name 2 Key==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.AppSpot.com/n2k/Kerik%20Rau&lt;br /&gt;
&lt;br /&gt;
The response will either be the key or an empty string.&lt;br /&gt;
&lt;br /&gt;
==Key 2 Name==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.appspot.com/k2n/cc62e3dd-a3e0-4556-9585-bfcbc7997f77&lt;br /&gt;
&lt;br /&gt;
Note: Some keys will not resolve.  This is due to world.secondlife.com/resident/ not returning the profile.  See http://jira.secondlife.com/browse/WEB-952 for the status of this issue.&lt;br /&gt;
&lt;br /&gt;
==Data Validity==&lt;br /&gt;
&lt;br /&gt;
- You should always check to see if the response returned 200.  App Engine will send out a temporarily unavailable at times until the application wakes up.&lt;br /&gt;
&lt;br /&gt;
- For Name2Key you can validate their length.  All avatars have a key length of 36.&lt;br /&gt;
&lt;br /&gt;
- Key2Name will not always resolve, until LL modifies things upstream this will not change.&lt;br /&gt;
&lt;br /&gt;
==Example Script==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//&lt;br /&gt;
//      Example Query Script, tells the avatar that clicks it their &lt;br /&gt;
//      key and name based on reverse lookups.  &lt;br /&gt;
//&lt;br /&gt;
//      The service caches lookups in memcached, which means if you &lt;br /&gt;
//      click it a second time it should be a lot faster.&lt;br /&gt;
//&lt;br /&gt;
//      Sometimes App Engine just craps out, so you should always &lt;br /&gt;
//      check for a status code of 200.  If you are concerned with &lt;br /&gt;
//      data integrety you should verify the key length.&lt;br /&gt;
//&lt;br /&gt;
//&lt;br /&gt;
//      The Key2Name portion of the service is not fully functional,&lt;br /&gt;
//      currently LL plans on adding in web profiles for all avatars.&lt;br /&gt;
//&lt;br /&gt;
//      see http://jira.secondlife.com/browse/WEB-952&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
//      - Kerik&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
string gLookupUrl = &amp;quot;http://n2k.appspot.com&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
key gKeyRequestID;&lt;br /&gt;
key gNameRequestID;&lt;br /&gt;
&lt;br /&gt;
integer gLocked = 0;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if(gLocked == 0)&lt;br /&gt;
        {&lt;br /&gt;
            key avatar = llDetectedKey(0);&lt;br /&gt;
            &lt;br /&gt;
            gNameRequestID = llHTTPRequest( gLookupUrl + &amp;quot;/k2n/&amp;quot; + (string) avatar, [], &amp;quot;&amp;quot; );&lt;br /&gt;
            gKeyRequestID = llHTTPRequest( gLookupUrl + &amp;quot;/n2k/&amp;quot; +  llEscapeURL(llKey2Name(avatar)), [], &amp;quot;&amp;quot; );&lt;br /&gt;
            &lt;br /&gt;
            llSetTimerEvent(15);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            llWhisper(0, &amp;quot;Please wait for my request to finish&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    http_response( key request_id, integer status, list metadata, string body )&lt;br /&gt;
    {&lt;br /&gt;
        //it is best to check if the response was correct (ie status == 200), sometimes app engine &lt;br /&gt;
        //gets a little fidgety (particuarly when it hasn&#039;t been requested in awhile)&lt;br /&gt;
        &lt;br /&gt;
        if(status == 200)&lt;br /&gt;
        {&lt;br /&gt;
            if(request_id == gKeyRequestID)&lt;br /&gt;
            {&lt;br /&gt;
                integer length = llStringLength(body);&lt;br /&gt;
                &lt;br /&gt;
                if(length == 36)  // a proper key is 36 characters long&lt;br /&gt;
                    llWhisper(0, &amp;quot;Your key is \&amp;quot;&amp;quot; + body + &amp;quot;\&amp;quot;&amp;quot;);&lt;br /&gt;
                &lt;br /&gt;
                //ideally the service will return an empty string if no key is found&lt;br /&gt;
                else if(length == 0) &lt;br /&gt;
                    llWhisper(0, &amp;quot;No key was returned, this shouldn&#039;t happen!&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                else&lt;br /&gt;
                    llWhisper(0, &amp;quot;An invalid response was returned, this shouldn&#039;t happen!&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                gKeyRequestID = NULL_KEY;&lt;br /&gt;
                    &lt;br /&gt;
            }&lt;br /&gt;
            else if(request_id == gNameRequestID)&lt;br /&gt;
            {&lt;br /&gt;
                if(body == &amp;quot;&amp;quot;)&lt;br /&gt;
                    llWhisper(0, &amp;quot;No name was returned, this happens sometimes, particuarly on older avatars.&amp;quot;);&lt;br /&gt;
                else&lt;br /&gt;
                    llWhisper(0, &amp;quot;Your name is \&amp;quot;&amp;quot; + body + &amp;quot;\&amp;quot;&amp;quot;);&lt;br /&gt;
                    &lt;br /&gt;
                gNameRequestID = NULL_KEY;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            llWhisper(0, &amp;quot;The request was invalid!&amp;quot;);&lt;br /&gt;
            &lt;br /&gt;
    &lt;br /&gt;
        //Release the lock when both requests are finished&lt;br /&gt;
        if(gNameRequestID == NULL_KEY &amp;amp;&amp;amp; gKeyRequestID == NULL_KEY)&lt;br /&gt;
        {&lt;br /&gt;
            gLocked = FALSE;&lt;br /&gt;
            llSetTimerEvent(0);   &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper(0, &amp;quot;The request timed out&amp;quot;);&lt;br /&gt;
        gLocked = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=212153</id>
		<title>User:Kerik Rau/n2k.AppSpot</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=212153"/>
		<updated>2009-01-27T22:23:59Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This service is designed to provide effortless name to key and the inverse conversions.  It does so by utilizing web services that are readily available and acts as a proxy that strips things down to where they are easily usable within LSL (or any other application).  It is hosted on Google&#039;s AppEngine, which means that it should easily scale with most demands placed on it.&lt;br /&gt;
&lt;br /&gt;
The base url is http://n2k.AppSpot.com&lt;br /&gt;
&lt;br /&gt;
==Name 2 Key==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.AppSpot.com/n2k/Kerik+Rau&lt;br /&gt;
(Note the + was added in to keep the URL intact, you can use a space or %20 if you prefer)&lt;br /&gt;
&lt;br /&gt;
The response will either be the key or an empty string.&lt;br /&gt;
&lt;br /&gt;
==Key 2 Name==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.appspot.com/k2n/cc62e3dd-a3e0-4556-9585-bfcbc7997f77&lt;br /&gt;
&lt;br /&gt;
Note: Some keys will not resolve.  This is due to world.secondlife.com/resident/ not returning the profile.  See http://jira.secondlife.com/browse/WEB-952 for the status of this issue.&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=211513</id>
		<title>User:Kerik Rau/n2k.AppSpot</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=211513"/>
		<updated>2009-01-27T05:21:14Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This service is designed to provide effortless name to key and the inverse conversions.  It does so by utilizing web services that are readily available and acts as a proxy that strips things down to where they are easily usable within LSL (or any other application).  It is hosted on Google&#039;s AppEngine, which means that it should easily scale with most demands placed on it.&lt;br /&gt;
&lt;br /&gt;
The base url is http://n2k.AppSpot.com&lt;br /&gt;
&lt;br /&gt;
==Name 2 Key==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.AppSpot.com/n2k/Kerik+Rau&lt;br /&gt;
(Note the + was added in to keep the URL intact, you can use a space or %20 if you prefer)&lt;br /&gt;
&lt;br /&gt;
The response will either be the key or an empty string.&lt;br /&gt;
&lt;br /&gt;
==Key 2 Name==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.appspot.com/k2n/cc62e3dd-a3e0-4556-9585-bfcbc7997f77&lt;br /&gt;
&lt;br /&gt;
Note: Some keys will not resolve.  This is due to world.secondlife.com/resident/ not returning the profile.  I don&#039;t know if this is a bug or if it is an intended feature.&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/XY2URL&amp;diff=211503</id>
		<title>User:Kerik Rau/XY2URL</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/XY2URL&amp;diff=211503"/>
		<updated>2009-01-27T05:03:24Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: New page: &amp;lt;lsl&amp;gt;  //Store the target coorinates in &amp;quot;X1 Y1 X2 Y2&amp;quot;, creating a bounding box with a height and width list Coords = [&amp;quot;0.112 0.641 0.371 0.740&amp;quot;]; list URLs = [&amp;quot;http://wiki.secondlife.com/w...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//Store the target coorinates in &amp;quot;X1 Y1 X2 Y2&amp;quot;, creating a bounding box with a height and width&lt;br /&gt;
list Coords = [&amp;quot;0.112 0.641 0.371 0.740&amp;quot;];&lt;br /&gt;
list URLs = [&amp;quot;http://wiki.secondlife.com/wiki/User:Kerik_Rau/n2k.AppSpot&amp;quot;];&lt;br /&gt;
&lt;br /&gt;
string Message = &amp;quot;More information is available via this WebSite.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if(llDetectedTouchFace(0) == 3)&lt;br /&gt;
        {&lt;br /&gt;
            integer i = 0;&lt;br /&gt;
            integer NumCoords = llGetListLength(Coords);&lt;br /&gt;
            &lt;br /&gt;
            for(i = 0; i &amp;lt; NumCoords; ++i)&lt;br /&gt;
            {&lt;br /&gt;
                list CoordList = llParseString2List(llList2String(Coords, i), [&amp;quot; &amp;quot;], []);&lt;br /&gt;
                &lt;br /&gt;
                float X1 = (float) llList2String(CoordList, 0);&lt;br /&gt;
                float Y1 = (float) llList2String(CoordList, 1);&lt;br /&gt;
                float X2 = (float) llList2String(CoordList, 2);   &lt;br /&gt;
                float Y2 = (float) llList2String(CoordList, 3);&lt;br /&gt;
                &lt;br /&gt;
                vector tPos = llDetectedTouchST(0);&lt;br /&gt;
                &lt;br /&gt;
                if(tPos.x &amp;gt; X1 &amp;amp;&amp;amp; tPos.x &amp;lt; X2 &amp;amp;&amp;amp; tPos.y &amp;gt; Y1 &amp;amp;&amp;amp; tPos.y &amp;lt; Y2)&lt;br /&gt;
                {&lt;br /&gt;
                    llLoadURL(llDetectedKey(0), Message, llList2String(URLs, i));&lt;br /&gt;
                    return;   &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            //Print out the coords if were the owner, so we can add them in&lt;br /&gt;
            if(llDetectedKey(0) == llGetOwner())&lt;br /&gt;
                llOwnerSay((string) llDetectedTouchST(0));&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=211493</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=211493"/>
		<updated>2009-01-27T05:01:04Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For all intentions this is a dumping ground of information that might be useful.  All the information found here is free to use however you wish with no limitations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot;  style=&amp;quot;background: #B8E2FF; border: 1px solid #0090FF;&amp;quot;&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
| width=&amp;quot;150px&amp;quot; | Projects&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/Apoc | Apocalypse HUD ]]&lt;br /&gt;
| A modular tool designed to reduce code reproduction and provide the shortest path available for a given task.  Thus it is fast and highly scalable by design.&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/n2k.AppSpot | n2k.AppSpot ]]&lt;br /&gt;
| A project aiming to make a name2key and key2name service via Google&#039;s App Engine that utilizes the Second Life Search rather than storing keys within a database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot; style=&amp;quot;background: #FFEC80; border: 1px solid #E3AD35;&amp;quot;&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
| width=&amp;quot;150px&amp;quot; | Scripts&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/Simple Slide Show | Simple Slide Show ]]&lt;br /&gt;
| Throw in the textures and it will automatically rotate through them.&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/MapTileURL | Map Tile URL ]]&lt;br /&gt;
| An LSL function that returns a string containing the current regions tile URL&lt;br /&gt;
|- &lt;br /&gt;
| [[ User:Kerik_Rau/XY2URL | XY to URL ]]&lt;br /&gt;
| A simple script that adds multiple links to a single prim&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=209253</id>
		<title>User:Kerik Rau/n2k.AppSpot</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=209253"/>
		<updated>2009-01-24T19:31:40Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This service is designed to provide effortless name to key and the inverse conversions.  It does so by utilizing web services that are readily available and acts as a proxy that strips things down to where they are easily usable within LSL (or any other application).  It is hosted on Google&#039;s AppEngine, which means that it should easily scale with most demands placed on it.&lt;br /&gt;
&lt;br /&gt;
The base url is http://n2k.AppSpot.com&lt;br /&gt;
&lt;br /&gt;
==Name 2 Key==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.AppSpot.com/n2k/Kerik+Rau&lt;br /&gt;
(Note the + was added in to keep the URL intact, you can use a space or %20 if you prefer)&lt;br /&gt;
&lt;br /&gt;
The response will either be the key or an empty string.&lt;br /&gt;
&lt;br /&gt;
==Key 2 Name==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.appspot.com/k2n/cc62e3dd-a3e0-4556-9585-bfcbc7997f77&lt;br /&gt;
&lt;br /&gt;
Note: Some keys will not resolve.  For example check http://world.secondlife.com/resident/cc62e3dd-a3e0-4556-9585-bfcbc7997f77 to verify the key resolves into a person.&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=209243</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=209243"/>
		<updated>2009-01-24T19:16:51Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For all intentions this is a dumping ground of information that might be useful.  All the information found here is free to use however you wish with no limitations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot;  style=&amp;quot;background: #B8E2FF; border: 1px solid #0090FF;&amp;quot;&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
| width=&amp;quot;150px&amp;quot; | Projects&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/Apoc | Apocalypse HUD ]]&lt;br /&gt;
| A modular tool designed to reduce code reproduction and provide the shortest path available for a given task.  Thus it is fast and highly scalable by design.&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/n2k.AppSpot | n2k.AppSpot ]]&lt;br /&gt;
| A project aiming to make a name2key and key2name service via Google&#039;s App Engine that utilizes the Second Life Search rather than storing keys within a database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot; style=&amp;quot;background: #FFEC80; border: 1px solid #E3AD35;&amp;quot;&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
| width=&amp;quot;150px&amp;quot; | Scripts&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/Simple Slide Show | Simple Slide Show ]]&lt;br /&gt;
| Throw in the textures and it will automatically rotate through them.&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/MapTileURL | Map Tile URL ]]&lt;br /&gt;
| An LSL function that returns a string containing the current regions tile URL&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k&amp;diff=209233</id>
		<title>User:Kerik Rau/n2k</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k&amp;diff=209233"/>
		<updated>2009-01-24T19:16:12Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: User:Kerik Rau/n2k moved to User:Kerik Rau/n2k.AppSpot: moved to better conform with the name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[User:Kerik Rau/n2k.AppSpot]]&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=209223</id>
		<title>User:Kerik Rau/n2k.AppSpot</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=209223"/>
		<updated>2009-01-24T19:16:12Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: User:Kerik Rau/n2k moved to User:Kerik Rau/n2k.AppSpot: moved to better conform with the name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This service is designed to provide effortless name to key and the inverse conversions.  It does so by utilizing web services that are readily available and acts as a proxy that strips things down to where they are easily usable within LSL (or any other application).  It is hosted on Google&#039;s AppEngine, which means that it should easily scale with most demands placed on it.&lt;br /&gt;
&lt;br /&gt;
The base url is http://n2k.AppSpot.com&lt;br /&gt;
&lt;br /&gt;
==Name 2 Key==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.AppSpot.com/n2k/Kerik+Rau&lt;br /&gt;
(Note the + was added in to keep the URL intact, you can use a space or %20 if you prefer)&lt;br /&gt;
&lt;br /&gt;
The response will either be the key or an empty string.&lt;br /&gt;
&lt;br /&gt;
==Key 2 Name==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.appspot.com/k2n/cc62e3dd-a3e0-4556-9585-bfcbc7997f77&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=209213</id>
		<title>User:Kerik Rau/n2k.AppSpot</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=209213"/>
		<updated>2009-01-24T19:14:41Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This service is designed to provide effortless name to key and the inverse conversions.  It does so by utilizing web services that are readily available and acts as a proxy that strips things down to where they are easily usable within LSL (or any other application).  It is hosted on Google&#039;s AppEngine, which means that it should easily scale with most demands placed on it.&lt;br /&gt;
&lt;br /&gt;
The base url is http://n2k.AppSpot.com&lt;br /&gt;
&lt;br /&gt;
==Name 2 Key==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.AppSpot.com/n2k/Kerik+Rau&lt;br /&gt;
(Note the + was added in to keep the URL intact, you can use a space or %20 if you prefer)&lt;br /&gt;
&lt;br /&gt;
The response will either be the key or an empty string.&lt;br /&gt;
&lt;br /&gt;
==Key 2 Name==&lt;br /&gt;
&lt;br /&gt;
example: http://n2k.appspot.com/k2n/cc62e3dd-a3e0-4556-9585-bfcbc7997f77&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=208513</id>
		<title>User:Kerik Rau/n2k.AppSpot</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/n2k.AppSpot&amp;diff=208513"/>
		<updated>2009-01-24T04:44:36Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: New page: This service is designed to provide effortless name to key and the inverse conversions.  It does so by utilizing web services that are readily available and acts as a proxy that strips thi...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This service is designed to provide effortless name to key and the inverse conversions.  It does so by utilizing web services that are readily available and acts as a proxy that strips things down to where they are easily usable within LSL (or any other application).  It is hosted on Google&#039;s AppEngine, which means that it should easily scale with most demands placed on it.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
The base url is http://n2k.AppSpot.com&lt;br /&gt;
&lt;br /&gt;
For name 2 key you append /n2k/ and add in the name of the person you want to look up.&lt;br /&gt;
&lt;br /&gt;
For example: http://n2k.AppSpot.com/n2k/Kerik+Rau &lt;br /&gt;
&lt;br /&gt;
(Note the + was added in to keep the URL in tact, you can use a space or %20 if you prefer)&lt;br /&gt;
&lt;br /&gt;
==Output==&lt;br /&gt;
&lt;br /&gt;
n2k - The service under most conditions will return only the key or nothing at all.  To verify this you could check to see if the length is 36 characters as that will eliminate any stack traces or other oddities that might come through.&lt;br /&gt;
&lt;br /&gt;
==Todo==&lt;br /&gt;
&lt;br /&gt;
The Key 2 Name portion of the site has not yet been written.&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=201192</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=201192"/>
		<updated>2009-01-17T03:01:32Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: removed redundant formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For all intentions this is a dumping ground of information that might be useful.  All the information found here is free to use however you wish with no limitations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot;  style=&amp;quot;background: #B8E2FF; border: 1px solid #0090FF;&amp;quot;&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
| width=&amp;quot;150px&amp;quot; | Projects&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/Apoc | Apocalypse HUD ]]&lt;br /&gt;
| A modular tool designed to reduce code reproduction and provide the shortest path available for a given task.  Thus it is fast and highly scalable by design.&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/n2k | n2k.AppSpot ]]&lt;br /&gt;
| A project aiming to make a name2key and key2name service via Google&#039;s App Engine that utilizes the Second Life Search rather than storing keys within a database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot; style=&amp;quot;background: #FFEC80; border: 1px solid #E3AD35;&amp;quot;&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
| width=&amp;quot;150px&amp;quot; | Scripts&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/Simple Slide Show | Simple Slide Show ]]&lt;br /&gt;
| Throw in the textures and it will automatically rotate through them.&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/MapTileURL | Map Tile URL ]]&lt;br /&gt;
| An LSL function that returns a string containing the current regions tile URL&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=201042</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=201042"/>
		<updated>2009-01-16T21:35:57Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For all intentions this is a dumping ground of information that might be useful.  All the information found here is free to use however you wish with no limitations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;2em&amp;quot; cellpadding=&amp;quot;2em&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;background: #B8E2FF; border: 1px solid #0090FF;&amp;quot;&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
| width=&amp;quot;150px&amp;quot; | Projects&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/Apoc | Apocalypse HUD ]]&lt;br /&gt;
| A modular tool designed to reduce code reproduction and provide the shortest path available for a given task.  Thus it is fast and highly scalable by design.&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/n2k | n2k.AppSpot ]]&lt;br /&gt;
| A project aiming to make a name2key and key2name service via Google&#039;s App Engine that utilizes the Second Life Search rather than storing keys within a database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;2em&amp;quot; cellpadding=&amp;quot;2em&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;background: #FFEC80; border: 1px solid #E3AD35;&amp;quot;&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
| width=&amp;quot;150px&amp;quot; | Scripts&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/Simple Slide Show | Simple Slide Show ]]&lt;br /&gt;
| Throw in the textures and it will automatically rotate through them.&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/MapTileURL | Map Tile URL ]]&lt;br /&gt;
| An LSL function that returns a string containing the current regions tile URL&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/MapTileURL&amp;diff=201032</id>
		<title>User:Kerik Rau/MapTileURL</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/MapTileURL&amp;diff=201032"/>
		<updated>2009-01-16T21:35:41Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Returns the URL of the image of the current sim&#039;s tile (a 256x256 pixel image).  Also see [[User:Thraxis_Epsilon/map_api | Thraxis Epsilon&#039;s OpenLayers Wrapper]].  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
string MapTileURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = llGetRegionCorner();&lt;br /&gt;
 &lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    TilePos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    TilePos.y = 1279.0 - TilePos.y;&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
 &lt;br /&gt;
    //the 3rd value is something to do with zoom&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/MapTileURL&amp;diff=201022</id>
		<title>User:Kerik Rau/MapTileURL</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/MapTileURL&amp;diff=201022"/>
		<updated>2009-01-16T21:34:29Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: New page: Returns the URL of the image of the current sim&amp;#039;s tile as in SLURL.  Also see  Thraxis Epsilon&amp;#039;s OpenLayers Wrapper.    &amp;lt;lsl&amp;gt; string MapTileURL() {       ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Returns the URL of the image of the current sim&#039;s tile as in SLURL.  Also see [[User:Thraxis_Epsilon/map_api | Thraxis Epsilon&#039;s OpenLayers Wrapper]].  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
string MapTileURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = llGetRegionCorner();&lt;br /&gt;
 &lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    TilePos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    TilePos.y = 1279.0 - TilePos.y;&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
 &lt;br /&gt;
    //the 3rd value is something to do with zoom&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/Simple_Slide_Show&amp;diff=201012</id>
		<title>User:Kerik Rau/Simple Slide Show</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau/Simple_Slide_Show&amp;diff=201012"/>
		<updated>2009-01-16T21:29:53Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: New page: Dumb slide show: simply rez a cube, throw in the script and textures and instant slide show.  Ya, boring isn&amp;#039;t it?  &amp;lt;lsl&amp;gt; integer Face = 2; float Delay = 25.0;  list Textures; integer Text...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Dumb slide show: simply rez a cube, throw in the script and textures and instant slide show.  Ya, boring isn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer Face = 2;&lt;br /&gt;
float Delay = 25.0;&lt;br /&gt;
&lt;br /&gt;
list Textures;&lt;br /&gt;
integer TextureNum;&lt;br /&gt;
&lt;br /&gt;
BuildDB()&lt;br /&gt;
{&lt;br /&gt;
    Textures = [];&lt;br /&gt;
    integer NumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
    &lt;br /&gt;
    while(NumTextures--)&lt;br /&gt;
        Textures += llGetInventoryName(INVENTORY_TEXTURE, NumTextures);&lt;br /&gt;
        &lt;br /&gt;
    llOwnerSay(&amp;quot;Loaded Textures: &amp;quot; + llDumpList2String(Textures, &amp;quot;, &amp;quot;));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        BuildDB();&lt;br /&gt;
        llSetTimerEvent(Delay);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed(integer change)&lt;br /&gt;
    {&lt;br /&gt;
        if(change &amp;amp; CHANGED_INVENTORY)&lt;br /&gt;
            BuildDB();   &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture(llList2String(Textures, TextureNum), Face);&lt;br /&gt;
        &lt;br /&gt;
        if(++TextureNum &amp;gt;= llGetListLength(Textures))&lt;br /&gt;
            TextureNum = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=198233</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=198233"/>
		<updated>2009-01-14T06:19:38Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For all intentions this is a dumping ground of information that might be useful.  All the information found here is free to use however you wish with no limitations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;2em&amp;quot; cellpadding=&amp;quot;2em&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;background: #B8E2FF; border: 1px solid #0090FF;&amp;quot;&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
| width=&amp;quot;150px&amp;quot; | Projects&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/Apoc | Apocalypse HUD ]]&lt;br /&gt;
| A modular tool designed to reduce code reproduction and provide the shortest path available for a given task.  Thus it is fast and highly scalable by design.&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/n2k | n2k.AppSpot ]]&lt;br /&gt;
| A project aiming to make a name2key and key2name service via Google&#039;s App Engine that utilizes the Second Life Search rather than storing keys within a database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;2em&amp;quot; cellpadding=&amp;quot;2em&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;background: #FFEC80; border: 1px solid #E3AD35;&amp;quot;&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
| width=&amp;quot;150px&amp;quot; | Scripts&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/Simple Slide Show | Simple Slide Show ]]&lt;br /&gt;
| Throw in the textures and it will automatically rotate through them.&lt;br /&gt;
|-&lt;br /&gt;
| [[ User:Kerik_Rau/MapTileURL | Map Tile URL ]]&lt;br /&gt;
| An LSL function that returns a string containing the current regions tile URL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Code Snippets=&lt;br /&gt;
&lt;br /&gt;
==Simple Stupid Slide Show==&lt;br /&gt;
Dumb slide show: simply rez a cube, throw in the script and textures and instant slide show.  Ya, boring isn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer Face = 2;&lt;br /&gt;
float Delay = 25.0;&lt;br /&gt;
&lt;br /&gt;
list Textures;&lt;br /&gt;
integer TextureNum;&lt;br /&gt;
&lt;br /&gt;
BuildDB()&lt;br /&gt;
{&lt;br /&gt;
    Textures = [];&lt;br /&gt;
    integer NumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
    &lt;br /&gt;
    while(NumTextures--)&lt;br /&gt;
        Textures += llGetInventoryName(INVENTORY_TEXTURE, NumTextures);&lt;br /&gt;
        &lt;br /&gt;
    llOwnerSay(&amp;quot;Loaded Textures: &amp;quot; + llDumpList2String(Textures, &amp;quot;, &amp;quot;));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        BuildDB();&lt;br /&gt;
        llSetTimerEvent(Delay);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed(integer change)&lt;br /&gt;
    {&lt;br /&gt;
        if(change &amp;amp; CHANGED_INVENTORY)&lt;br /&gt;
            BuildDB();   &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture(llList2String(Textures, TextureNum), Face);&lt;br /&gt;
        &lt;br /&gt;
        if(++TextureNum &amp;gt;= llGetListLength(Textures))&lt;br /&gt;
            TextureNum = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
string MapTileURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = llGetRegionCorner();&lt;br /&gt;
 &lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    TilePos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    TilePos.y = 1279.0 - TilePos.y;&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
 &lt;br /&gt;
    //the 3rd value is something to do with zoom&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=197952</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=197952"/>
		<updated>2009-01-13T22:28:28Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
&lt;br /&gt;
==Simple Stupid Slide Show==&lt;br /&gt;
Dumb slide show: simply rez a cube, throw in the script and textures and instant slide show.  Ya, boring isn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer Face = 2;&lt;br /&gt;
float Delay = 25.0;&lt;br /&gt;
&lt;br /&gt;
list Textures;&lt;br /&gt;
integer TextureNum;&lt;br /&gt;
&lt;br /&gt;
BuildDB()&lt;br /&gt;
{&lt;br /&gt;
    Textures = [];&lt;br /&gt;
    integer NumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
    &lt;br /&gt;
    while(NumTextures--)&lt;br /&gt;
        Textures += llGetInventoryName(INVENTORY_TEXTURE, NumTextures);&lt;br /&gt;
        &lt;br /&gt;
    llOwnerSay(&amp;quot;Loaded Textures: &amp;quot; + llDumpList2String(Textures, &amp;quot;, &amp;quot;));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        BuildDB();&lt;br /&gt;
        llSetTimerEvent(Delay);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed(integer change)&lt;br /&gt;
    {&lt;br /&gt;
        if(change &amp;amp; CHANGED_INVENTORY)&lt;br /&gt;
            BuildDB();   &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture(llList2String(Textures, TextureNum), Face);&lt;br /&gt;
        &lt;br /&gt;
        if(++TextureNum &amp;gt;= llGetListLength(Textures))&lt;br /&gt;
            TextureNum = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
string MapTileURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = llGetRegionCorner();&lt;br /&gt;
 &lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    TilePos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    TilePos.y = 1279.0 - TilePos.y;&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
 &lt;br /&gt;
    //the 3rd value is something to do with zoom&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=67486</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=67486"/>
		<updated>2008-05-16T03:51:59Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
&lt;br /&gt;
==Non Destructive Face Finder==&lt;br /&gt;
I wrote this in a minute or so and it seems pretty useful.  Should be helpful for anyone wanting to find the face value in LSL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer NumSides;&lt;br /&gt;
integer NextSide;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        NumSides = llGetNumberOfSides();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        vector CurrentColor = llGetColor(NextSide);&lt;br /&gt;
        &lt;br /&gt;
        llSetColor(&amp;lt;1,0,0&amp;gt;, NextSide);&lt;br /&gt;
        llOwnerSay(&amp;quot;Turning side &amp;quot; + (string) NextSide);&lt;br /&gt;
        llSleep(1);&lt;br /&gt;
        llSetColor(CurrentColor, NextSide);&lt;br /&gt;
        &lt;br /&gt;
        if(++NextSide &amp;gt;= NumSides)&lt;br /&gt;
            NextSide = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple Stupid Slide Show==&lt;br /&gt;
Dumb slide show: simply rez a cube, throw in the script and textures and instant slide show.  Ya, boring isn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer Face = 2;&lt;br /&gt;
float Delay = 25.0;&lt;br /&gt;
&lt;br /&gt;
list Textures;&lt;br /&gt;
integer TextureNum;&lt;br /&gt;
&lt;br /&gt;
BuildDB()&lt;br /&gt;
{&lt;br /&gt;
    Textures = [];&lt;br /&gt;
    integer NumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
    &lt;br /&gt;
    while(NumTextures--)&lt;br /&gt;
        Textures += llGetInventoryName(INVENTORY_TEXTURE, NumTextures);&lt;br /&gt;
        &lt;br /&gt;
    llOwnerSay(&amp;quot;Loaded Textures: &amp;quot; + llDumpList2String(Textures, &amp;quot;, &amp;quot;));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        BuildDB();&lt;br /&gt;
        llSetTimerEvent(Delay);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed(integer change)&lt;br /&gt;
    {&lt;br /&gt;
        if(change &amp;amp; CHANGED_INVENTORY)&lt;br /&gt;
            BuildDB();   &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture(llList2String(Textures, TextureNum), Face);&lt;br /&gt;
        &lt;br /&gt;
        if(++TextureNum &amp;gt;= llGetListLength(Textures))&lt;br /&gt;
            TextureNum = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===PseudoCode===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//grab the region coordinates and store them&lt;br /&gt;
$RegionPos;&lt;br /&gt;
&lt;br /&gt;
//1 Tile = 256m&lt;br /&gt;
$TilePos = $RegionPos/256.0;&lt;br /&gt;
&lt;br /&gt;
//Fix the offset in the service&lt;br /&gt;
$TilePos.y = 1279.0 - $TilePos.y;&lt;br /&gt;
&lt;br /&gt;
//genrate the URL, the 0 on the end may be a switch for gif/png, need to read up more on the SL map API&lt;br /&gt;
$mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot; \&lt;br /&gt;
  + Floor($TilePos.x) + &amp;quot;-&amp;quot; + Floor($TilePos.y) + &amp;quot;-1-0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=67483</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=67483"/>
		<updated>2008-05-16T03:06:21Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
&lt;br /&gt;
==Non Destructive Face Finder==&lt;br /&gt;
I wrote this in a minute or so and it seems pretty useful.  Should be helpful for anyone wanting to find the face value in LSL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer NumSides;&lt;br /&gt;
integer NextSide;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        NumSides = llGetNumberOfSides();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        vector CurrentColor = llGetColor(NextSide);&lt;br /&gt;
        &lt;br /&gt;
        llSetColor(&amp;lt;1,0,0&amp;gt;, NextSide);&lt;br /&gt;
        llOwnerSay(&amp;quot;Turning side &amp;quot; + (string) NextSide);&lt;br /&gt;
        llSleep(1);&lt;br /&gt;
        llSetColor(CurrentColor, NextSide);&lt;br /&gt;
        &lt;br /&gt;
        if(++NextSide &amp;gt;= NumSides)&lt;br /&gt;
            NextSide = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===PseudoCode===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//grab the region coordinates and store them&lt;br /&gt;
$RegionPos;&lt;br /&gt;
&lt;br /&gt;
//1 Tile = 256m&lt;br /&gt;
$TilePos = $RegionPos/256.0;&lt;br /&gt;
&lt;br /&gt;
//Fix the offset in the service&lt;br /&gt;
$TilePos.y = 1279.0 - $TilePos.y;&lt;br /&gt;
&lt;br /&gt;
//genrate the URL, the 0 on the end may be a switch for gif/png, need to read up more on the SL map API&lt;br /&gt;
$mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot; \&lt;br /&gt;
  + Floor($TilePos.x) + &amp;quot;-&amp;quot; + Floor($TilePos.y) + &amp;quot;-1-0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=65287</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=65287"/>
		<updated>2008-04-26T18:57:24Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
==Rotating 360 degrees NonPhys==&lt;br /&gt;
Awhile ago I stumbled upon [[Slerp]], and I wanted to make a way to generate a list of rotations for doing a complete rotation.&lt;br /&gt;
&lt;br /&gt;
===First Trial===&lt;br /&gt;
(this is some of the UGLIEST code I have ever written, but it seems to work.  Do not rely on it if you need precision.)&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
list GenerateRotationList(integer num)&lt;br /&gt;
{&lt;br /&gt;
    list RotationList = [];&lt;br /&gt;
    rotation a = ZERO_ROTATION;&lt;br /&gt;
    rotation b = llEuler2Rot(&amp;lt;0,0,180&amp;gt; * DEG_TO_RAD );&lt;br /&gt;
    float interval = 2 / (float) num;&lt;br /&gt;
    float i = interval;&lt;br /&gt;
    for(; i &amp;lt;= 1; i += interval)&lt;br /&gt;
        RotationList += slerp(a,b,i);&lt;br /&gt;
    &lt;br /&gt;
    if(num % 2)&lt;br /&gt;
        i = 1 - i + interval;&lt;br /&gt;
    else&lt;br /&gt;
        i = interval;&lt;br /&gt;
    b = llEuler2Rot(&amp;lt;0,0,180.001&amp;gt; * DEG_TO_RAD );&lt;br /&gt;
    for(; i &amp;lt;= 1; i += interval)&lt;br /&gt;
        RotationList += slerp(b,a,i);  &lt;br /&gt;
    return RotationList;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Common Sense Prevails===&lt;br /&gt;
After a little debating it hit me that their is no point in calculating the individual positions if it starts with the same origin every time, doh.  So now we have a function that is much cleaner and is a bit more understandable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
list GenerateRotationList(integer num)&lt;br /&gt;
{&lt;br /&gt;
    list RotationList = [];&lt;br /&gt;
    float increment = 360 / (float) num;&lt;br /&gt;
    vector Rot = &amp;lt;0,0,0&amp;gt;;&lt;br /&gt;
    while(~--num)&lt;br /&gt;
    	RotationList += llEuler2Rot( (Rot += &amp;lt;0,0,increment&amp;gt;) * DEG_TO_RAD );&lt;br /&gt;
    return RotationList;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===PseudoCode===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//grab the region coordinates and store them&lt;br /&gt;
$RegionPos;&lt;br /&gt;
&lt;br /&gt;
//1 Tile = 256m&lt;br /&gt;
$TilePos = $RegionPos/256.0;&lt;br /&gt;
&lt;br /&gt;
//Fix the offset in the service&lt;br /&gt;
$TilePos.y = 1279.0 - $TilePos.y;&lt;br /&gt;
&lt;br /&gt;
//genrate the URL, the 0 on the end may be a switch for gif/png, need to read up more on the SL map API&lt;br /&gt;
$mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot; \&lt;br /&gt;
  + Floor($TilePos.x) + &amp;quot;-&amp;quot; + Floor($TilePos.y) + &amp;quot;-1-0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Running SL Cahce in Linux RamDisk=&lt;br /&gt;
&lt;br /&gt;
==General Idea==&lt;br /&gt;
Fedora generates 16, 16MB ramdisks upon bootup that are not in use.  Basically my idea is to use Linux&#039;s LVM to initialize and span these drives together automatically and mount it to the location of SLs rather ugly cache to improve speed.&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
* Parted doesn&#039;t recognize the ramdisks (/dev/ram0 -&amp;gt; /dev/ram15) as a drive and refuses to open it.&lt;br /&gt;
* cfdisk doesn&#039;t seem to be useful outside of the interactive shell&lt;br /&gt;
* fdisk requires a user to manually do the job, yuk&lt;br /&gt;
* sfdisk seems to be solution but it is rather ugly&lt;br /&gt;
* Using LVM to span the drives may have performance implications&lt;br /&gt;
* The data in the partition will be lost every time the machine shuts down&lt;br /&gt;
&lt;br /&gt;
==Workflow==&lt;br /&gt;
* Format each drive to type 8e (Linux LVM)&lt;br /&gt;
* Add the drives into a spanning group&lt;br /&gt;
* Format the LVM group with an EXT2 partition (with &amp;quot;-m 0&amp;quot; so no space is reserved for root)&lt;br /&gt;
* mount the partition to the ~/.secondlife/cache directory&lt;br /&gt;
&lt;br /&gt;
==TODO==&lt;br /&gt;
* Get around to working with sfdisk and finish writing the INIT script&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=60391</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=60391"/>
		<updated>2008-03-28T21:39:34Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
==Rotating 360 degrees NonPhys==&lt;br /&gt;
Awhile ago I stumbled upon [[Slerp]], and I wanted to make a way to generate a list of rotations for doing a complete rotation.&lt;br /&gt;
&lt;br /&gt;
===First Trial===&lt;br /&gt;
(this is some of the UGLIEST code I have ever written, but it seems to work.  Do not rely on it if you need precision.)&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
list GenerateRotationList(integer num)&lt;br /&gt;
{&lt;br /&gt;
    list RotationList = [];&lt;br /&gt;
    rotation a = ZERO_ROTATION;&lt;br /&gt;
    rotation b = llEuler2Rot(&amp;lt;0,0,180&amp;gt; * DEG_TO_RAD );&lt;br /&gt;
    float interval = 2 / (float) num;&lt;br /&gt;
    float i = interval;&lt;br /&gt;
    for(; i &amp;lt;= 1; i += interval)&lt;br /&gt;
        RotationList += slerp(a,b,i);&lt;br /&gt;
    &lt;br /&gt;
    if(num % 2)&lt;br /&gt;
        i = 1 - i + interval;&lt;br /&gt;
    else&lt;br /&gt;
        i = interval;&lt;br /&gt;
    b = llEuler2Rot(&amp;lt;0,0,180.001&amp;gt; * DEG_TO_RAD );&lt;br /&gt;
    for(; i &amp;lt;= 1; i += interval)&lt;br /&gt;
        RotationList += slerp(b,a,i);  &lt;br /&gt;
    return RotationList;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Common Sense Prevails===&lt;br /&gt;
After a little debating it hit me that their is no point in calculating the individual positions if it starts with the same origin every time, doh.  So now we have a function that is much cleaner and is a bit more understandable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
list GenerateRotationList(integer num)&lt;br /&gt;
{&lt;br /&gt;
    list RotationList = [];&lt;br /&gt;
    float increment = 360 / (float) num;&lt;br /&gt;
    vector Rot = &amp;lt;0,0,0&amp;gt;;&lt;br /&gt;
    while(~--num)&lt;br /&gt;
    	RotationList += llEuler2Rot( (Rot += &amp;lt;0,0,increment&amp;gt;) * DEG_TO_RAD );&lt;br /&gt;
    return RotationList;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===PseudoCode===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//grab the region coordinates and store them&lt;br /&gt;
$RegionPos;&lt;br /&gt;
&lt;br /&gt;
//1 Tile = 256m&lt;br /&gt;
$TilePos = $RegionPos/256.0;&lt;br /&gt;
&lt;br /&gt;
//Fix the offset in the service&lt;br /&gt;
$TilePos.y = 1279.0 - $TilePos.y;&lt;br /&gt;
&lt;br /&gt;
//genrate the URL, the 0 on the end may be a switch for gif/png, need to read up more on the SL map API&lt;br /&gt;
$mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot; \&lt;br /&gt;
  + Floor($TilePos.x) + &amp;quot;-&amp;quot; + Floor($TilePos.y) + &amp;quot;-1-0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=59854</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=59854"/>
		<updated>2008-03-24T02:41:22Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
==Rotating 360 degrees NonPhys==&lt;br /&gt;
Awhile ago I stumbled upon [[Slerp]], and I wanted to make a way to generate a list of rotations for doing a complete rotation.&lt;br /&gt;
&lt;br /&gt;
(this is some of the UGLIEST code I have ever written, but it seems to work.  Do not rely on it if you need precision.)&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
list GenerateRotationList(integer num)&lt;br /&gt;
{&lt;br /&gt;
    list RotationList = [];&lt;br /&gt;
    rotation a = ZERO_ROTATION;&lt;br /&gt;
    rotation b = llEuler2Rot(&amp;lt;0,0,180&amp;gt; * DEG_TO_RAD );&lt;br /&gt;
    float interval = 2 / (float) num;&lt;br /&gt;
    float i = interval;&lt;br /&gt;
    for(; i &amp;lt;= 1; i += interval)&lt;br /&gt;
        RotationList += slerp(a,b,i);&lt;br /&gt;
    &lt;br /&gt;
    if(num % 2)&lt;br /&gt;
        i = 1 - i + interval;&lt;br /&gt;
    else&lt;br /&gt;
        i = interval;&lt;br /&gt;
    b = llEuler2Rot(&amp;lt;0,0,180.001&amp;gt; * DEG_TO_RAD );&lt;br /&gt;
    for(; i &amp;lt;= 1; i += interval)&lt;br /&gt;
        RotationList += slerp(b,a,i);  &lt;br /&gt;
    return RotationList;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===PseudoCode===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//grab the region coordinates and store them&lt;br /&gt;
$RegionPos;&lt;br /&gt;
&lt;br /&gt;
//1 Tile = 256m&lt;br /&gt;
$TilePos = $RegionPos/256.0;&lt;br /&gt;
&lt;br /&gt;
//Fix the offset in the service&lt;br /&gt;
$TilePos.y = 1279.0 - $TilePos.y;&lt;br /&gt;
&lt;br /&gt;
//genrate the URL, the 0 on the end may be a switch for gif/png, need to read up more on the SL map API&lt;br /&gt;
$mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot; \&lt;br /&gt;
  + Floor($TilePos.x) + &amp;quot;-&amp;quot; + Floor($TilePos.y) + &amp;quot;-1-0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=59853</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=59853"/>
		<updated>2008-03-24T02:31:25Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
==Rotating 360 degrees NonPhys==&lt;br /&gt;
Awhile ago I stumbled upon [Slerp], and I wanted to make a way to generate a list of rotations for doing a complete rotation.&lt;br /&gt;
&lt;br /&gt;
(this is some of the UGLIEST code I have ever written, but it seems to work.  Do not rely on it if you need precision.)&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
list GenerateRotationList(integer num)&lt;br /&gt;
{&lt;br /&gt;
    list RotationList = [];&lt;br /&gt;
    rotation a = ZERO_ROTATION;&lt;br /&gt;
    rotation b = llEuler2Rot(&amp;lt;0,0,180&amp;gt; * DEG_TO_RAD );&lt;br /&gt;
    float interval = 2 / (float) num;&lt;br /&gt;
    float i = interval;&lt;br /&gt;
    for(; i &amp;lt;= 1; i += interval)&lt;br /&gt;
        RotationList += slerp(a,b,i);&lt;br /&gt;
    &lt;br /&gt;
    if(num % 2)&lt;br /&gt;
        i = 1 - i + interval;&lt;br /&gt;
    else&lt;br /&gt;
        i = interval;&lt;br /&gt;
    b = llEuler2Rot(&amp;lt;0,0,180.001&amp;gt; * DEG_TO_RAD );&lt;br /&gt;
    for(; i &amp;lt;= 1; i += interval)&lt;br /&gt;
        RotationList += slerp(b,a,i);  &lt;br /&gt;
    return RotationList;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===PseudoCode===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//grab the region coordinates and store them&lt;br /&gt;
$RegionPos;&lt;br /&gt;
&lt;br /&gt;
//1 Tile = 256m&lt;br /&gt;
$TilePos = $RegionPos/256.0;&lt;br /&gt;
&lt;br /&gt;
//Fix the offset in the service&lt;br /&gt;
$TilePos.y = 1279.0 - $TilePos.y;&lt;br /&gt;
&lt;br /&gt;
//genrate the URL, the 0 on the end may be a switch for gif/png, need to read up more on the SL map API&lt;br /&gt;
$mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot; \&lt;br /&gt;
  + Floor($TilePos.x) + &amp;quot;-&amp;quot; + Floor($TilePos.y) + &amp;quot;-1-0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Rotation&amp;diff=56821</id>
		<title>Rotation</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Rotation&amp;diff=56821"/>
		<updated>2008-02-29T20:17:29Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: vector used in examples was formatted weird (spaces after commas inconsistant)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Multi-lang}}&lt;br /&gt;
{{LSL Header}}{{RightToc}}&lt;br /&gt;
=Rotations=&lt;br /&gt;
The LSL &#039;&#039;&#039;rotation&#039;&#039;&#039; type is used to represent an orientation in 3D.  (Note that we try to write the type name in &#039;&#039;&#039;bold&#039;&#039;&#039;.)&lt;br /&gt;
An orientation, or 3D angle, is represented by a mathematical object called a {{LSLG|quaternion}}.  You can think of a quaternion as four numbers, three of which represent the direction an object is facing and a fourth that represents the object&#039;s banking left or right around that direction. The main advantage of using &lt;br /&gt;
quaternions is that they are not susceptible to [http://en.wikipedia.org/wiki/Gimbal_Lock gimbal lock]. &lt;br /&gt;
For the complex inner workings of quaternion mathematics, see {{LSLG|quaternion}}. &lt;br /&gt;
For a list of functions and events related to rotations see {{LSLG|Rotation Synopsis}}.&lt;br /&gt;
There is also information about causing  textures to rotate in {{LSLG|texture}}s.&lt;br /&gt;
&lt;br /&gt;
==Other representations==&lt;br /&gt;
Another way to represent a rotation is using three numbers, &amp;lt;X, Y, Z&amp;gt;, which represent the amount (in [[radians]]) which the object is rotated around each axis.  This is used in the Edit window, for example, and is generally easy for people to visualize.  Note that these three numbers are a &#039;&#039;&#039;vector&#039;&#039;&#039; and not a &#039;&#039;&#039;rotation&#039;&#039;&#039; type, though it can represent the same information.  This is called the &#039;&#039;Euler&#039;&#039; representation of a rotation.&lt;br /&gt;
  &lt;br /&gt;
A third way is to use three vectors, showing what the front is pointing at, what the top is pointing at, and what the left side is pointing at.  Actually, only two of the three are needed, because any two determines the third.  &lt;br /&gt;
&lt;br /&gt;
For good reasons, such as being able to combine rotations, the four number version, the &#039;&#039;&#039;rotation&#039;&#039;&#039;, is better, though harder for a beginner to grasp. Fortunately it&#039;s very seldom necessary to do anything with the actual internal representation of &#039;&#039;rotations&#039;&#039; and there are functions for converting easily back and forth.&lt;br /&gt;
&lt;br /&gt;
==Right hand rule==&lt;br /&gt;
In LSL all rotations are done according to the &#039;&#039;&#039;right hand rule&#039;&#039;&#039;. With your right hand, extend the first finger in the direction of the positive direction of the x-axis. Extend your second finger at right angles to your first finger, it will point along the positive y-axis, and your thumb, extended at right angles to both will point along the positive z-axis. When you&#039;re editing an object, the three colored axis arrows point in the positive direction for each axis (X: red, Y: green, Z: blue).&lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/Right_hand_rule&lt;br /&gt;
&lt;br /&gt;
Now, don&#039;t remove your right hand just yet, there is another use for it, determining the direction of a positive rotation. Make a fist with your right hand, thumb extended and pointing in the positive direction of the axis you are interested in. Your fingers curl around in the direction of positive rotation. Rotations around the X, Y, and Z axis are often referred to as Roll, Pitch, and Yaw, particularly for vehicles.&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Tait-Bryan_angles Roll Pitch Yaw]&lt;br /&gt;
&lt;br /&gt;
== Combining Rotations ==&lt;br /&gt;
&lt;br /&gt;
To combine &#039;&#039;&#039;rotations&#039;&#039;&#039;, you use the &#039;&#039;&#039;multiply&#039;&#039;&#039; and &#039;&#039;&#039;divide&#039;&#039;&#039; operators. Don&#039;t try to use addition or subtraction operators on &#039;&#039;&#039;rotations&#039;&#039;&#039;, as they will not do what you expect. The &#039;&#039;&#039;multiply&#039;&#039;&#039; operation applies the rotation in the positive direction, the &#039;&#039;&#039;divide&#039;&#039;&#039; operation does a negative rotation. You can also negate a rotation directly, just negate the s component, e.g. X.s = -X.s.&lt;br /&gt;
&lt;br /&gt;
Unlike other types such as {{LSLG|float}}, the order in which the operations are done, &lt;br /&gt;
[http://en.wikipedia.org/wiki/Commutative non-commutative], is important.&lt;br /&gt;
The reason for this is simple: the order you do rotations in is important in RL. For example, if you had a dart with four feathers, started from rotation &amp;lt;0, 0, 0&amp;gt; with its tail on the origin, it would lie on the X axis with its point aimed in the positive X direction, its feathers along the Z and Y axes, and the axes of the dart and the axes of the world would be aligned. We&#039;re going to rotate it 45 degrees around X and 30 degrees around Y, but in different orders.&lt;br /&gt;
&lt;br /&gt;
First, after rotating 45 deg around X the dart would still be on the X axis, unmoved, just turned along its long axis, so the feathers would be at 45 deg to the axes. Then rotating 30 deg around Y would move it in the XZ plane to point down 30 deg from the X axis (remember the right hand rule for rotations means a small positive rotation around Y moves the point down). The dart winds up pointing 30 deg down, in the same vertical plane it started in, but turned around its own long axis so the feathers are no longer up and down.&lt;br /&gt;
&lt;br /&gt;
If you did it the other way, first rotating 30 deg in Y, the dart would rotate down in the XZ plane, but notice that it no longer is on the X axis; its X axis and the world&#039;s aren&#039;t aligned any more. Now a 45 degree rotation around the X axis would pivot the dart around its tail, the point following a 30 deg cone whose axis is along the positive world X axis, for 45 degrees up and to the right. If you were looking down the X axis, it would pivot from pointing 30 deg below the X axis, up and to the right, out of the XZ plane, to a point below the 1st quadrant in the XY plane, its feathers rotating as it went.&lt;br /&gt;
&lt;br /&gt;
Clearly this is a different result from the first rotation, but the order of rotation is the only thing changed.&lt;br /&gt;
&lt;br /&gt;
To do a constant rotation you need to define a &#039;&#039;&#039;rotation&#039;&#039;&#039; value which can be done by creating a {{LSLG|vector}} with the X, Y, Z angles in radians as components (called an Euler angle), then converting that to a &#039;&#039;&#039;rotation&#039;&#039;&#039; by using the {{LSLG|llEuler2Rot}} function. You can alternately create the native rotation directly: the real part is the cosine of half the angle of rotation, and the vector part is the normalized axis of rotation multiplied by the sine of half the angle of rotation. To go from a rotation to an Euler angle {{LSLG|vector}} use {{LSLG|llRot2Euler}}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; angles in LSL are in radians, not degrees, but you can easily convert by using the built-in constants [[#RAD_TO_DEG|RAD_TO_DEG]] and [[#DEG_TO_RAD|DEG_TO_RAD]]. For a 30 degree &#039;&#039;&#039;rotation&#039;&#039;&#039; around the X axis you might use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
{| cellpadding=0 cellspacing=0&lt;br /&gt;
|-&lt;br /&gt;
|rotation rot30X ||= {{LSLG|llEuler2Rot}}(&amp;lt;30, 0, 0&amp;gt; * DEG_TO_RAD);||// convert the degrees to radians, then convert that {{LSLG|vector}} into a rotation, rot30x&lt;br /&gt;
|-&lt;br /&gt;
|{{LSLG|vector}} vec30X ||= {{LSLG|llRot2Euler}}(rot30X );||// convert the rotation back to a {{LSLG|vector}} (the values will be in radians)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Order of rotation for Euler Vectors ==&lt;br /&gt;
&lt;br /&gt;
From the above discussion, it&#039;s clear that when dealing with rotations around more than one axis, the order they are done in is critical. In the &#039;&#039;Euler&#039;&#039; discussion above this was kind of glossed over a bit, the individual rotations around the three axis define an overall &#039;&#039;rotation&#039;&#039;, but that begs the question: What axis order are the rotations done in? The answer is &#039;&#039;&#039;Z, Y, X&#039;&#039;&#039; in global coordinates. If you are trying to rotate an object around more than one axis at a time using the &#039;&#039;Euler&#039;&#039; representation, determine the correct &#039;&#039;Euler&#039;&#039; {{LSLG|vector}} using the Z, Y, X rotation order, then use the {{LSLG|llEuler2Rot}} function to get the &#039;&#039;&#039;rotation&#039;&#039;&#039; for use in combining rotations or applying the rotation to the object.&lt;br /&gt;
&lt;br /&gt;
== Local vs Global (World) rotations ==&lt;br /&gt;
&lt;br /&gt;
It is important to distinguish between the &#039;&#039;&#039;rotation&#039;&#039;&#039; relative to the world, and the &#039;&#039;&#039;rotation&#039;&#039;&#039; relative to the local object itself.  In the editor, you can switch back and forth from one to the other.  In a script, you must convert from one to the other to get the desired behavior.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Local&#039;&#039;&#039; rotations are ones done around the axes embedded in the object itself forward/back, left/right, up/down, irrespective of how the object is rotated in the world. &#039;&#039;&#039;Global&#039;&#039;&#039; rotations are ones done around the world axes, North/South, East/West, Higher/Lower. You can see the difference by rotating a prim, then edit it and change the axes settings between local and global, notice how the colored axes arrows change.&lt;br /&gt;
&lt;br /&gt;
In LSL, the difference between doing a &#039;&#039;&#039;local&#039;&#039;&#039; or &#039;&#039;&#039;global&#039;&#039;&#039; rotation is the order the &#039;&#039;&#039;rotations&#039;&#039;&#039; are evaluated in the statement.&lt;br /&gt;
&lt;br /&gt;
This does a &#039;&#039;&#039;local&#039;&#039;&#039; 30 degree rotation by putting the constant 30 degree &#039;&#039;&#039;rotation&#039;&#039;&#039; to the left of the object&#039;s starting &#039;&#039;&#039;rotation&#039;&#039;&#039; (myRot). It is like the first operation in the first example above, just twisting the dart 30 degrees around its own long axis. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
{| cellpadding=0 cellspacing=0&lt;br /&gt;
|-&lt;br /&gt;
|rotation localRot = ||rot30X * myRot;||// do a local rotation by multiplying a constant rotation by a world rotation&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To do a &#039;&#039;&#039;global&#039;&#039;&#039; rotation, use the same &#039;&#039;&#039;rotation&#039;&#039;&#039; values, but in the opposite order. This is like the second operation in the second example, the dart rotating up and to the right around the world X axis. In this case, the existing rotation (myRot) is rotated 30 degrees around the global X axis.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
{| cellpadding=0 cellspacing=0&lt;br /&gt;
|-&lt;br /&gt;
|rotation globalRot || = myRot * rot30X;||// do a global rotation by multiplying a world rotation by a constant rotation&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Another way to think about combining rotations ==&lt;br /&gt;
&lt;br /&gt;
You may want to think about this &#039;&#039;&#039;local&#039;&#039;&#039; vs &#039;&#039;&#039;global&#039;&#039;&#039; difference by considering that &#039;&#039;&#039;rotations&#039;&#039;&#039; are done in evaluation order, that is left to right except for parenthesized expressions.&lt;br /&gt;
&lt;br /&gt;
In the localRot case, what happened was that starting from &amp;lt;0, 0, 0&amp;gt;, the rot30X was done first, rotating the prim around the world X axis, but since when it&#039;s unrotated, the local and global axes are identical it has the effect of doing the rotation around the object&#039;s local X axis. Then the second &#039;&#039;&#039;rotation&#039;&#039;&#039; myRot was done which rotated the prim to its original rotation, but now with the additional X axis rotation baked in. What this looks like is that the prim rotated in place, around its own X axis, with the Y and Z rotations unchanged, a &#039;&#039;&#039;local&#039;&#039;&#039; rotation.&lt;br /&gt;
&lt;br /&gt;
In the globalRot case, again starting from &amp;lt;0, 0, 0&amp;gt;, first the object is rotated to its original rotation (myRot), but now the object&#039;s axes and the world&#039;s axes are no longer aligned! So, the second &#039;&#039;&#039;rotation&#039;&#039;&#039; rot30x does exactly what it did in the local case, rotates the object 30 degrees around the world X axis, but the effect is to rotate the object through a cone around the world X axis since the object&#039;s X axis and the world&#039;s X axis aren&#039;t the same this time. What this looks like is that the prim pivoted 30 degrees around the world X axis, hence a &#039;&#039;&#039;global&#039;&#039;&#039; rotation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Division&#039;&#039;&#039; of &#039;&#039;&#039;rotations&#039;&#039;&#039; has the effect of doing the rotation in the opposite direction, multiplying by a 330 degree &#039;&#039;&#039;rotation&#039;&#039;&#039; is the same as dividing by a 30 degree &#039;&#039;&#039;rotation&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Using Rotations ==&lt;br /&gt;
&lt;br /&gt;
You can access the individual components of a &#039;&#039;&#039;rotation&#039;&#039;&#039; &#039;&#039;&#039;R&#039;&#039;&#039; by &#039;&#039;&#039;R.x, R.y, R.z, &amp;amp; R.s&#039;&#039;&#039; (&#039;&#039;&#039;not&#039;&#039;&#039; R.w).  The scalar part R.s is the cosine of half the angle of rotation.  The vector part (R.x,R.y,R.z) is the product of the normalized axis of rotation and the sine of half the angle of rotation.  You can generate an inverse &#039;&#039;&#039;rotation&#039;&#039;&#039; by negating the x,y,z members (or by making the s value negative). As an aside, you can also use a &#039;&#039;&#039;rotation&#039;&#039;&#039; just as a repository of {{LSLG|float}} values, each &#039;&#039;&#039;rotation&#039;&#039;&#039; stores four of them and a {{LSLG|list}} consisting of &#039;&#039;&#039;rotation&#039;&#039;&#039; is more efficient than a {{LSLG|list}} consisting of {{LSLG|float}}s, but there is overhead in unpacking them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
{| cellpadding=0 cellspacing=0&lt;br /&gt;
|-&lt;br /&gt;
|rotation rot30X ||= {{LSLG|llEuler2Rot}}(&amp;lt;30, 0, 0&amp;gt; * [[#DEG_TO_RAD|DEG_TO_RAD]] );||// Create a rotation constant&lt;br /&gt;
|-&lt;br /&gt;
|rotation rotCopy ||= rot30X;||// Just copy it into rotCopy, it copies all 4 float components&lt;br /&gt;
|-&lt;br /&gt;
|float X ||= rotCopy.x;||// Get out the individual components of the rotation&lt;br /&gt;
|-&lt;br /&gt;
|float Y ||= rotCopy.y;||&lt;br /&gt;
|-&lt;br /&gt;
|float Z ||= rotCopy.z;||&lt;br /&gt;
|-&lt;br /&gt;
|float S ||= rotCopy.s;||&lt;br /&gt;
|-&lt;br /&gt;
|rotation anotherCopy ||= &amp;lt;X, Y, Z, S&amp;gt;;||// Make another rotation out of the components&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is a built in constant for a zero &#039;&#039;&#039;rotation&#039;&#039;&#039; [[#ZERO_ROTATION|ZERO_ROTATION]] which you can use directly or, if you need to invert a &#039;&#039;&#039;rotation R&#039;&#039;&#039;, divide [[#ZERO_ROTATION|ZERO_ROTATION]] by &#039;&#039;&#039;R&#039;&#039;&#039;. As a reminder from above, this works by first rotating to the zero position, then because it is a divide, rotating in the opposite sense to the original  &#039;&#039;&#039;rotation&#039;&#039;&#039;, thereby doing the inverse rotation.&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
{| cellpadding=0 cellspacing=0&lt;br /&gt;
|-&lt;br /&gt;
|rotation rot330X ||= &amp;lt;-rot30X.x, -rot30X.y, -rot30X.z, rot30X.s&amp;gt;;||// invert a rotation - NOTE the s component isn&#039;t negated&lt;br /&gt;
|-&lt;br /&gt;
|rotation another330X ||= [[#ZERO_ROTATION|ZERO_ROTATION]] / rot30X;||// invert a rotation by  division, same result as rot330X&lt;br /&gt;
|-&lt;br /&gt;
|rotation yetanother330X ||= &amp;lt;rot30X.x, rot30X.y, rot30X.z, -rot30X.s&amp;gt;;||// not literally the same but works the same.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Single or Root Prims vs Linked Prims vs Attachments ==&lt;br /&gt;
&lt;br /&gt;
The reason for talking about single or linked prim rotations is that for things like doors on vehicles, the desired motion is to move the door relative to the vehicle, no matter what the rotation of the overall vehicle is. While possible to do this with global rotations, it would quickly grow tedious.&lt;br /&gt;
There are generally three coordinate systems a prim can be in: all alone, part of a {{LSLG|linkset}}, or part of an {{LSLG|attachment}}. When a prim is alone, i.e., not part of a {{LSLG|linkset}}, it acts like a root prim; when it is part of an {{LSLG|attachment}}, it acts differently and is a bit broken.&lt;br /&gt;
&lt;br /&gt;
{{LSLRotGetSet}}&lt;br /&gt;
&lt;br /&gt;
==Rotating Vectors ==&lt;br /&gt;
&lt;br /&gt;
In LSL, rotating a {{LSLG|vector}} is very useful if you want to move an object in an arc or circle when the center of rotation isn&#039;t the center of the object.&lt;br /&gt;
&lt;br /&gt;
This sounds very complex, but there is much less here than meets the eye. Remember from the above discussion of rotating the [[#Combining Rotations|dart]], and replace the physical dart with a {{LSLG|vector}} whose origin is the tail of the dart, and whose components in X, Y, and Z describe the position of the tip of the dart. Rotating the dart around its tail moves the tip of the dart through and arc whose center of rotation is the tail of the dart. In exactly the same way, rotating a {{LSLG|vector}} which represents an offset from the center of a prim rotates the prim through the same arc. What this looks like is the object rotates around a position offset by the {{LSLG|vector}} from the center of the prim.&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
{| cellpadding=0 cellspacing=0&lt;br /&gt;
|-&lt;br /&gt;
|rotation rot30X ||= {{LSLG|llEuler2Rot}}(&amp;lt;30, 0, 0&amp;gt; * [[#DEG_TO_RAD|DEG_TO_RAD]] );||// create a rotation constant, 30 degrees around the X axis&lt;br /&gt;
|-&lt;br /&gt;
|vector offset ||= &amp;lt;0, 1, 0&amp;gt;;||// create an offset one meter in the global positive Y direction&lt;br /&gt;
|-&lt;br /&gt;
|vector rotatedOffset || = offset * rot30X;||// rotate the offset to get the motion caused by the rotations&lt;br /&gt;
|-&lt;br /&gt;
|vector newPos || = {{LSLG|llGetPos}}() + rotatedOffset;||// move the prim position by the rotated offset amount&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Nota Bene:&#039;&#039;&#039; Doing this is a move, so don&#039;t forget about issues of moving a prim off world, below ground, more than 10 meters etc.&lt;br /&gt;
&lt;br /&gt;
== Constants ==&lt;br /&gt;
=== [[ZERO_ROTATION]] ===&lt;br /&gt;
ZERO_ROTATION = &amp;lt;0.0, 0.0, 0.0, 1.0&amp;gt;;&amp;lt;br/&amp;gt;&lt;br /&gt;
A rotation constant representing a Euler angle of &amp;lt;0.0, 0.0, 0.0&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== [[DEG_TO_RAD]] ===&lt;br /&gt;
DEG_TO_RAD = 0.01745329238f;&amp;lt;br/&amp;gt;&lt;br /&gt;
A float constant that when multiplied by an angle in degrees gives the angle in radians.&lt;br /&gt;
&lt;br /&gt;
=== [[RAD_TO_DEG]] ===&lt;br /&gt;
RAD_TO_DEG = 57.29578f;&amp;lt;br/&amp;gt;&lt;br /&gt;
A float constant when multiplied by an angle in radians gives the angle in degrees.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:LSL_Types|Rotation]][[Category:LSL_Math]][[Category:LSL_Math/3D]][[Category:LSL_Constants]]&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=52186</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=52186"/>
		<updated>2008-01-31T15:19:16Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===PseudoCode===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//grab the region coordinates and store them&lt;br /&gt;
$RegionPos;&lt;br /&gt;
&lt;br /&gt;
//1 Tile = 256m&lt;br /&gt;
$TilePos = $RegionPos/256.0;&lt;br /&gt;
&lt;br /&gt;
//Fix the offset in the service&lt;br /&gt;
$TilePos.y = 1279.0 - $TilePos.y;&lt;br /&gt;
&lt;br /&gt;
//genrate the URL, the 0 on the end may be a switch for gif/png, need to read up more on the SL map API&lt;br /&gt;
$mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot; \&lt;br /&gt;
  + Floor($TilePos.x) + &amp;quot;-&amp;quot; + Floor($TilePos.y) + &amp;quot;-1-0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=52185</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=52185"/>
		<updated>2008-01-31T15:16:58Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===PseudoCode===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$RegionPos;&lt;br /&gt;
$TilePos = $RegionPos/256.0;&lt;br /&gt;
$TilePos.y = 1279.0 - $TilePos.y;&lt;br /&gt;
&lt;br /&gt;
$mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot; \&lt;br /&gt;
  + Floor($TilePos.x) + &amp;quot;-&amp;quot; + Floor($TilePos.y) + &amp;quot;-1-0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46936</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46936"/>
		<updated>2008-01-02T02:34:18Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
Unless specified otherwise all source posted on this page uses the BSD license as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Copyright (c) 2007, Kerik Rau&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Redistribution and use in source and binary forms, with or without&lt;br /&gt;
// modification, are permitted provided that the following conditions are met:&lt;br /&gt;
//     * Redistributions of source code must retain the above copyright&lt;br /&gt;
//       notice, this list of conditions and the following disclaimer.&lt;br /&gt;
//     * Redistributions in binary form must reproduce the above copyright&lt;br /&gt;
//       notice, this list of conditions and the following disclaimer in the&lt;br /&gt;
//       documentation and/or other materials provided with the distribution.&lt;br /&gt;
//     * Neither the name of Kerik Rau (or Synthetic Knowledge) nor the&lt;br /&gt;
//       names of its contributors may be used to endorse or promote products&lt;br /&gt;
//       derived from this software without specific prior written permission.&lt;br /&gt;
//&lt;br /&gt;
// THIS SOFTWARE IS PROVIDED BY Kerik Rau ``AS IS&#039;&#039; AND ANY&lt;br /&gt;
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED&lt;br /&gt;
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE&lt;br /&gt;
// DISCLAIMED. IN NO EVENT SHALL Kerik Rau BE LIABLE FOR ANY&lt;br /&gt;
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES&lt;br /&gt;
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;&lt;br /&gt;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND&lt;br /&gt;
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT&lt;br /&gt;
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should allow anyone to incorporate code snippets without the hassle of contacting me for permission.  If you redistribute the source for any of the works on this page you will need to include a copy of this license.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46935</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46935"/>
		<updated>2008-01-02T02:33:47Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
&lt;br /&gt;
==Liscense==&lt;br /&gt;
Unless specified otherwise all source posted on this page uses the BSD license as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Copyright (c) 2007, Kerik Rau&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Redistribution and use in source and binary forms, with or without&lt;br /&gt;
// modification, are permitted provided that the following conditions are met:&lt;br /&gt;
//     * Redistributions of source code must retain the above copyright&lt;br /&gt;
//       notice, this list of conditions and the following disclaimer.&lt;br /&gt;
//     * Redistributions in binary form must reproduce the above copyright&lt;br /&gt;
//       notice, this list of conditions and the following disclaimer in the&lt;br /&gt;
//       documentation and/or other materials provided with the distribution.&lt;br /&gt;
//     * Neither the name of Kerik Rau (or Synthetic Knowledge) nor the&lt;br /&gt;
//       names of its contributors may be used to endorse or promote products&lt;br /&gt;
//       derived from this software without specific prior written permission.&lt;br /&gt;
//&lt;br /&gt;
// THIS SOFTWARE IS PROVIDED BY Kerik Rau ``AS IS&#039;&#039; AND ANY&lt;br /&gt;
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED&lt;br /&gt;
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE&lt;br /&gt;
// DISCLAIMED. IN NO EVENT SHALL Kerik Rau BE LIABLE FOR ANY&lt;br /&gt;
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES&lt;br /&gt;
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;&lt;br /&gt;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND&lt;br /&gt;
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT&lt;br /&gt;
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should allow anyone to incorporate code snippets without the hassle of contacting me for permission.  If you redistribute the source for any of the works on this page you will need to include a copy of this license.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46931</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46931"/>
		<updated>2008-01-02T01:36:57Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code Snippets=&lt;br /&gt;
&lt;br /&gt;
==Liscense==&lt;br /&gt;
Unless specified otherwise all source posted on this page uses the BSD license as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Copyright (c) 2007, Kerik Rau&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Redistribution and use in source and binary forms, with or without&lt;br /&gt;
// modification, are permitted provided that the following conditions are met:&lt;br /&gt;
//     * Redistributions of source code must retain the above copyright&lt;br /&gt;
//       notice, this list of conditions and the following disclaimer.&lt;br /&gt;
//     * Redistributions in binary form must reproduce the above copyright&lt;br /&gt;
//       notice, this list of conditions and the following disclaimer in the&lt;br /&gt;
//       documentation and/or other materials provided with the distribution.&lt;br /&gt;
//     * Neither the name of Kerik Rau (or Synthetic Knowledge) nor the&lt;br /&gt;
//       names of its contributors may be used to endorse or promote products&lt;br /&gt;
//       derived from this software without specific prior written permission.&lt;br /&gt;
//&lt;br /&gt;
// THIS SOFTWARE IS PROVIDED BY Kerik Rau ``AS IS&#039;&#039; AND ANY&lt;br /&gt;
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED&lt;br /&gt;
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE&lt;br /&gt;
// DISCLAIMED. IN NO EVENT SHALL Kerik Rau BE LIABLE FOR ANY&lt;br /&gt;
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES&lt;br /&gt;
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;&lt;br /&gt;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND&lt;br /&gt;
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT&lt;br /&gt;
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should allow anyone to incorporate code snippets without the hassle of contacting me for permission.  If you redistribute the source for any of the works on this page you will need to include a copy of this header.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46919</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46919"/>
		<updated>2008-01-01T22:54:25Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: spellchecking +1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, merely an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorporating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46916</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46916"/>
		<updated>2008-01-01T22:49:41Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SLURL Raster Image URL Generator==&lt;br /&gt;
I was rather interested in the raster images provided within SL and SLURL.com so I decided to figure out how to replicate it in such a way that it could be incorporated into tools and/or services outside the standard fair offered by Linden Labs.  At some point I may rewrite it to use PHP or offer tips to incorporate it into something like the WMS provider in MapGuide.&lt;br /&gt;
&lt;br /&gt;
===LSL===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, mearly an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorperating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46825</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46825"/>
		<updated>2008-01-01T06:35:19Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SLURL Raster Image URL Generator==&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, mearly an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorperating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46810</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46810"/>
		<updated>2008-01-01T02:52:05Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SLURL Raster Image URL Generator==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, mearly an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorperating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46809</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46809"/>
		<updated>2008-01-01T02:50:00Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SLURL Raster Image Generator==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, mearly an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorperating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46783</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46783"/>
		<updated>2008-01-01T01:23:14Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image Generator==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL.com, mearly an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorperating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46782</id>
		<title>User:Kerik Rau</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kerik_Rau&amp;diff=46782"/>
		<updated>2008-01-01T01:19:19Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: New page: __NOEDITSECTION__  ==SLURL Raster Image Generator== &amp;lt;pre&amp;gt; //SLURL Tile URL Generator - By Kerik Rau  //Based on the javascript from SLURL, mearly an adaptation in LSL //It should only take...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
==SLURL Raster Image Generator==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//SLURL Tile URL Generator - By Kerik Rau&lt;br /&gt;
&lt;br /&gt;
//Based on the javascript from SLURL, mearly an adaptation in LSL&lt;br /&gt;
//It should only take a minute or 2 to export this into PHP or other languages&lt;br /&gt;
&lt;br /&gt;
//SLURL uses WMS, I still want to look at incorperating it into something like Mapguide&lt;br /&gt;
//I will need to look at the implementation to see if this would be easy or a pain&lt;br /&gt;
&lt;br /&gt;
vector genTileVec(vector RegPos)&lt;br /&gt;
{&lt;br /&gt;
    //tiles are in a grid based on the regions, so 256m = 1 tile&lt;br /&gt;
    RegPos /= 256.0;&lt;br /&gt;
    &lt;br /&gt;
    //offset provided in the javascript, really 1278 + 1 (probably 0 -&amp;gt; 1 index difference?)&lt;br /&gt;
    RegPos.y = 1279.0 - RegPos.y;&lt;br /&gt;
&lt;br /&gt;
    return RegPos;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string genMapURL()&lt;br /&gt;
{   &lt;br /&gt;
    vector TilePos = genTileVec(llGetRegionCorner());&lt;br /&gt;
    &lt;br /&gt;
    //should look like http://secondlife.com/apps/mapapi/grid/map_image/x-y-zoom-0&lt;br /&gt;
    string mapURL = &amp;quot;http://secondlife.com/apps/mapapi/grid/map_image/&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.x);&lt;br /&gt;
    mapURL += &amp;quot;-&amp;quot;;&lt;br /&gt;
    mapURL += (string) llFloor(TilePos.y);&lt;br /&gt;
    &lt;br /&gt;
    //the 3rd value is something to do with zoom, but only 1 seems to work with this&lt;br /&gt;
    //the 4th value is undefined, omitting it works but I leave it in to match SLURL&lt;br /&gt;
    mapURL += &amp;quot;-1-0&amp;quot;;&lt;br /&gt;
    return mapURL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText(&amp;quot;SLURL Raster Image URL Generator\nOpens the image of the current sim\n(in a browser)&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = 0; i &amp;lt; numdet; ++i)&lt;br /&gt;
            llLoadURL(llDetectedKey(i), &amp;quot;load this page to see the sim image&amp;quot;, genMapURL());&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlRemoteDataReply&amp;diff=27940</id>
		<title>LlRemoteDataReply</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlRemoteDataReply&amp;diff=27940"/>
		<updated>2007-08-11T14:13:17Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|func_id=256|func_sleep=3.0|func_energy=10.0&lt;br /&gt;
|func=llRemoteDataReply&lt;br /&gt;
|p1_type=key|p1_name=channel|p2_type=key|p2_name=message_id|p3_type=string|p3_name=sdata|p4_type=integer|p4_name=idata&lt;br /&gt;
|func_footnote&lt;br /&gt;
|func_desc=Send an XML-RPC reply to &#039;&#039;&#039;message_id&#039;&#039;&#039; on channel with payload of string &#039;&#039;&#039;sdata&#039;&#039;&#039; and integer &#039;&#039;&#039;idata&#039;&#039;&#039;&lt;br /&gt;
|return_text&lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|constants&lt;br /&gt;
|examples&lt;br /&gt;
|helpers&lt;br /&gt;
|also_functions&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_events=*{{LSLG|remote_data}}&lt;br /&gt;
|also_articles&lt;br /&gt;
|notes&lt;br /&gt;
|cat1=XML-RPC&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Remote_data&amp;diff=27939</id>
		<title>Remote data</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Remote_data&amp;diff=27939"/>
		<updated>2007-08-11T14:12:19Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Event|event_id=31|event_delay|event=remote_data&lt;br /&gt;
|p1_type=integer|p1_name=event_type|p1_desc&lt;br /&gt;
|p2_type=key|p2_name=channel|p2_desc&lt;br /&gt;
|p3_type=key|p3_name=message_id|p3_desc&lt;br /&gt;
|p4_type=string|p4_name=sender|p4_desc&lt;br /&gt;
|p5_type=integer|p5_name=idata|p5_desc&lt;br /&gt;
|p6_type=string|p6_name=sdata|p6_desc&lt;br /&gt;
|event_desc=Triggered by various XML-RPC calls.&lt;br /&gt;
|constants={{{!}} {{Prettytable}}&lt;br /&gt;
{{!}}-{{Hl2}}&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;{{!}}Event Type&lt;br /&gt;
!Description&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} {{LSLG|REMOTE_DATA_CHANNEL}}&lt;br /&gt;
{{!}} 1&lt;br /&gt;
{{!}} &lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} {{LSLG|REMOTE_DATA_REQUEST}}&lt;br /&gt;
{{!}} 2&lt;br /&gt;
{{!}} &lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} {{LSLG|REMOTE_DATA_REPLY}}&lt;br /&gt;
{{!}} 3&lt;br /&gt;
{{!}} &lt;br /&gt;
{{!}}}&lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|examples&lt;br /&gt;
|helpers&lt;br /&gt;
|also_header&lt;br /&gt;
|also_events&lt;br /&gt;
|also_functions=*{{LSLG|llRemoteDataReply}}&lt;br /&gt;
|also_articles&lt;br /&gt;
|also_footer&lt;br /&gt;
|notes&lt;br /&gt;
|mode&lt;br /&gt;
|deprecated&lt;br /&gt;
|cat1=XML-RPC&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlSubStringIndex&amp;diff=27565</id>
		<title>LlSubStringIndex</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlSubStringIndex&amp;diff=27565"/>
		<updated>2007-08-08T01:42:59Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|func_id=181|func_sleep=0.0|func_energy=10.0&lt;br /&gt;
|func=llSubStringIndex&lt;br /&gt;
|return_type=integer|p1_type=string|p1_name=source|p2_type=string|p2_name=pattern&lt;br /&gt;
|func_footnote=If &#039;&#039;&#039;pattern&#039;&#039;&#039; is not found in &#039;&#039;&#039;source&#039;&#039;&#039;, {{HoverText|-1|negative one, 0x{{LSL_Hex/Write|-1}}}} is returned.&amp;lt;br/&amp;gt;&lt;br /&gt;
The index of the first character in the string is {{HoverText|0|zero}}&lt;br /&gt;
|func_desc&lt;br /&gt;
|return_text=that is the index of &#039;&#039;&#039;pattern&#039;&#039;&#039; in &#039;&#039;&#039;source&#039;&#039;&#039;.&lt;br /&gt;
|spec&lt;br /&gt;
|caveats=*Performs a literal match (case sensitive).&lt;br /&gt;
**Wildcards and RegEx are not supported.&lt;br /&gt;
|constants&lt;br /&gt;
|examples=Matching against last names:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSensorRepeat(&amp;quot;&amp;quot;, NULL_KEY, AGENT, PI, 96.0, 20);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor(integer NumDet)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        &lt;br /&gt;
        //Loop through all the sensor data and match against &amp;quot; Linden&amp;quot;, &lt;br /&gt;
        //this causes it to match with any last name of Linden (since there can&#039;t be spaces before the firstname)&lt;br /&gt;
        //Alternatively you could match a firstname with &amp;quot;FirstName &amp;quot;&lt;br /&gt;
        for(i = 0; i &amp;lt; NumDet; ++i)&lt;br /&gt;
            if(~llSubStringIndex(llDetectedName(i), &amp;quot; Linden&amp;quot;))&lt;br /&gt;
                llInstantMessage(llDetectedKey(i), &amp;quot;Hello, I see you!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|helpers=&lt;br /&gt;
An easy way to see if a string exists in another string...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if(~llSubStringIndex(myString, str))&lt;br /&gt;
{//it exists&lt;br /&gt;
    //This works because ~(-1) == 0 and any non-zero integer is considered true.&lt;br /&gt;
    //It saves bytecode and is faster then doing != -1&lt;br /&gt;
    //(It&#039;s also significantly less readable (unless you include the comments)&lt;br /&gt;
    // and most developers I know will advice against these kind of practices. -OddesE Oh)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|also_functions=&lt;br /&gt;
{{LSL DefineRow||[[llListFindList]]|Find a list in another list}}&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_events&lt;br /&gt;
|also_articles&lt;br /&gt;
|notes&lt;br /&gt;
|cat1=String&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlDetectedOwner&amp;diff=23492</id>
		<title>LlDetectedOwner</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlDetectedOwner&amp;diff=23492"/>
		<updated>2007-06-16T00:39:25Z</updated>

		<summary type="html">&lt;p&gt;Kerik Rau: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function/negative_index|false|number}}{{LSL_Function&lt;br /&gt;
|func_id=33|func_sleep=0.0|func_energy=10.0&lt;br /&gt;
|sort=DetectedOwner&lt;br /&gt;
|func=llDetectedOwner|return_type=key|p1_type=integer|p1_name=number&lt;br /&gt;
|func_footnote=Returns an {{HoverText|empty key|&amp;amp;quot;&amp;amp;quot;}} if &#039;&#039;&#039;number&#039;&#039;&#039; is not valid sensed object&lt;br /&gt;
|func_desc&lt;br /&gt;
|return_text=that is the UUID of the owner of the object.&lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|constants&lt;br /&gt;
|examples=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
list MAIN_MENU = [&amp;quot;1&amp;quot;, &amp;quot;2&amp;quot;];&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llDialog(llDetectedOwner(0), &amp;quot;configure switch&amp;quot;, MAIN_MENU, 42);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_functions=&lt;br /&gt;
{{LSL DefineRow||[[llGetOwnerKey]]|llGetOwnerKey() is the same as llDetectedOwner(0)}}&lt;br /&gt;
{{LSL DefineRow||[[llGetOwner]]|}}&lt;br /&gt;
|also_events&lt;br /&gt;
|also_articles={{LSL DefineRow||{{LSLGC|Detected}}|}}&lt;br /&gt;
|notes&lt;br /&gt;
|cat1=Owner&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;br /&gt;
{{LSLC|Detected|owner}}&lt;/div&gt;</summary>
		<author><name>Kerik Rau</name></author>
	</entry>
</feed>