<?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=Kimm+Paulino</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=Kimm+Paulino"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/wiki/Special:Contributions/Kimm_Paulino"/>
	<updated>2026-05-24T17:47:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1200131</id>
		<title>User:Kimm Paulino</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1200131"/>
		<updated>2016-05-18T20:15:59Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* About */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header}}&lt;br /&gt;
{{SL-hCard/2.0&lt;br /&gt;
|name=Kimm Paulino&lt;br /&gt;
|about=Owner of Kimmscripts&lt;br /&gt;
|fields={{SL-hCard/field|Inworld|&lt;br /&gt;
* Second Life Profile:&lt;br /&gt;
**{{SL-Profile|Kimm Paulino}}&lt;br /&gt;
* Marketplace:&lt;br /&gt;
**[https://marketplace.secondlife.com/stores/80880 kimmscripts]&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{skills&lt;br /&gt;
|Architect=&lt;br /&gt;
|Builder=&lt;br /&gt;
|Machinima=&lt;br /&gt;
|Roleplayer=&lt;br /&gt;
|Scenographer=&lt;br /&gt;
|Scripter=*&lt;br /&gt;
|SLogistician=&lt;br /&gt;
|Terraformer=&lt;br /&gt;
|}}&lt;br /&gt;
&lt;br /&gt;
=== About ===&lt;br /&gt;
&lt;br /&gt;
Started in SL since September 2008.  I&#039;m not around very much anymore, but have left all this here in case it is of use to someone.&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
Users with good scripting info:&lt;br /&gt;
* [[User:Becky Pippen]]&lt;br /&gt;
* [[User:Fred Gandt]]&lt;br /&gt;
* [[User:Void Singer]]&lt;br /&gt;
* [[User:Opensource_Obscure]]&lt;br /&gt;
* [[User:Omei_Qunhua]]&lt;br /&gt;
* [[User:Pedro_Oval]]&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
List most scripters, I&#039;ve collected various scripting odds and ends and share a few of them here for good measure in case they are of wider use.  They are provided &#039;as is&#039; for free use.  I make no claim about their fitness for purpose. If I&#039;ve used something from a resource somewhere I&#039;ve tried to include a credit, but if I&#039;ve missed any - sorry!  Do let me know and I&#039;ll add it back in.&lt;br /&gt;
&lt;br /&gt;
Feel free to drop me a im if you find anything useful. Unfortunately I am unlikely to be able to answer questions about them.  If you have scripting questions, try the in-world scripting groups.&lt;br /&gt;
&lt;br /&gt;
The scripts:&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts]]&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts1]]&lt;br /&gt;
&lt;br /&gt;
Other info:&lt;br /&gt;
* http://kimmscripts.wordpress.com/ - help and usage information&lt;br /&gt;
* http://kimmscripts.wordpress.com/about/ - my views on scripting&lt;br /&gt;
&lt;br /&gt;
=== Scripting Tips and Techniques ===&lt;br /&gt;
&lt;br /&gt;
Optimisations and Memory Efficient Scripting:&lt;br /&gt;
* [[User:Void Singer/Optimizations]]&lt;br /&gt;
* [[LSL_Script_Memory]]&lt;br /&gt;
* http://www.lslwiki.net/lslwiki/wakka.php?wakka=MemoryUsage&lt;br /&gt;
* [[User:Becky Pippen/Script_Memory_Limits]]&lt;br /&gt;
&lt;br /&gt;
Other stuff&lt;br /&gt;
* https://wiki.secondlife.com/wiki/Category:LSL_Avatar/Name&lt;br /&gt;
* [[User:Void_Singer/Rotations]], also SLU Tutorials on rotations [http://www.sluniverse.com/php/vb/tutorials/62235-basic-introduction-rotations.html here] and [http://www.sluniverse.com/php/vb/tutorials/62479-introduction-rotations-translations-rotation-tutorial.html here]&lt;br /&gt;
&lt;br /&gt;
=== Open Source or Freely Available Scripting Systems ===&lt;br /&gt;
&lt;br /&gt;
This is a list of personal bookmarks for things I&#039;ve found interesting, not an exaustive list - see the [http://community.secondlife.com/t5/LSL-Library/bd-p/LSLScriptingLibrary Library Forum] and [[LSL_Library]] wiki pages for that.&lt;br /&gt;
&lt;br /&gt;
* [[User:Nandana_Singh/nPose]]&lt;br /&gt;
* [[User:Rufus_Darkfold/PrimControl_HUD]]&lt;br /&gt;
* [[XyzzyText]]&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1200130</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1200130"/>
		<updated>2016-05-18T20:14:44Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up&lt;br /&gt;
// or derez a defined time after they unsit.&lt;br /&gt;
//&lt;br /&gt;
// Note: It doesn&#039;t unsit any other avatars sitting on other&lt;br /&gt;
// prims prior to derezzing, but derezzing will unsit them anyway!&lt;br /&gt;
//&lt;br /&gt;
// It will also (optionally) automatically derez itself after a specified&lt;br /&gt;
// time if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
// TRUE if want to immediately auto derez when av gets up.&lt;br /&gt;
// (overrides DEREZ_AFTER_UNSIT_TIMEOUT)&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Time to derez if noone sits down&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av sits down, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av gets up, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_UNSIT_TIMEOUT = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
integer gSitting = FALSE;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                gSitting = TRUE;&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gSitting)&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up - it was sitting and now isn&#039;t ...&lt;br /&gt;
                gSitting = FALSE;&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    // Want to derez straight away&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_UNSIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Could be unlinking going on&lt;br /&gt;
                // or maybe there is another sit target in a linked prim&lt;br /&gt;
                // that someone has just sat on or vacated&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Timer Action Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Basic timer-driven state changing script.&lt;br /&gt;
// NB: Does not use the LSL ability to define&lt;br /&gt;
// states, but uses a counter to manage a simple&lt;br /&gt;
// incrementing state machine.&lt;br /&gt;
//&lt;br /&gt;
//  Every time interval, it will change its record of state&lt;br /&gt;
//  and you can add code to do something, then it will move&lt;br /&gt;
//  to the next state.&lt;br /&gt;
//&lt;br /&gt;
//  To add more things, just add more&lt;br /&gt;
//        else if (gState == 4)&lt;br /&gt;
//        {&lt;br /&gt;
//            // and the next&lt;br /&gt;
//        }&lt;br /&gt;
//  statements in the appropriate place.&lt;br /&gt;
//&lt;br /&gt;
// If you want the timer interval to be different for different&lt;br /&gt;
// states, then you could add more llSetTimerEvent() calls&lt;br /&gt;
// in each state to set the timer for the next one.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2012&lt;br /&gt;
 &lt;br /&gt;
// Timer interval in seconds&lt;br /&gt;
float TIMER_INTERVAL = 5.0;&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState ++;&lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            // Do the first thing here&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 2)&lt;br /&gt;
        {&lt;br /&gt;
            // After the timer interval this is next&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 3)&lt;br /&gt;
        {&lt;br /&gt;
            // and the next&lt;br /&gt;
        }&lt;br /&gt;
        // add more else if () statements here&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Once all states are complete, reset the counter ready for the next time&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multiple Notecard Reading Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Example showing multiple notecard reading.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Oct 2012&lt;br /&gt;
&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
integer gNCNumber;&lt;br /&gt;
string   gNCName;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gNCNumber = 0;&lt;br /&gt;
        gNCLine = 0;&lt;br /&gt;
        gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
        if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Note: If the notecard contains embedded objects (like scripts, landmarks, etc)&lt;br /&gt;
        // then EOF is returned - so this will move onto the next one as if the notecard&lt;br /&gt;
        // was empty.&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // Move to the next notecard&lt;br /&gt;
            gNCNumber++;&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
            if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
                gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Complete&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // Wait for the next line to be read&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Do something with the notecard line&lt;br /&gt;
        // Note: Only get first 255 characters of each line&lt;br /&gt;
        llOwnerSay (data);&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(gNCName, gNCLine);&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Alarm Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Simple script to trigger at a certain time and perform a function,&lt;br /&gt;
// in the default case send an IM to the specified avatar&lt;br /&gt;
//&lt;br /&gt;
// Notes&lt;br /&gt;
// Can specify a time in GMT (ie no seasonal changes) or SLT&lt;br /&gt;
// Uses 24 hour times&lt;br /&gt;
// Can include touch control if required&lt;br /&gt;
// Sends the specified message to the specified UUID &lt;br /&gt;
//&lt;br /&gt;
// If you want it to do something else, code it in the alarm() function&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2012&lt;br /&gt;
// http://kimmscripts.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
integer gHour = 7;  // 24 hour clock&lt;br /&gt;
integer gMin = 30;&lt;br /&gt;
integer gSec = 0;&lt;br /&gt;
integer gGMT = TRUE;   // GMT or SL time&lt;br /&gt;
integer gTouchControl = TRUE;&lt;br /&gt;
string gMsg = &amp;quot;Wake up!&amp;quot;;&lt;br /&gt;
key gAv = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer gArmed;&lt;br /&gt;
&lt;br /&gt;
setAlarm ()&lt;br /&gt;
{&lt;br /&gt;
    // set a timer event for destination time - current time&lt;br /&gt;
    float desttime = (float)(gHour*60*60 + gMin*60 + gSec);&lt;br /&gt;
&lt;br /&gt;
    // This is the number of seconds since midnight&lt;br /&gt;
    // so the required setting until the destination time&lt;br /&gt;
    // will depend on if the time is in the past or not.&lt;br /&gt;
    // If we happen to get lucky and &lt;br /&gt;
    float nowtime = llGetWallclock ();&lt;br /&gt;
    if (gGMT)&lt;br /&gt;
    {&lt;br /&gt;
        nowtime = llGetGMTclock ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (nowtime &amp;gt;= desttime)&lt;br /&gt;
    {&lt;br /&gt;
        // Need to add 24 hours before subtracting&lt;br /&gt;
        desttime = desttime + 24.0*60.0*60.0;&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableAlarm()&lt;br /&gt;
{&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// This is what happens on the alarm&lt;br /&gt;
alarm ()&lt;br /&gt;
{&lt;br /&gt;
    //llOwnerSay (&amp;quot;Alarm&amp;quot;);&lt;br /&gt;
    llInstantMessage (gAv, gMsg);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string zone = &amp;quot; SLT&amp;quot;;&lt;br /&gt;
        if (gGMT)&lt;br /&gt;
        {&lt;br /&gt;
            zone = &amp;quot; GMT&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        llOwnerSay (&amp;quot;Alarm set for &amp;quot; + (string)gHour + &amp;quot; h &amp;quot; + (string)gMin + &amp;quot; m&amp;quot; + (string)gSec + &amp;quot; s &amp;quot; + zone);&lt;br /&gt;
        gArmed = TRUE;&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gArmed)&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = FALSE;&lt;br /&gt;
                disableAlarm();&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = TRUE;&lt;br /&gt;
                setAlarm();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        alarm();&lt;br /&gt;
        // Reset alarm each time, to allow for any drift in time&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Channel Relay ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Simple relay script.  Listens on one channel and relays&lt;br /&gt;
// everything to the another channel.&lt;br /&gt;
//&lt;br /&gt;
// Can be useful for testing things - e.g. if you are listening&lt;br /&gt;
// on a negative channel in your main script and want a way&lt;br /&gt;
// to send it test strings, you could drop this in a nearby&lt;br /&gt;
// prim and have it listen on a chat channel and pass the messages&lt;br /&gt;
// onto your prim under test.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Nov 2012&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel = 88;&lt;br /&gt;
integer gSpeakChannel = -88;&lt;br /&gt;
&lt;br /&gt;
relayMessage (string message)&lt;br /&gt;
{&lt;br /&gt;
    // Only use one of these as required:&lt;br /&gt;
    // whisper = &amp;lt;10m; say = 20m; shout &amp;gt; 20m; region = whole region&lt;br /&gt;
&lt;br /&gt;
    //llWhisper (gSpeakChannel, message);&lt;br /&gt;
    llSay (gSpeakChannel, message);&lt;br /&gt;
    //llShout (gSpeakChannel, message);&lt;br /&gt;
    //llRegionSay (gSpeakChannel, message);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        llListen (gListenChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            relayMessage (message);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTTP Server and Client Example ==&lt;br /&gt;
&lt;br /&gt;
These two scripts can be used (once you&#039;ve hard-coded in the right URL into the client script) to highlight basic prim to prim communications using HTTP without requiring an external server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Very, very simple HTTP server test script, as seen on&lt;br /&gt;
// http://wiki.secondlife.com/wiki/LSL_http_server/examples&lt;br /&gt;
//&lt;br /&gt;
// Note: It gets a new public URL each time it runs or&lt;br /&gt;
// when the object moves Sims ...&lt;br /&gt;
//&lt;br /&gt;
// So, you&#039;ll need to update the URL used by any client objects,&lt;br /&gt;
// or use some kind of dynamic URL service - there are some around&lt;br /&gt;
// on the Internet - search/read about HTTP-in&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2009&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;URL: &amp;quot; + body);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Handling Response ...&amp;quot;);&lt;br /&gt;
            llHTTPResponse(id,200,&amp;quot;Hello From Kimm&#039;s HTTP Test&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// HTTP Test.  This will request the contents of the specified&lt;br /&gt;
// URL.  The idea is that the URL is provided by a companion object&lt;br /&gt;
// in SL.  Note that the URL created by the llRequestURL call changes&lt;br /&gt;
// when the server object is rezzed or moves sims though ...&lt;br /&gt;
//&lt;br /&gt;
// There are some services on the Net that provide a semi-permanent&lt;br /&gt;
// URL for use with HTTP-in like this though ...&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2009&lt;br /&gt;
&lt;br /&gt;
string URL = &amp;quot;past in your URL from the server script here&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;
        llHTTPRequest (URL, [HTTP_METHOD, &amp;quot;GET&amp;quot;], &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_response(key id, integer status, list meta, string body)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (PUBLIC_CHANNEL, &amp;quot;Response: &amp;quot; + (string)body);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTTP POST Client and Server Example ==&lt;br /&gt;
&lt;br /&gt;
This is similar to the above pair of scripts, but uses HTTP POST to send a message from the client to the server.  The message is entered using a text box.  It also uses the text box to enter in the server&#039;s URL when it first starts up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Very, very simple HTTP server test script, as seen on&lt;br /&gt;
// http://wiki.secondlife.com/wiki/LSL_http_server/examples&lt;br /&gt;
//&lt;br /&gt;
// but configured to accept and display what gets sent to&lt;br /&gt;
// it via a POST request.&lt;br /&gt;
//&lt;br /&gt;
// Note: It gets a new public URL each time it runs or&lt;br /&gt;
// when the object moves Sims ...&lt;br /&gt;
//&lt;br /&gt;
// So, you&#039;ll need to update the URL used by any client objects,&lt;br /&gt;
// or use some kind of dynamic URL service - there are some around&lt;br /&gt;
// on the Internet - search/read about HTTP-in.&lt;br /&gt;
//&lt;br /&gt;
// Also, as this is a demo script, it doesn&#039;t do things like clean&lt;br /&gt;
// up URLs and so on - see the wikis for details.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2012&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;URL: &amp;quot; + body);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Handling Response ...&amp;quot;);&lt;br /&gt;
            llHTTPResponse(id,200,&amp;quot;Post me something and I&#039;ll display it ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;POST&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Received: &amp;quot; + body);&lt;br /&gt;
            llHTTPResponse (id, 200, &amp;quot;&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the client ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// HTTP Test.  This will POST a message to the specified&lt;br /&gt;
// gUrl.  The idea is that the gUrl is provided by a companion object&lt;br /&gt;
// in SL.  Note that the gUrl created by the llHRequestgUrl call changes&lt;br /&gt;
// when the server object is rezzed or moves sims though ...&lt;br /&gt;
//&lt;br /&gt;
// There are some services on the Net that provide a semi-permanent&lt;br /&gt;
// gUrl for use with HTTP-in like this though ...&lt;br /&gt;
//&lt;br /&gt;
// The message is entered using a textbox on touch.  When the script&lt;br /&gt;
// first starts up, you need to paste in the URL of the server prim&lt;br /&gt;
// using the same text box.&lt;br /&gt;
//&lt;br /&gt;
// This is just a demo script.  You&#039;ll need to do proper listen and&lt;br /&gt;
// channel handling and so on.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2012&lt;br /&gt;
&lt;br /&gt;
string gUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer randChannel ()&lt;br /&gt;
{&lt;br /&gt;
	// Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
	// Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
	// Always leaves sign bit unset (so is always positive)&lt;br /&gt;
	integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gChannel = randChannel();&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);    // Uses simplest and laggiest form of listen/channel handling&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gUrl == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llTextBox (llDetectedKey (0), &amp;quot;Paste in the URL from the server prim and click submit&amp;quot;, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llTextBox (llDetectedKey (0), &amp;quot;Type in your message to send to the HTTP server&amp;quot;, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (llSubStringIndex (message, &amp;quot;http://&amp;quot;) == 0)&lt;br /&gt;
        {&lt;br /&gt;
            // this is a new gUrl ...&lt;br /&gt;
            gUrl = message;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llHTTPRequest (gUrl, [HTTP_METHOD, &amp;quot;POST&amp;quot;], message);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;You need to provide the URL of the server prim before sending any messages&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_response(key id, integer status, list meta, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (body != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llWhisper (PUBLIC_CHANNEL, &amp;quot;Response: &amp;quot; + (string)body);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Smooth, non-mesh up/down/rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Makes an object go up and down gradually whilst slowly rotating.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// The value given to the angular velocity parameter is quite critical&lt;br /&gt;
// depending on the mass of the object you wish to rotate. You&#039;ll need&lt;br /&gt;
// a larger value for larger objects otherwise they&#039;ll hardly move.&lt;br /&gt;
//&lt;br /&gt;
// Whilst this appears to work ok for small objects, it is very unpredictable&lt;br /&gt;
// and doesn&#039;t really work for large objects.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  December 2012&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
float TIME_PERIOD=0.2;&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
float gTimerCount;&lt;br /&gt;
&lt;br /&gt;
// Angular Velocity Details - use values to rotate around the specified axis&lt;br /&gt;
// between 0.5 and around 5.0 (or even more for very large objects)&lt;br /&gt;
vector gAngularVelocity = &amp;lt;0.0, 0.0, 0.5&amp;gt;;  // For small objects&lt;br /&gt;
//vector gAngularVelocity = &amp;lt;0.0, 0.0, 5.0&amp;gt;;  // For large objects&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gTimerCount = 0.0;&lt;br /&gt;
&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating except in Z axis&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (TIME_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetAngularVelocity (gAngularVelocity, TRUE);&lt;br /&gt;
&lt;br /&gt;
        gTimerCount += TIME_PERIOD;&lt;br /&gt;
        if (gTimerCount &amp;gt; MOVE_TIME)&lt;br /&gt;
        {&lt;br /&gt;
            gTimerCount = 0.0;&lt;br /&gt;
            &lt;br /&gt;
            if (gState == DOWN)&lt;br /&gt;
            {&lt;br /&gt;
                gState = GO_UP;&lt;br /&gt;
                llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
                gState = UP;&lt;br /&gt;
            }&lt;br /&gt;
            else if (gState == UP)&lt;br /&gt;
            {&lt;br /&gt;
                gState = GO_DOWN;&lt;br /&gt;
                // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
                llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
                gState = DOWN;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Non-physical, non-mesh up/down/rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, using non-physical movement.&lt;br /&gt;
//&lt;br /&gt;
// Unfortunately, non-physical movement is jerky. If you can support it,&lt;br /&gt;
// a better up/down movement can be had using physics and up/down and&lt;br /&gt;
// rotate is better using llSetKeyframedmotion.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  December 2012&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
&lt;br /&gt;
// Period for the up/down movement is MOVE_COUNT * MOVE_TIME&lt;br /&gt;
integer MOVE_COUNT=40;&lt;br /&gt;
float MOVE_TIME=0.1;&lt;br /&gt;
&lt;br /&gt;
// Rotation value to use&lt;br /&gt;
vector gRotationAxis = &amp;lt;0.0, 0.0, 1.0&amp;gt;;&lt;br /&gt;
float    gPiDivisor = 2.0;&lt;br /&gt;
 &lt;br /&gt;
// The vector to add to the start position for MOVE_COUNT times&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 0.05&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
vector gCurrentPosition;&lt;br /&gt;
integer gCount;&lt;br /&gt;
integer gDirection;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        gDirection = 1;&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
        gCurrentPosition = gStartPosition;&lt;br /&gt;
        &lt;br /&gt;
        // Start the rotation&lt;br /&gt;
         llTargetOmega (gRotationAxis, PI/gPiDivisor, 1.0);&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gCount++;&lt;br /&gt;
        if (gCount &amp;gt; MOVE_COUNT)&lt;br /&gt;
        {&lt;br /&gt;
            gCount = 0;&lt;br /&gt;
            gDirection = -gDirection;&lt;br /&gt;
            &lt;br /&gt;
            if (gState == DOWN)&lt;br /&gt;
            {&lt;br /&gt;
                gState = GO_UP;&lt;br /&gt;
                gState = UP;&lt;br /&gt;
            }&lt;br /&gt;
            else if (gState == UP)&lt;br /&gt;
            {&lt;br /&gt;
                gState = GO_DOWN;&lt;br /&gt;
                gState = DOWN;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        gCurrentPosition = gCurrentPosition + (gOffset * gDirection);&lt;br /&gt;
        &lt;br /&gt;
        llSetPos (gCurrentPosition);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1200129</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1200129"/>
		<updated>2016-05-18T20:13:44Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        if (texture != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife:///app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Max buttons on a dialog is 12, so if more than that, then need to &lt;br /&gt;
    // include special next/back button handling&lt;br /&gt;
    integer first_texture = 0;&lt;br /&gt;
    integer last_texture = gNumTextures-1;&lt;br /&gt;
    if (gNumTextures &amp;gt; 12)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: This yields notecards counting as follows:&lt;br /&gt;
        // 0 to 8 = first page,&lt;br /&gt;
        // 9 to 17 = next page, etc&lt;br /&gt;
        first_texture = gMenuPage * 9;&lt;br /&gt;
        last_texture = first_texture + 9 - 1;&lt;br /&gt;
        if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
        {&lt;br /&gt;
            // recall last_texture indexed from 0, but&lt;br /&gt;
            // gNumTextures is indexed from 1&lt;br /&gt;
            last_texture = gNumTextures-1;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, &amp;quot;&lt;br /&gt;
    + &amp;quot;well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to &amp;quot;&lt;br /&gt;
    + &amp;quot;continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
// Jan 2013: Update to affect entire linkset&lt;br /&gt;
&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetLinkAlpha (LINK_SET, 1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetLinkAlpha (LINK_SET, 0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Includes option for touch control.&lt;br /&gt;
//&lt;br /&gt;
// Warning:&lt;br /&gt;
//  * The animation will go a little weird if it is taken into inventory&lt;br /&gt;
//     whilst moving.&lt;br /&gt;
//  * It can&#039;t be used with a rezzer unless it is stopped (so&lt;br /&gt;
//     touch control is mandatory to turn it back on).&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
// Update Jan 2013: Added touch.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again &lt;br /&gt;
integer gTouchControl = TRUE;           // FALSE to disable touch&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            // 0 = first time; 1 = off; 2 = on&lt;br /&gt;
            if (gState == 0)&lt;br /&gt;
            {&lt;br /&gt;
                gState = 2;&lt;br /&gt;
                llSetKeyframedMotion (&lt;br /&gt;
                    [&lt;br /&gt;
                        gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                        -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
                    ],&lt;br /&gt;
                    [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gState == 1)&lt;br /&gt;
            {&lt;br /&gt;
                // turn on&lt;br /&gt;
                gState = 2;&lt;br /&gt;
                llSetKeyframedMotion ([], [KFM_COMMAND, KFM_CMD_PLAY]);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // turn off&lt;br /&gt;
                gState = 1;&lt;br /&gt;
                llSetKeyframedMotion ([], [KFM_COMMAND, KFM_CMD_PAUSE]);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify List of Avatars ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Send an IM to the objects owner and the list of avs listed in the script.&lt;br /&gt;
// Will also send an acknowledgement IM to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// NB that SL includes delays and throttling to prevent spamming&lt;br /&gt;
// see: https://wiki.secondlife.com/wiki/LlInstantMessage&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Laz Longfall, Jun 2012&lt;br /&gt;
&lt;br /&gt;
// List of full avatar UUIDs.&lt;br /&gt;
// you can get this from viewing the profile of each avatar in SL&lt;br /&gt;
// (well in firestorm anyway)&lt;br /&gt;
//&lt;br /&gt;
// IMPORTANT: There is no error checking of these - make&lt;br /&gt;
// sure you paste them in correctly!&lt;br /&gt;
list avs = [&lt;br /&gt;
&amp;quot;12345678-f00d-cafe-9876-0987654321ef&amp;quot;,&lt;br /&gt;
&amp;quot;87654321-dead-dead-1234-fedcba012345&amp;quot;&lt;br /&gt;
// Remember no comma after the last entry ...&lt;br /&gt;
];&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d the store owners.  Someone will be along as soon as possible.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        string msg = time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;;&lt;br /&gt;
        llInstantMessage (owner, msg);&lt;br /&gt;
        integer num = llGetListLength (avs);&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;num ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            // It would be nice to check that the UUIDs provided are for&lt;br /&gt;
            // real avs but llKey2Name needs and avatar to be present&lt;br /&gt;
            // and llRequestAgentData makes it all asynchronous&lt;br /&gt;
            // and will only return for the valid ids - there is no&lt;br /&gt;
            // dataserver event (as far as I can tell) for invalid ones, so&lt;br /&gt;
            // I&#039;d have to have timeouts, etc, to check them.  Now I&lt;br /&gt;
            // could go through all that on startup to verify the UUIDs,&lt;br /&gt;
            // but this all seems like a significant complication in a&lt;br /&gt;
            // an otherwise really simple script ...&lt;br /&gt;
            // So just type the UUIDs correctly :)&lt;br /&gt;
            key uuid = llList2Key (avs, i);&lt;br /&gt;
            if (uuid == owner)&lt;br /&gt;
            {&lt;br /&gt;
                // we&#039;ve already done this one&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llOwnerSay (&amp;quot;Messaging: &amp;quot; + uuid);&lt;br /&gt;
                llInstantMessage (uuid, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Shower Particle Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Simple shower script.&lt;br /&gt;
// If you want the &amp;quot;droplet&amp;quot; texture, give me a shout (IM in-world)&lt;br /&gt;
//&lt;br /&gt;
// Particle Template from: http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryKeknehvParticles&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// March 2012&lt;br /&gt;
&lt;br /&gt;
integer gState = 0;&lt;br /&gt;
&lt;br /&gt;
StartWaterBurst ()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem([                   //KPSv1.0  &lt;br /&gt;
        PSYS_PART_FLAGS , 0 //Comment out any of the following masks to deactivate them&lt;br /&gt;
    //| PSYS_PART_BOUNCE_MASK           //Bounce on object&#039;s z-axis&lt;br /&gt;
    //| PSYS_PART_WIND_MASK             //Particles are moved by wind&lt;br /&gt;
    | PSYS_PART_INTERP_COLOR_MASK       //Colors fade from start to end&lt;br /&gt;
    | PSYS_PART_INTERP_SCALE_MASK       //Scale fades from beginning to end&lt;br /&gt;
    //| PSYS_PART_FOLLOW_SRC_MASK         //Particles follow the emitter&lt;br /&gt;
    //| PSYS_PART_FOLLOW_VELOCITY_MASK    //Particles are created at the velocity of the emitter&lt;br /&gt;
    //| PSYS_PART_TARGET_POS_MASK       //Particles follow the target&lt;br /&gt;
    | PSYS_PART_EMISSIVE_MASK           //Particles are self-lit (glow)&lt;br /&gt;
    //| PSYS_PART_TARGET_LINEAR_MASK    //Undocumented--Sends particles in straight line?&lt;br /&gt;
    ,&lt;br /&gt;
    &lt;br /&gt;
    //PSYS_SRC_TARGET_KEY , NULL_KEY,   //Key of the target for the particles to head towards&lt;br /&gt;
                                                //This one is particularly finicky, so be careful.&lt;br /&gt;
    //Choose one of these as a pattern:&lt;br /&gt;
    //PSYS_SRC_PATTERN_DROP                 Particles start at emitter with no velocity&lt;br /&gt;
    //PSYS_SRC_PATTERN_EXPLODE              Particles explode from the emitter&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE                Particles are emitted in a 2-D angle&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE           Particles are emitted in a 3-D cone&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY     Particles are emitted everywhere except for a 3-D cone&lt;br /&gt;
    &lt;br /&gt;
    PSYS_SRC_PATTERN,           PSYS_SRC_PATTERN_ANGLE_CONE&lt;br /&gt;
    &lt;br /&gt;
    ,PSYS_SRC_TEXTURE, &amp;quot;droplet&amp;quot;&lt;br /&gt;
    //,PSYS_SRC_TEXTURE,           &amp;quot;&amp;quot;                 //UUID of the desired particle texture, or inventory name&lt;br /&gt;
    ,PSYS_SRC_MAX_AGE,           0.0                //Time, in seconds, for particles to be emitted. 0 = forever&lt;br /&gt;
    ,PSYS_PART_MAX_AGE,          2.0                //Lifetime, in seconds, that a particle lasts&lt;br /&gt;
    ,PSYS_SRC_BURST_RATE,        0.0                //How long, in seconds, between each emission&lt;br /&gt;
    ,PSYS_SRC_BURST_PART_COUNT,  10                  //Number of particles per emission&lt;br /&gt;
    ,PSYS_SRC_BURST_RADIUS,      0.0                //Radius of emission&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MIN,   1.0                //Minimum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MAX,   2.0               //Maximum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_ACCEL,             &amp;lt;0.0,0.0,-2.0&amp;gt;     //Acceleration of particles each second&lt;br /&gt;
    ,PSYS_PART_START_COLOR,      &amp;lt;0.9,0.9,1.0&amp;gt;      //Starting RGB color&lt;br /&gt;
    ,PSYS_PART_END_COLOR,        &amp;lt;0.7,0.7,1.0&amp;gt;      //Ending RGB color, if INTERP_COLOR_MASK is on &lt;br /&gt;
    ,PSYS_PART_START_ALPHA,      0.7                //Starting transparency, 1 is opaque, 0 is transparent.&lt;br /&gt;
    ,PSYS_PART_END_ALPHA,        0.5                //Ending transparency&lt;br /&gt;
    ,PSYS_PART_START_SCALE,      &amp;lt;0.05,0.05,0.0&amp;gt;      //Starting particle size&lt;br /&gt;
    ,PSYS_PART_END_SCALE,        &amp;lt;0.12,0.12,0.0&amp;gt;      //Ending particle size, if INTERP_SCALE_MASK is on&lt;br /&gt;
    ,PSYS_SRC_ANGLE_BEGIN,       0                 //Inner angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_ANGLE_END,         PI / 6.0           //Outer angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_OMEGA,             &amp;lt;0.0,0.0,0.0&amp;gt;      //Rotation of ANGLE patterns, similar to llTargetOmega()&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
WaterStop()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem ([]);&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;
        gState = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start( integer num )&lt;br /&gt;
    {&lt;br /&gt;
        gState++;&lt;br /&gt;
        if (gState &amp;gt; 1)&lt;br /&gt;
        {&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            StartWaterBurst();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            WaterStop();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1176670</id>
		<title>User:Kimm Paulino</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1176670"/>
		<updated>2013-02-10T00:26:28Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header}}&lt;br /&gt;
{{SL-hCard/2.0&lt;br /&gt;
|name=Kimm Paulino&lt;br /&gt;
|about=Owner of Kimmscripts&lt;br /&gt;
|fields={{SL-hCard/field|Inworld|&lt;br /&gt;
* Second Life Profile:&lt;br /&gt;
**{{SL-Profile|Kimm Paulino}}&lt;br /&gt;
* Marketplace:&lt;br /&gt;
**[https://marketplace.secondlife.com/stores/80880 kimmscripts]&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{skills&lt;br /&gt;
|Architect=&lt;br /&gt;
|Builder=&lt;br /&gt;
|Machinima=&lt;br /&gt;
|Roleplayer=&lt;br /&gt;
|Scenographer=&lt;br /&gt;
|Scripter=*&lt;br /&gt;
|SLogistician=&lt;br /&gt;
|Terraformer=&lt;br /&gt;
|}}&lt;br /&gt;
&lt;br /&gt;
=== About ===&lt;br /&gt;
&lt;br /&gt;
Been in SL since September 2008.  Slowly started experimenting more with scripting during that time.  Usually happy to say &#039;hi&#039;.&lt;br /&gt;
&lt;br /&gt;
At the moment, I am fairly well preoccupied helping set up http://synzcreations.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
Users with good scripting info:&lt;br /&gt;
* [[User:Becky Pippen]]&lt;br /&gt;
* [[User:Fred Gandt]]&lt;br /&gt;
* [[User:Void Singer]]&lt;br /&gt;
* [[User:Opensource_Obscure]]&lt;br /&gt;
* [[User:Omei_Qunhua]]&lt;br /&gt;
* [[User:Pedro_Oval]]&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
List most scripters, I&#039;ve collected various scripting odds and ends and share a few of them here for good measure in case they are of wider use.  They are provided &#039;as is&#039; for free use.  I make no claim about their fitness for purpose. If I&#039;ve used something from a resource somewhere I&#039;ve tried to include a credit, but if I&#039;ve missed any - sorry!  Do let me know and I&#039;ll add it back in.&lt;br /&gt;
&lt;br /&gt;
Feel free to drop me a im if you find anything useful. Unfortunately I am unlikely to be able to answer questions about them.  If you have scripting questions, try the in-world scripting groups.&lt;br /&gt;
&lt;br /&gt;
The scripts:&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts]]&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts1]]&lt;br /&gt;
&lt;br /&gt;
Other info:&lt;br /&gt;
* http://kimmscripts.wordpress.com/ - help and usage information&lt;br /&gt;
* http://kimmscripts.wordpress.com/about/ - my views on scripting&lt;br /&gt;
&lt;br /&gt;
=== Scripting Tips and Techniques ===&lt;br /&gt;
&lt;br /&gt;
Optimisations and Memory Efficient Scripting:&lt;br /&gt;
* [[User:Void Singer/Optimizations]]&lt;br /&gt;
* [[LSL_Script_Memory]]&lt;br /&gt;
* http://www.lslwiki.net/lslwiki/wakka.php?wakka=MemoryUsage&lt;br /&gt;
* [[User:Becky Pippen/Script_Memory_Limits]]&lt;br /&gt;
&lt;br /&gt;
Other stuff&lt;br /&gt;
* https://wiki.secondlife.com/wiki/Category:LSL_Avatar/Name&lt;br /&gt;
* [[User:Void_Singer/Rotations]], also SLU Tutorials on rotations [http://www.sluniverse.com/php/vb/tutorials/62235-basic-introduction-rotations.html here] and [http://www.sluniverse.com/php/vb/tutorials/62479-introduction-rotations-translations-rotation-tutorial.html here]&lt;br /&gt;
&lt;br /&gt;
=== Open Source or Freely Available Scripting Systems ===&lt;br /&gt;
&lt;br /&gt;
This is a list of personal bookmarks for things I&#039;ve found interesting, not an exaustive list - see the [http://community.secondlife.com/t5/LSL-Library/bd-p/LSLScriptingLibrary Library Forum] and [[LSL_Library]] wiki pages for that.&lt;br /&gt;
&lt;br /&gt;
* [[User:Nandana_Singh/nPose]]&lt;br /&gt;
* [[User:Rufus_Darkfold/PrimControl_HUD]]&lt;br /&gt;
* [[XyzzyText]]&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1176668</id>
		<title>User:Kimm Paulino</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1176668"/>
		<updated>2013-02-09T23:56:22Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{skills&lt;br /&gt;
|Architect=&lt;br /&gt;
|Builder=&lt;br /&gt;
|Machinima=&lt;br /&gt;
|Roleplayer=&lt;br /&gt;
|Scenographer=&lt;br /&gt;
|Scripter=*&lt;br /&gt;
|SLogistician=&lt;br /&gt;
|Terraformer=&lt;br /&gt;
|}}&lt;br /&gt;
&lt;br /&gt;
=== About ===&lt;br /&gt;
&lt;br /&gt;
Been in SL since September 2008.  Slowly started experimenting more with scripting during that time.  Usually happy to say &#039;hi&#039;.&lt;br /&gt;
&lt;br /&gt;
At the moment, I am fairly well preoccupied helping set up http://synzcreations.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
Users with good scripting info:&lt;br /&gt;
* [[User:Becky Pippen]]&lt;br /&gt;
* [[User:Fred Gandt]]&lt;br /&gt;
* [[User:Void Singer]]&lt;br /&gt;
* [[User:Opensource_Obscure]]&lt;br /&gt;
* [[User:Omei_Qunhua]]&lt;br /&gt;
* [[User:Pedro_Oval]]&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
List most scripters, I&#039;ve collected various scripting odds and ends and share a few of them here for good measure in case they are of wider use.  They are provided &#039;as is&#039; for free use.  I make no claim about their fitness for purpose. If I&#039;ve used something from a resource somewhere I&#039;ve tried to include a credit, but if I&#039;ve missed any - sorry!  Do let me know and I&#039;ll add it back in.&lt;br /&gt;
&lt;br /&gt;
Feel free to drop me a im if you find anything useful. Unfortunately I am unlikely to be able to answer questions about them.  If you have scripting questions, try the in-world scripting groups.&lt;br /&gt;
&lt;br /&gt;
The scripts:&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts]]&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts1]]&lt;br /&gt;
&lt;br /&gt;
Other info:&lt;br /&gt;
* http://kimmscripts.wordpress.com/ - help and usage information&lt;br /&gt;
* http://kimmscripts.wordpress.com/about/ - my views on scripting&lt;br /&gt;
&lt;br /&gt;
=== Scripting Tips and Techniques ===&lt;br /&gt;
&lt;br /&gt;
Optimisations and Memory Efficient Scripting:&lt;br /&gt;
* [[User:Void Singer/Optimizations]]&lt;br /&gt;
* [[LSL_Script_Memory]]&lt;br /&gt;
* http://www.lslwiki.net/lslwiki/wakka.php?wakka=MemoryUsage&lt;br /&gt;
* [[User:Becky Pippen/Script_Memory_Limits]]&lt;br /&gt;
&lt;br /&gt;
Other stuff&lt;br /&gt;
* https://wiki.secondlife.com/wiki/Category:LSL_Avatar/Name&lt;br /&gt;
* [[User:Void_Singer/Rotations]], also SLU Tutorials on rotations [http://www.sluniverse.com/php/vb/tutorials/62235-basic-introduction-rotations.html here] and [http://www.sluniverse.com/php/vb/tutorials/62479-introduction-rotations-translations-rotation-tutorial.html here]&lt;br /&gt;
&lt;br /&gt;
=== Open Source or Freely Available Scripting Systems ===&lt;br /&gt;
&lt;br /&gt;
This is a list of personal bookmarks for things I&#039;ve found interesting, not an exaustive list - see the [http://community.secondlife.com/t5/LSL-Library/bd-p/LSLScriptingLibrary Library Forum] and [[LSL_Library]] wiki pages for that.&lt;br /&gt;
&lt;br /&gt;
* [[User:Nandana_Singh/nPose]]&lt;br /&gt;
* [[User:Rufus_Darkfold/PrimControl_HUD]]&lt;br /&gt;
* [[XyzzyText]]&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1176246</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1176246"/>
		<updated>2013-01-18T22:02:58Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Touch to disappear */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        if (texture != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife:///app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Max buttons on a dialog is 12, so if more than that, then need to &lt;br /&gt;
    // include special next/back button handling&lt;br /&gt;
    integer first_texture = 0;&lt;br /&gt;
    integer last_texture = gNumTextures-1;&lt;br /&gt;
    if (gNumTextures &amp;gt; 12)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: This yields notecards counting as follows:&lt;br /&gt;
        // 0 to 8 = first page,&lt;br /&gt;
        // 9 to 17 = next page, etc&lt;br /&gt;
        first_texture = gMenuPage * 9;&lt;br /&gt;
        last_texture = first_texture + 9 - 1;&lt;br /&gt;
        if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
        {&lt;br /&gt;
            // recall last_texture indexed from 0, but&lt;br /&gt;
            // gNumTextures is indexed from 1&lt;br /&gt;
            last_texture = gNumTextures-1;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, &amp;quot;&lt;br /&gt;
    + &amp;quot;well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to &amp;quot;&lt;br /&gt;
    + &amp;quot;continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
// Jan 2013: Update to affect entire linkset&lt;br /&gt;
&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetLinkAlpha (LINK_SET, 1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetLinkAlpha (LINK_SET, 0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Includes option for touch control.&lt;br /&gt;
//&lt;br /&gt;
// Warning:&lt;br /&gt;
//  * The animation will go a little weird if it is taken into inventory&lt;br /&gt;
//     whilst moving.&lt;br /&gt;
//  * It can&#039;t be used with a rezzer unless it is stopped (so&lt;br /&gt;
//     touch control is mandatory to turn it back on).&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
// Update Jan 2013: Added touch.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again &lt;br /&gt;
integer gTouchControl = TRUE;           // FALSE to disable touch&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            // 0 = first time; 1 = off; 2 = on&lt;br /&gt;
            if (gState == 0)&lt;br /&gt;
            {&lt;br /&gt;
                gState = 2;&lt;br /&gt;
                llSetKeyframedMotion (&lt;br /&gt;
                    [&lt;br /&gt;
                        gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                        -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
                    ],&lt;br /&gt;
                    [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gState == 1)&lt;br /&gt;
            {&lt;br /&gt;
                // turn on&lt;br /&gt;
                gState = 2;&lt;br /&gt;
                llSetKeyframedMotion ([], [KFM_COMMAND, KFM_CMD_PLAY]);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // turn off&lt;br /&gt;
                gState = 1;&lt;br /&gt;
                llSetKeyframedMotion ([], [KFM_COMMAND, KFM_CMD_PAUSE]);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&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;
== Notify List of Avatars ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM to the objects owner and the list of avs listed in the script.&lt;br /&gt;
// Will also send an acknowledgement IM to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// NB that SL includes delays and throttling to prevent spamming&lt;br /&gt;
// see: https://wiki.secondlife.com/wiki/LlInstantMessage&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Laz Longfall, Jun 2012&lt;br /&gt;
&lt;br /&gt;
// List of full avatar UUIDs.&lt;br /&gt;
// you can get this from viewing the profile of each avatar in SL&lt;br /&gt;
// (well in firestorm anyway)&lt;br /&gt;
//&lt;br /&gt;
// IMPORTANT: There is no error checking of these - make&lt;br /&gt;
// sure you paste them in correctly!&lt;br /&gt;
list avs = [&lt;br /&gt;
&amp;quot;12345678-f00d-cafe-9876-0987654321ef&amp;quot;,&lt;br /&gt;
&amp;quot;87654321-dead-dead-1234-fedcba012345&amp;quot;&lt;br /&gt;
// Remember no comma after the last entry ...&lt;br /&gt;
];&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d the store owners.  Someone will be along as soon as possible.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        string msg = time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;;&lt;br /&gt;
        llInstantMessage (owner, msg);&lt;br /&gt;
        integer num = llGetListLength (avs);&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;num ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            // It would be nice to check that the UUIDs provided are for&lt;br /&gt;
            // real avs but llKey2Name needs and avatar to be present&lt;br /&gt;
            // and llRequestAgentData makes it all asynchronous&lt;br /&gt;
            // and will only return for the valid ids - there is no&lt;br /&gt;
            // dataserver event (as far as I can tell) for invalid ones, so&lt;br /&gt;
            // I&#039;d have to have timeouts, etc, to check them.  Now I&lt;br /&gt;
            // could go through all that on startup to verify the UUIDs,&lt;br /&gt;
            // but this all seems like a significant complication in a&lt;br /&gt;
            // an otherwise really simple script ...&lt;br /&gt;
            // So just type the UUIDs correctly :)&lt;br /&gt;
            key uuid = llList2Key (avs, i);&lt;br /&gt;
            if (uuid == owner)&lt;br /&gt;
            {&lt;br /&gt;
                // we&#039;ve already done this one&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llOwnerSay (&amp;quot;Messaging: &amp;quot; + uuid);&lt;br /&gt;
                llInstantMessage (uuid, msg);&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;
== Simple Shower Particle Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple shower script.&lt;br /&gt;
// If you want the &amp;quot;droplet&amp;quot; texture, give me a shout (IM in-world)&lt;br /&gt;
//&lt;br /&gt;
// Particle Template from: http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryKeknehvParticles&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// March 2012&lt;br /&gt;
&lt;br /&gt;
integer gState = 0;&lt;br /&gt;
&lt;br /&gt;
StartWaterBurst ()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem([                   //KPSv1.0  &lt;br /&gt;
        PSYS_PART_FLAGS , 0 //Comment out any of the following masks to deactivate them&lt;br /&gt;
    //| PSYS_PART_BOUNCE_MASK           //Bounce on object&#039;s z-axis&lt;br /&gt;
    //| PSYS_PART_WIND_MASK             //Particles are moved by wind&lt;br /&gt;
    | PSYS_PART_INTERP_COLOR_MASK       //Colors fade from start to end&lt;br /&gt;
    | PSYS_PART_INTERP_SCALE_MASK       //Scale fades from beginning to end&lt;br /&gt;
    //| PSYS_PART_FOLLOW_SRC_MASK         //Particles follow the emitter&lt;br /&gt;
    //| PSYS_PART_FOLLOW_VELOCITY_MASK    //Particles are created at the velocity of the emitter&lt;br /&gt;
    //| PSYS_PART_TARGET_POS_MASK       //Particles follow the target&lt;br /&gt;
    | PSYS_PART_EMISSIVE_MASK           //Particles are self-lit (glow)&lt;br /&gt;
    //| PSYS_PART_TARGET_LINEAR_MASK    //Undocumented--Sends particles in straight line?&lt;br /&gt;
    ,&lt;br /&gt;
    &lt;br /&gt;
    //PSYS_SRC_TARGET_KEY , NULL_KEY,   //Key of the target for the particles to head towards&lt;br /&gt;
                                                //This one is particularly finicky, so be careful.&lt;br /&gt;
    //Choose one of these as a pattern:&lt;br /&gt;
    //PSYS_SRC_PATTERN_DROP                 Particles start at emitter with no velocity&lt;br /&gt;
    //PSYS_SRC_PATTERN_EXPLODE              Particles explode from the emitter&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE                Particles are emitted in a 2-D angle&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE           Particles are emitted in a 3-D cone&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY     Particles are emitted everywhere except for a 3-D cone&lt;br /&gt;
    &lt;br /&gt;
    PSYS_SRC_PATTERN,           PSYS_SRC_PATTERN_ANGLE_CONE&lt;br /&gt;
    &lt;br /&gt;
    ,PSYS_SRC_TEXTURE, &amp;quot;droplet&amp;quot;&lt;br /&gt;
    //,PSYS_SRC_TEXTURE,           &amp;quot;&amp;quot;                 //UUID of the desired particle texture, or inventory name&lt;br /&gt;
    ,PSYS_SRC_MAX_AGE,           0.0                //Time, in seconds, for particles to be emitted. 0 = forever&lt;br /&gt;
    ,PSYS_PART_MAX_AGE,          2.0                //Lifetime, in seconds, that a particle lasts&lt;br /&gt;
    ,PSYS_SRC_BURST_RATE,        0.0                //How long, in seconds, between each emission&lt;br /&gt;
    ,PSYS_SRC_BURST_PART_COUNT,  10                  //Number of particles per emission&lt;br /&gt;
    ,PSYS_SRC_BURST_RADIUS,      0.0                //Radius of emission&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MIN,   1.0                //Minimum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MAX,   2.0               //Maximum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_ACCEL,             &amp;lt;0.0,0.0,-2.0&amp;gt;     //Acceleration of particles each second&lt;br /&gt;
    ,PSYS_PART_START_COLOR,      &amp;lt;0.9,0.9,1.0&amp;gt;      //Starting RGB color&lt;br /&gt;
    ,PSYS_PART_END_COLOR,        &amp;lt;0.7,0.7,1.0&amp;gt;      //Ending RGB color, if INTERP_COLOR_MASK is on &lt;br /&gt;
    ,PSYS_PART_START_ALPHA,      0.7                //Starting transparency, 1 is opaque, 0 is transparent.&lt;br /&gt;
    ,PSYS_PART_END_ALPHA,        0.5                //Ending transparency&lt;br /&gt;
    ,PSYS_PART_START_SCALE,      &amp;lt;0.05,0.05,0.0&amp;gt;      //Starting particle size&lt;br /&gt;
    ,PSYS_PART_END_SCALE,        &amp;lt;0.12,0.12,0.0&amp;gt;      //Ending particle size, if INTERP_SCALE_MASK is on&lt;br /&gt;
    ,PSYS_SRC_ANGLE_BEGIN,       0                 //Inner angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_ANGLE_END,         PI / 6.0           //Outer angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_OMEGA,             &amp;lt;0.0,0.0,0.0&amp;gt;      //Rotation of ANGLE patterns, similar to llTargetOmega()&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
WaterStop()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem ([]);&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;
        gState = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start( integer num )&lt;br /&gt;
    {&lt;br /&gt;
        gState++;&lt;br /&gt;
        if (gState &amp;gt; 1)&lt;br /&gt;
        {&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            StartWaterBurst();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            WaterStop();&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1175794</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1175794"/>
		<updated>2013-01-03T00:17:32Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Move up and Down and rotate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        if (texture != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife:///app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Max buttons on a dialog is 12, so if more than that, then need to &lt;br /&gt;
    // include special next/back button handling&lt;br /&gt;
    integer first_texture = 0;&lt;br /&gt;
    integer last_texture = gNumTextures-1;&lt;br /&gt;
    if (gNumTextures &amp;gt; 12)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: This yields notecards counting as follows:&lt;br /&gt;
        // 0 to 8 = first page,&lt;br /&gt;
        // 9 to 17 = next page, etc&lt;br /&gt;
        first_texture = gMenuPage * 9;&lt;br /&gt;
        last_texture = first_texture + 9 - 1;&lt;br /&gt;
        if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
        {&lt;br /&gt;
            // recall last_texture indexed from 0, but&lt;br /&gt;
            // gNumTextures is indexed from 1&lt;br /&gt;
            last_texture = gNumTextures-1;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, &amp;quot;&lt;br /&gt;
    + &amp;quot;well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to &amp;quot;&lt;br /&gt;
    + &amp;quot;continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Includes option for touch control.&lt;br /&gt;
//&lt;br /&gt;
// Warning:&lt;br /&gt;
//  * The animation will go a little weird if it is taken into inventory&lt;br /&gt;
//     whilst moving.&lt;br /&gt;
//  * It can&#039;t be used with a rezzer unless it is stopped (so&lt;br /&gt;
//     touch control is mandatory to turn it back on).&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
// Update Jan 2013: Added touch.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again &lt;br /&gt;
integer gTouchControl = TRUE;           // FALSE to disable touch&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            // 0 = first time; 1 = off; 2 = on&lt;br /&gt;
            if (gState == 0)&lt;br /&gt;
            {&lt;br /&gt;
                gState = 2;&lt;br /&gt;
                llSetKeyframedMotion (&lt;br /&gt;
                    [&lt;br /&gt;
                        gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                        -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
                    ],&lt;br /&gt;
                    [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gState == 1)&lt;br /&gt;
            {&lt;br /&gt;
                // turn on&lt;br /&gt;
                gState = 2;&lt;br /&gt;
                llSetKeyframedMotion ([], [KFM_COMMAND, KFM_CMD_PLAY]);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // turn off&lt;br /&gt;
                gState = 1;&lt;br /&gt;
                llSetKeyframedMotion ([], [KFM_COMMAND, KFM_CMD_PAUSE]);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&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;
== Notify List of Avatars ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM to the objects owner and the list of avs listed in the script.&lt;br /&gt;
// Will also send an acknowledgement IM to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// NB that SL includes delays and throttling to prevent spamming&lt;br /&gt;
// see: https://wiki.secondlife.com/wiki/LlInstantMessage&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Laz Longfall, Jun 2012&lt;br /&gt;
&lt;br /&gt;
// List of full avatar UUIDs.&lt;br /&gt;
// you can get this from viewing the profile of each avatar in SL&lt;br /&gt;
// (well in firestorm anyway)&lt;br /&gt;
//&lt;br /&gt;
// IMPORTANT: There is no error checking of these - make&lt;br /&gt;
// sure you paste them in correctly!&lt;br /&gt;
list avs = [&lt;br /&gt;
&amp;quot;12345678-f00d-cafe-9876-0987654321ef&amp;quot;,&lt;br /&gt;
&amp;quot;87654321-dead-dead-1234-fedcba012345&amp;quot;&lt;br /&gt;
// Remember no comma after the last entry ...&lt;br /&gt;
];&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d the store owners.  Someone will be along as soon as possible.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        string msg = time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;;&lt;br /&gt;
        llInstantMessage (owner, msg);&lt;br /&gt;
        integer num = llGetListLength (avs);&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;num ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            // It would be nice to check that the UUIDs provided are for&lt;br /&gt;
            // real avs but llKey2Name needs and avatar to be present&lt;br /&gt;
            // and llRequestAgentData makes it all asynchronous&lt;br /&gt;
            // and will only return for the valid ids - there is no&lt;br /&gt;
            // dataserver event (as far as I can tell) for invalid ones, so&lt;br /&gt;
            // I&#039;d have to have timeouts, etc, to check them.  Now I&lt;br /&gt;
            // could go through all that on startup to verify the UUIDs,&lt;br /&gt;
            // but this all seems like a significant complication in a&lt;br /&gt;
            // an otherwise really simple script ...&lt;br /&gt;
            // So just type the UUIDs correctly :)&lt;br /&gt;
            key uuid = llList2Key (avs, i);&lt;br /&gt;
            if (uuid == owner)&lt;br /&gt;
            {&lt;br /&gt;
                // we&#039;ve already done this one&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llOwnerSay (&amp;quot;Messaging: &amp;quot; + uuid);&lt;br /&gt;
                llInstantMessage (uuid, msg);&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;
== Simple Shower Particle Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple shower script.&lt;br /&gt;
// If you want the &amp;quot;droplet&amp;quot; texture, give me a shout (IM in-world)&lt;br /&gt;
//&lt;br /&gt;
// Particle Template from: http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryKeknehvParticles&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// March 2012&lt;br /&gt;
&lt;br /&gt;
integer gState = 0;&lt;br /&gt;
&lt;br /&gt;
StartWaterBurst ()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem([                   //KPSv1.0  &lt;br /&gt;
        PSYS_PART_FLAGS , 0 //Comment out any of the following masks to deactivate them&lt;br /&gt;
    //| PSYS_PART_BOUNCE_MASK           //Bounce on object&#039;s z-axis&lt;br /&gt;
    //| PSYS_PART_WIND_MASK             //Particles are moved by wind&lt;br /&gt;
    | PSYS_PART_INTERP_COLOR_MASK       //Colors fade from start to end&lt;br /&gt;
    | PSYS_PART_INTERP_SCALE_MASK       //Scale fades from beginning to end&lt;br /&gt;
    //| PSYS_PART_FOLLOW_SRC_MASK         //Particles follow the emitter&lt;br /&gt;
    //| PSYS_PART_FOLLOW_VELOCITY_MASK    //Particles are created at the velocity of the emitter&lt;br /&gt;
    //| PSYS_PART_TARGET_POS_MASK       //Particles follow the target&lt;br /&gt;
    | PSYS_PART_EMISSIVE_MASK           //Particles are self-lit (glow)&lt;br /&gt;
    //| PSYS_PART_TARGET_LINEAR_MASK    //Undocumented--Sends particles in straight line?&lt;br /&gt;
    ,&lt;br /&gt;
    &lt;br /&gt;
    //PSYS_SRC_TARGET_KEY , NULL_KEY,   //Key of the target for the particles to head towards&lt;br /&gt;
                                                //This one is particularly finicky, so be careful.&lt;br /&gt;
    //Choose one of these as a pattern:&lt;br /&gt;
    //PSYS_SRC_PATTERN_DROP                 Particles start at emitter with no velocity&lt;br /&gt;
    //PSYS_SRC_PATTERN_EXPLODE              Particles explode from the emitter&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE                Particles are emitted in a 2-D angle&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE           Particles are emitted in a 3-D cone&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY     Particles are emitted everywhere except for a 3-D cone&lt;br /&gt;
    &lt;br /&gt;
    PSYS_SRC_PATTERN,           PSYS_SRC_PATTERN_ANGLE_CONE&lt;br /&gt;
    &lt;br /&gt;
    ,PSYS_SRC_TEXTURE, &amp;quot;droplet&amp;quot;&lt;br /&gt;
    //,PSYS_SRC_TEXTURE,           &amp;quot;&amp;quot;                 //UUID of the desired particle texture, or inventory name&lt;br /&gt;
    ,PSYS_SRC_MAX_AGE,           0.0                //Time, in seconds, for particles to be emitted. 0 = forever&lt;br /&gt;
    ,PSYS_PART_MAX_AGE,          2.0                //Lifetime, in seconds, that a particle lasts&lt;br /&gt;
    ,PSYS_SRC_BURST_RATE,        0.0                //How long, in seconds, between each emission&lt;br /&gt;
    ,PSYS_SRC_BURST_PART_COUNT,  10                  //Number of particles per emission&lt;br /&gt;
    ,PSYS_SRC_BURST_RADIUS,      0.0                //Radius of emission&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MIN,   1.0                //Minimum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MAX,   2.0               //Maximum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_ACCEL,             &amp;lt;0.0,0.0,-2.0&amp;gt;     //Acceleration of particles each second&lt;br /&gt;
    ,PSYS_PART_START_COLOR,      &amp;lt;0.9,0.9,1.0&amp;gt;      //Starting RGB color&lt;br /&gt;
    ,PSYS_PART_END_COLOR,        &amp;lt;0.7,0.7,1.0&amp;gt;      //Ending RGB color, if INTERP_COLOR_MASK is on &lt;br /&gt;
    ,PSYS_PART_START_ALPHA,      0.7                //Starting transparency, 1 is opaque, 0 is transparent.&lt;br /&gt;
    ,PSYS_PART_END_ALPHA,        0.5                //Ending transparency&lt;br /&gt;
    ,PSYS_PART_START_SCALE,      &amp;lt;0.05,0.05,0.0&amp;gt;      //Starting particle size&lt;br /&gt;
    ,PSYS_PART_END_SCALE,        &amp;lt;0.12,0.12,0.0&amp;gt;      //Ending particle size, if INTERP_SCALE_MASK is on&lt;br /&gt;
    ,PSYS_SRC_ANGLE_BEGIN,       0                 //Inner angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_ANGLE_END,         PI / 6.0           //Outer angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_OMEGA,             &amp;lt;0.0,0.0,0.0&amp;gt;      //Rotation of ANGLE patterns, similar to llTargetOmega()&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
WaterStop()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem ([]);&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;
        gState = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start( integer num )&lt;br /&gt;
    {&lt;br /&gt;
        gState++;&lt;br /&gt;
        if (gState &amp;gt; 1)&lt;br /&gt;
        {&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            StartWaterBurst();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            WaterStop();&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1175793</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1175793"/>
		<updated>2013-01-02T22:19:24Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Move up and Down and rotate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        if (texture != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife:///app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Max buttons on a dialog is 12, so if more than that, then need to &lt;br /&gt;
    // include special next/back button handling&lt;br /&gt;
    integer first_texture = 0;&lt;br /&gt;
    integer last_texture = gNumTextures-1;&lt;br /&gt;
    if (gNumTextures &amp;gt; 12)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: This yields notecards counting as follows:&lt;br /&gt;
        // 0 to 8 = first page,&lt;br /&gt;
        // 9 to 17 = next page, etc&lt;br /&gt;
        first_texture = gMenuPage * 9;&lt;br /&gt;
        last_texture = first_texture + 9 - 1;&lt;br /&gt;
        if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
        {&lt;br /&gt;
            // recall last_texture indexed from 0, but&lt;br /&gt;
            // gNumTextures is indexed from 1&lt;br /&gt;
            last_texture = gNumTextures-1;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, &amp;quot;&lt;br /&gt;
    + &amp;quot;well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to &amp;quot;&lt;br /&gt;
    + &amp;quot;continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Includes option for touch control.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again &lt;br /&gt;
integer gTouchControl = TRUE;           // FALSE to disable touch&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gState)&lt;br /&gt;
            {&lt;br /&gt;
                // turn off&lt;br /&gt;
                gState = 0;&lt;br /&gt;
                llSetKeyframedMotion ([], [KFM_COMMAND, KFM_CMD_PAUSE]);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // turn on&lt;br /&gt;
                gState = 1;&lt;br /&gt;
                llSetKeyframedMotion ([], [KFM_COMMAND, KFM_CMD_PLAY]);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&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;
== Notify List of Avatars ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM to the objects owner and the list of avs listed in the script.&lt;br /&gt;
// Will also send an acknowledgement IM to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// NB that SL includes delays and throttling to prevent spamming&lt;br /&gt;
// see: https://wiki.secondlife.com/wiki/LlInstantMessage&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Laz Longfall, Jun 2012&lt;br /&gt;
&lt;br /&gt;
// List of full avatar UUIDs.&lt;br /&gt;
// you can get this from viewing the profile of each avatar in SL&lt;br /&gt;
// (well in firestorm anyway)&lt;br /&gt;
//&lt;br /&gt;
// IMPORTANT: There is no error checking of these - make&lt;br /&gt;
// sure you paste them in correctly!&lt;br /&gt;
list avs = [&lt;br /&gt;
&amp;quot;12345678-f00d-cafe-9876-0987654321ef&amp;quot;,&lt;br /&gt;
&amp;quot;87654321-dead-dead-1234-fedcba012345&amp;quot;&lt;br /&gt;
// Remember no comma after the last entry ...&lt;br /&gt;
];&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d the store owners.  Someone will be along as soon as possible.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        string msg = time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;;&lt;br /&gt;
        llInstantMessage (owner, msg);&lt;br /&gt;
        integer num = llGetListLength (avs);&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;num ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            // It would be nice to check that the UUIDs provided are for&lt;br /&gt;
            // real avs but llKey2Name needs and avatar to be present&lt;br /&gt;
            // and llRequestAgentData makes it all asynchronous&lt;br /&gt;
            // and will only return for the valid ids - there is no&lt;br /&gt;
            // dataserver event (as far as I can tell) for invalid ones, so&lt;br /&gt;
            // I&#039;d have to have timeouts, etc, to check them.  Now I&lt;br /&gt;
            // could go through all that on startup to verify the UUIDs,&lt;br /&gt;
            // but this all seems like a significant complication in a&lt;br /&gt;
            // an otherwise really simple script ...&lt;br /&gt;
            // So just type the UUIDs correctly :)&lt;br /&gt;
            key uuid = llList2Key (avs, i);&lt;br /&gt;
            if (uuid == owner)&lt;br /&gt;
            {&lt;br /&gt;
                // we&#039;ve already done this one&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llOwnerSay (&amp;quot;Messaging: &amp;quot; + uuid);&lt;br /&gt;
                llInstantMessage (uuid, msg);&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;
== Simple Shower Particle Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple shower script.&lt;br /&gt;
// If you want the &amp;quot;droplet&amp;quot; texture, give me a shout (IM in-world)&lt;br /&gt;
//&lt;br /&gt;
// Particle Template from: http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryKeknehvParticles&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// March 2012&lt;br /&gt;
&lt;br /&gt;
integer gState = 0;&lt;br /&gt;
&lt;br /&gt;
StartWaterBurst ()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem([                   //KPSv1.0  &lt;br /&gt;
        PSYS_PART_FLAGS , 0 //Comment out any of the following masks to deactivate them&lt;br /&gt;
    //| PSYS_PART_BOUNCE_MASK           //Bounce on object&#039;s z-axis&lt;br /&gt;
    //| PSYS_PART_WIND_MASK             //Particles are moved by wind&lt;br /&gt;
    | PSYS_PART_INTERP_COLOR_MASK       //Colors fade from start to end&lt;br /&gt;
    | PSYS_PART_INTERP_SCALE_MASK       //Scale fades from beginning to end&lt;br /&gt;
    //| PSYS_PART_FOLLOW_SRC_MASK         //Particles follow the emitter&lt;br /&gt;
    //| PSYS_PART_FOLLOW_VELOCITY_MASK    //Particles are created at the velocity of the emitter&lt;br /&gt;
    //| PSYS_PART_TARGET_POS_MASK       //Particles follow the target&lt;br /&gt;
    | PSYS_PART_EMISSIVE_MASK           //Particles are self-lit (glow)&lt;br /&gt;
    //| PSYS_PART_TARGET_LINEAR_MASK    //Undocumented--Sends particles in straight line?&lt;br /&gt;
    ,&lt;br /&gt;
    &lt;br /&gt;
    //PSYS_SRC_TARGET_KEY , NULL_KEY,   //Key of the target for the particles to head towards&lt;br /&gt;
                                                //This one is particularly finicky, so be careful.&lt;br /&gt;
    //Choose one of these as a pattern:&lt;br /&gt;
    //PSYS_SRC_PATTERN_DROP                 Particles start at emitter with no velocity&lt;br /&gt;
    //PSYS_SRC_PATTERN_EXPLODE              Particles explode from the emitter&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE                Particles are emitted in a 2-D angle&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE           Particles are emitted in a 3-D cone&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY     Particles are emitted everywhere except for a 3-D cone&lt;br /&gt;
    &lt;br /&gt;
    PSYS_SRC_PATTERN,           PSYS_SRC_PATTERN_ANGLE_CONE&lt;br /&gt;
    &lt;br /&gt;
    ,PSYS_SRC_TEXTURE, &amp;quot;droplet&amp;quot;&lt;br /&gt;
    //,PSYS_SRC_TEXTURE,           &amp;quot;&amp;quot;                 //UUID of the desired particle texture, or inventory name&lt;br /&gt;
    ,PSYS_SRC_MAX_AGE,           0.0                //Time, in seconds, for particles to be emitted. 0 = forever&lt;br /&gt;
    ,PSYS_PART_MAX_AGE,          2.0                //Lifetime, in seconds, that a particle lasts&lt;br /&gt;
    ,PSYS_SRC_BURST_RATE,        0.0                //How long, in seconds, between each emission&lt;br /&gt;
    ,PSYS_SRC_BURST_PART_COUNT,  10                  //Number of particles per emission&lt;br /&gt;
    ,PSYS_SRC_BURST_RADIUS,      0.0                //Radius of emission&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MIN,   1.0                //Minimum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MAX,   2.0               //Maximum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_ACCEL,             &amp;lt;0.0,0.0,-2.0&amp;gt;     //Acceleration of particles each second&lt;br /&gt;
    ,PSYS_PART_START_COLOR,      &amp;lt;0.9,0.9,1.0&amp;gt;      //Starting RGB color&lt;br /&gt;
    ,PSYS_PART_END_COLOR,        &amp;lt;0.7,0.7,1.0&amp;gt;      //Ending RGB color, if INTERP_COLOR_MASK is on &lt;br /&gt;
    ,PSYS_PART_START_ALPHA,      0.7                //Starting transparency, 1 is opaque, 0 is transparent.&lt;br /&gt;
    ,PSYS_PART_END_ALPHA,        0.5                //Ending transparency&lt;br /&gt;
    ,PSYS_PART_START_SCALE,      &amp;lt;0.05,0.05,0.0&amp;gt;      //Starting particle size&lt;br /&gt;
    ,PSYS_PART_END_SCALE,        &amp;lt;0.12,0.12,0.0&amp;gt;      //Ending particle size, if INTERP_SCALE_MASK is on&lt;br /&gt;
    ,PSYS_SRC_ANGLE_BEGIN,       0                 //Inner angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_ANGLE_END,         PI / 6.0           //Outer angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_OMEGA,             &amp;lt;0.0,0.0,0.0&amp;gt;      //Rotation of ANGLE patterns, similar to llTargetOmega()&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
WaterStop()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem ([]);&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;
        gState = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start( integer num )&lt;br /&gt;
    {&lt;br /&gt;
        gState++;&lt;br /&gt;
        if (gState &amp;gt; 1)&lt;br /&gt;
        {&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            StartWaterBurst();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            WaterStop();&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1175692</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1175692"/>
		<updated>2012-12-28T23:41:36Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: added physical non-mesh up-down-rotate script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up&lt;br /&gt;
// or derez a defined time after they unsit.&lt;br /&gt;
//&lt;br /&gt;
// Note: It doesn&#039;t unsit any other avatars sitting on other&lt;br /&gt;
// prims prior to derezzing, but derezzing will unsit them anyway!&lt;br /&gt;
//&lt;br /&gt;
// It will also (optionally) automatically derez itself after a specified&lt;br /&gt;
// time if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
// TRUE if want to immediately auto derez when av gets up.&lt;br /&gt;
// (overrides DEREZ_AFTER_UNSIT_TIMEOUT)&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Time to derez if noone sits down&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av sits down, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av gets up, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_UNSIT_TIMEOUT = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
integer gSitting = FALSE;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                gSitting = TRUE;&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gSitting)&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up - it was sitting and now isn&#039;t ...&lt;br /&gt;
                gSitting = FALSE;&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    // Want to derez straight away&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_UNSIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Could be unlinking going on&lt;br /&gt;
                // or maybe there is another sit target in a linked prim&lt;br /&gt;
                // that someone has just sat on or vacated&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;
== Timer Action Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Basic timer-driven state changing script.&lt;br /&gt;
// NB: Does not use the LSL ability to define&lt;br /&gt;
// states, but uses a counter to manage a simple&lt;br /&gt;
// incrementing state machine.&lt;br /&gt;
//&lt;br /&gt;
//  Every time interval, it will change its record of state&lt;br /&gt;
//  and you can add code to do something, then it will move&lt;br /&gt;
//  to the next state.&lt;br /&gt;
//&lt;br /&gt;
//  To add more things, just add more&lt;br /&gt;
//        else if (gState == 4)&lt;br /&gt;
//        {&lt;br /&gt;
//            // and the next&lt;br /&gt;
//        }&lt;br /&gt;
//  statements in the appropriate place.&lt;br /&gt;
//&lt;br /&gt;
// If you want the timer interval to be different for different&lt;br /&gt;
// states, then you could add more llSetTimerEvent() calls&lt;br /&gt;
// in each state to set the timer for the next one.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2012&lt;br /&gt;
 &lt;br /&gt;
// Timer interval in seconds&lt;br /&gt;
float TIMER_INTERVAL = 5.0;&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState ++;&lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            // Do the first thing here&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 2)&lt;br /&gt;
        {&lt;br /&gt;
            // After the timer interval this is next&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 3)&lt;br /&gt;
        {&lt;br /&gt;
            // and the next&lt;br /&gt;
        }&lt;br /&gt;
        // add more else if () statements here&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Once all states are complete, reset the counter ready for the next time&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multiple Notecard Reading Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example showing multiple notecard reading.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Oct 2012&lt;br /&gt;
&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
integer gNCNumber;&lt;br /&gt;
string   gNCName;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gNCNumber = 0;&lt;br /&gt;
        gNCLine = 0;&lt;br /&gt;
        gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
        if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Note: If the notecard contains embedded objects (like scripts, landmarks, etc)&lt;br /&gt;
        // then EOF is returned - so this will move onto the next one as if the notecard&lt;br /&gt;
        // was empty.&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // Move to the next notecard&lt;br /&gt;
            gNCNumber++;&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
            if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
                gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Complete&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // Wait for the next line to be read&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Do something with the notecard line&lt;br /&gt;
        // Note: Only get first 255 characters of each line&lt;br /&gt;
        llOwnerSay (data);&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(gNCName, gNCLine);&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Alarm Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple script to trigger at a certain time and perform a function,&lt;br /&gt;
// in the default case send an IM to the specified avatar&lt;br /&gt;
//&lt;br /&gt;
// Notes&lt;br /&gt;
// Can specify a time in GMT (ie no seasonal changes) or SLT&lt;br /&gt;
// Uses 24 hour times&lt;br /&gt;
// Can include touch control if required&lt;br /&gt;
// Sends the specified message to the specified UUID &lt;br /&gt;
//&lt;br /&gt;
// If you want it to do something else, code it in the alarm() function&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2012&lt;br /&gt;
// http://kimmscripts.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
integer gHour = 7;  // 24 hour clock&lt;br /&gt;
integer gMin = 30;&lt;br /&gt;
integer gSec = 0;&lt;br /&gt;
integer gGMT = TRUE;   // GMT or SL time&lt;br /&gt;
integer gTouchControl = TRUE;&lt;br /&gt;
string gMsg = &amp;quot;Wake up!&amp;quot;;&lt;br /&gt;
key gAv = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer gArmed;&lt;br /&gt;
&lt;br /&gt;
setAlarm ()&lt;br /&gt;
{&lt;br /&gt;
    // set a timer event for destination time - current time&lt;br /&gt;
    float desttime = (float)(gHour*60*60 + gMin*60 + gSec);&lt;br /&gt;
&lt;br /&gt;
    // This is the number of seconds since midnight&lt;br /&gt;
    // so the required setting until the destination time&lt;br /&gt;
    // will depend on if the time is in the past or not.&lt;br /&gt;
    // If we happen to get lucky and &lt;br /&gt;
    float nowtime = llGetWallclock ();&lt;br /&gt;
    if (gGMT)&lt;br /&gt;
    {&lt;br /&gt;
        nowtime = llGetGMTclock ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (nowtime &amp;gt;= desttime)&lt;br /&gt;
    {&lt;br /&gt;
        // Need to add 24 hours before subtracting&lt;br /&gt;
        desttime = desttime + 24.0*60.0*60.0;&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableAlarm()&lt;br /&gt;
{&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// This is what happens on the alarm&lt;br /&gt;
alarm ()&lt;br /&gt;
{&lt;br /&gt;
    //llOwnerSay (&amp;quot;Alarm&amp;quot;);&lt;br /&gt;
    llInstantMessage (gAv, gMsg);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string zone = &amp;quot; SLT&amp;quot;;&lt;br /&gt;
        if (gGMT)&lt;br /&gt;
        {&lt;br /&gt;
            zone = &amp;quot; GMT&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        llOwnerSay (&amp;quot;Alarm set for &amp;quot; + (string)gHour + &amp;quot; h &amp;quot; + (string)gMin + &amp;quot; m&amp;quot; + (string)gSec + &amp;quot; s &amp;quot; + zone);&lt;br /&gt;
        gArmed = TRUE;&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gArmed)&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = FALSE;&lt;br /&gt;
                disableAlarm();&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = TRUE;&lt;br /&gt;
                setAlarm();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        alarm();&lt;br /&gt;
        // Reset alarm each time, to allow for any drift in time&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Channel Relay ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple relay script.  Listens on one channel and relays&lt;br /&gt;
// everything to the another channel.&lt;br /&gt;
//&lt;br /&gt;
// Can be useful for testing things - e.g. if you are listening&lt;br /&gt;
// on a negative channel in your main script and want a way&lt;br /&gt;
// to send it test strings, you could drop this in a nearby&lt;br /&gt;
// prim and have it listen on a chat channel and pass the messages&lt;br /&gt;
// onto your prim under test.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Nov 2012&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel = 88;&lt;br /&gt;
integer gSpeakChannel = -88;&lt;br /&gt;
&lt;br /&gt;
relayMessage (string message)&lt;br /&gt;
{&lt;br /&gt;
    // Only use one of these as required:&lt;br /&gt;
    // whisper = &amp;lt;10m; say = 20m; shout &amp;gt; 20m; region = whole region&lt;br /&gt;
&lt;br /&gt;
    //llWhisper (gSpeakChannel, message);&lt;br /&gt;
    llSay (gSpeakChannel, message);&lt;br /&gt;
    //llShout (gSpeakChannel, message);&lt;br /&gt;
    //llRegionSay (gSpeakChannel, message);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        llListen (gListenChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            relayMessage (message);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTTP Server and Client Example ==&lt;br /&gt;
&lt;br /&gt;
These two scripts can be used (once you&#039;ve hard-coded in the right URL into the client script) to highlight basic prim to prim communications using HTTP without requiring an external server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Very, very simple HTTP server test script, as seen on&lt;br /&gt;
// http://wiki.secondlife.com/wiki/LSL_http_server/examples&lt;br /&gt;
//&lt;br /&gt;
// Note: It gets a new public URL each time it runs or&lt;br /&gt;
// when the object moves Sims ...&lt;br /&gt;
//&lt;br /&gt;
// So, you&#039;ll need to update the URL used by any client objects,&lt;br /&gt;
// or use some kind of dynamic URL service - there are some around&lt;br /&gt;
// on the Internet - search/read about HTTP-in&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2009&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;URL: &amp;quot; + body);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Handling Response ...&amp;quot;);&lt;br /&gt;
            llHTTPResponse(id,200,&amp;quot;Hello From Kimm&#039;s HTTP Test&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// HTTP Test.  This will request the contents of the specified&lt;br /&gt;
// URL.  The idea is that the URL is provided by a companion object&lt;br /&gt;
// in SL.  Note that the URL created by the llRequestURL call changes&lt;br /&gt;
// when the server object is rezzed or moves sims though ...&lt;br /&gt;
//&lt;br /&gt;
// There are some services on the Net that provide a semi-permanent&lt;br /&gt;
// URL for use with HTTP-in like this though ...&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2009&lt;br /&gt;
&lt;br /&gt;
string URL = &amp;quot;past in your URL from the server script here&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;
        llHTTPRequest (URL, [HTTP_METHOD, &amp;quot;GET&amp;quot;], &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_response(key id, integer status, list meta, string body)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (PUBLIC_CHANNEL, &amp;quot;Response: &amp;quot; + (string)body);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTTP POST Client and Server Example ==&lt;br /&gt;
&lt;br /&gt;
This is similar to the above pair of scripts, but uses HTTP POST to send a message from the client to the server.  The message is entered using a text box.  It also uses the text box to enter in the server&#039;s URL when it first starts up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Very, very simple HTTP server test script, as seen on&lt;br /&gt;
// http://wiki.secondlife.com/wiki/LSL_http_server/examples&lt;br /&gt;
//&lt;br /&gt;
// but configured to accept and display what gets sent to&lt;br /&gt;
// it via a POST request.&lt;br /&gt;
//&lt;br /&gt;
// Note: It gets a new public URL each time it runs or&lt;br /&gt;
// when the object moves Sims ...&lt;br /&gt;
//&lt;br /&gt;
// So, you&#039;ll need to update the URL used by any client objects,&lt;br /&gt;
// or use some kind of dynamic URL service - there are some around&lt;br /&gt;
// on the Internet - search/read about HTTP-in.&lt;br /&gt;
//&lt;br /&gt;
// Also, as this is a demo script, it doesn&#039;t do things like clean&lt;br /&gt;
// up URLs and so on - see the wikis for details.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2012&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;URL: &amp;quot; + body);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Handling Response ...&amp;quot;);&lt;br /&gt;
            llHTTPResponse(id,200,&amp;quot;Post me something and I&#039;ll display it ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;POST&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Received: &amp;quot; + body);&lt;br /&gt;
            llHTTPResponse (id, 200, &amp;quot;&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the client ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// HTTP Test.  This will POST a message to the specified&lt;br /&gt;
// gUrl.  The idea is that the gUrl is provided by a companion object&lt;br /&gt;
// in SL.  Note that the gUrl created by the llHRequestgUrl call changes&lt;br /&gt;
// when the server object is rezzed or moves sims though ...&lt;br /&gt;
//&lt;br /&gt;
// There are some services on the Net that provide a semi-permanent&lt;br /&gt;
// gUrl for use with HTTP-in like this though ...&lt;br /&gt;
//&lt;br /&gt;
// The message is entered using a textbox on touch.  When the script&lt;br /&gt;
// first starts up, you need to paste in the URL of the server prim&lt;br /&gt;
// using the same text box.&lt;br /&gt;
//&lt;br /&gt;
// This is just a demo script.  You&#039;ll need to do proper listen and&lt;br /&gt;
// channel handling and so on.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2012&lt;br /&gt;
&lt;br /&gt;
string gUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer randChannel ()&lt;br /&gt;
{&lt;br /&gt;
	// Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
	// Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
	// Always leaves sign bit unset (so is always positive)&lt;br /&gt;
	integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gChannel = randChannel();&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);    // Uses simplest and laggiest form of listen/channel handling&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gUrl == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llTextBox (llDetectedKey (0), &amp;quot;Paste in the URL from the server prim and click submit&amp;quot;, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llTextBox (llDetectedKey (0), &amp;quot;Type in your message to send to the HTTP server&amp;quot;, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (llSubStringIndex (message, &amp;quot;http://&amp;quot;) == 0)&lt;br /&gt;
        {&lt;br /&gt;
            // this is a new gUrl ...&lt;br /&gt;
            gUrl = message;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llHTTPRequest (gUrl, [HTTP_METHOD, &amp;quot;POST&amp;quot;], message);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;You need to provide the URL of the server prim before sending any messages&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_response(key id, integer status, list meta, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (body != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llWhisper (PUBLIC_CHANNEL, &amp;quot;Response: &amp;quot; + (string)body);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Smooth, non-mesh up/down/rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up and down gradually whilst slowly rotating.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// The value given to the angular velocity parameter is quite critical&lt;br /&gt;
// depending on the mass of the object you wish to rotate. You&#039;ll need&lt;br /&gt;
// a larger value for larger objects otherwise they&#039;ll hardly move.&lt;br /&gt;
//&lt;br /&gt;
// Whilst this appears to work ok for small objects, it is very unpredictable&lt;br /&gt;
// and doesn&#039;t really work for large objects.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  December 2012&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
float TIME_PERIOD=0.2;&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
float gTimerCount;&lt;br /&gt;
&lt;br /&gt;
// Angular Velocity Details - use values to rotate around the specified axis&lt;br /&gt;
// between 0.5 and around 5.0 (or even more for very large objects)&lt;br /&gt;
vector gAngularVelocity = &amp;lt;0.0, 0.0, 0.5&amp;gt;;  // For small objects&lt;br /&gt;
//vector gAngularVelocity = &amp;lt;0.0, 0.0, 5.0&amp;gt;;  // For large objects&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gTimerCount = 0.0;&lt;br /&gt;
&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating except in Z axis&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (TIME_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetAngularVelocity (gAngularVelocity, TRUE);&lt;br /&gt;
&lt;br /&gt;
        gTimerCount += TIME_PERIOD;&lt;br /&gt;
        if (gTimerCount &amp;gt; MOVE_TIME)&lt;br /&gt;
        {&lt;br /&gt;
            gTimerCount = 0.0;&lt;br /&gt;
            &lt;br /&gt;
            if (gState == DOWN)&lt;br /&gt;
            {&lt;br /&gt;
                gState = GO_UP;&lt;br /&gt;
                llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
                gState = UP;&lt;br /&gt;
            }&lt;br /&gt;
            else if (gState == UP)&lt;br /&gt;
            {&lt;br /&gt;
                gState = GO_DOWN;&lt;br /&gt;
                // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
                llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
                gState = DOWN;&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;
== Non-physical, non-mesh up/down/rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, using non-physical movement.&lt;br /&gt;
//&lt;br /&gt;
// Unfortunately, non-physical movement is jerky. If you can support it,&lt;br /&gt;
// a better up/down movement can be had using physics and up/down and&lt;br /&gt;
// rotate is better using llSetKeyframedmotion.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  December 2012&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
&lt;br /&gt;
// Period for the up/down movement is MOVE_COUNT * MOVE_TIME&lt;br /&gt;
integer MOVE_COUNT=40;&lt;br /&gt;
float MOVE_TIME=0.1;&lt;br /&gt;
&lt;br /&gt;
// Rotation value to use&lt;br /&gt;
vector gRotationAxis = &amp;lt;0.0, 0.0, 1.0&amp;gt;;&lt;br /&gt;
float    gPiDivisor = 2.0;&lt;br /&gt;
 &lt;br /&gt;
// The vector to add to the start position for MOVE_COUNT times&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 0.05&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
vector gCurrentPosition;&lt;br /&gt;
integer gCount;&lt;br /&gt;
integer gDirection;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        gDirection = 1;&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
        gCurrentPosition = gStartPosition;&lt;br /&gt;
        &lt;br /&gt;
        // Start the rotation&lt;br /&gt;
         llTargetOmega (gRotationAxis, PI/gPiDivisor, 1.0);&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gCount++;&lt;br /&gt;
        if (gCount &amp;gt; MOVE_COUNT)&lt;br /&gt;
        {&lt;br /&gt;
            gCount = 0;&lt;br /&gt;
            gDirection = -gDirection;&lt;br /&gt;
            &lt;br /&gt;
            if (gState == DOWN)&lt;br /&gt;
            {&lt;br /&gt;
                gState = GO_UP;&lt;br /&gt;
                gState = UP;&lt;br /&gt;
            }&lt;br /&gt;
            else if (gState == UP)&lt;br /&gt;
            {&lt;br /&gt;
                gState = GO_DOWN;&lt;br /&gt;
                gState = DOWN;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        gCurrentPosition = gCurrentPosition + (gOffset * gDirection);&lt;br /&gt;
        &lt;br /&gt;
        llSetPos (gCurrentPosition);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1175691</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1175691"/>
		<updated>2012-12-28T23:31:34Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: added non-physical non-mesh up-down-rotate script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up&lt;br /&gt;
// or derez a defined time after they unsit.&lt;br /&gt;
//&lt;br /&gt;
// Note: It doesn&#039;t unsit any other avatars sitting on other&lt;br /&gt;
// prims prior to derezzing, but derezzing will unsit them anyway!&lt;br /&gt;
//&lt;br /&gt;
// It will also (optionally) automatically derez itself after a specified&lt;br /&gt;
// time if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
// TRUE if want to immediately auto derez when av gets up.&lt;br /&gt;
// (overrides DEREZ_AFTER_UNSIT_TIMEOUT)&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Time to derez if noone sits down&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av sits down, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av gets up, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_UNSIT_TIMEOUT = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
integer gSitting = FALSE;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                gSitting = TRUE;&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gSitting)&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up - it was sitting and now isn&#039;t ...&lt;br /&gt;
                gSitting = FALSE;&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    // Want to derez straight away&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_UNSIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Could be unlinking going on&lt;br /&gt;
                // or maybe there is another sit target in a linked prim&lt;br /&gt;
                // that someone has just sat on or vacated&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;
== Timer Action Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Basic timer-driven state changing script.&lt;br /&gt;
// NB: Does not use the LSL ability to define&lt;br /&gt;
// states, but uses a counter to manage a simple&lt;br /&gt;
// incrementing state machine.&lt;br /&gt;
//&lt;br /&gt;
//  Every time interval, it will change its record of state&lt;br /&gt;
//  and you can add code to do something, then it will move&lt;br /&gt;
//  to the next state.&lt;br /&gt;
//&lt;br /&gt;
//  To add more things, just add more&lt;br /&gt;
//        else if (gState == 4)&lt;br /&gt;
//        {&lt;br /&gt;
//            // and the next&lt;br /&gt;
//        }&lt;br /&gt;
//  statements in the appropriate place.&lt;br /&gt;
//&lt;br /&gt;
// If you want the timer interval to be different for different&lt;br /&gt;
// states, then you could add more llSetTimerEvent() calls&lt;br /&gt;
// in each state to set the timer for the next one.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2012&lt;br /&gt;
 &lt;br /&gt;
// Timer interval in seconds&lt;br /&gt;
float TIMER_INTERVAL = 5.0;&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState ++;&lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            // Do the first thing here&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 2)&lt;br /&gt;
        {&lt;br /&gt;
            // After the timer interval this is next&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 3)&lt;br /&gt;
        {&lt;br /&gt;
            // and the next&lt;br /&gt;
        }&lt;br /&gt;
        // add more else if () statements here&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Once all states are complete, reset the counter ready for the next time&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multiple Notecard Reading Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example showing multiple notecard reading.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Oct 2012&lt;br /&gt;
&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
integer gNCNumber;&lt;br /&gt;
string   gNCName;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gNCNumber = 0;&lt;br /&gt;
        gNCLine = 0;&lt;br /&gt;
        gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
        if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Note: If the notecard contains embedded objects (like scripts, landmarks, etc)&lt;br /&gt;
        // then EOF is returned - so this will move onto the next one as if the notecard&lt;br /&gt;
        // was empty.&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // Move to the next notecard&lt;br /&gt;
            gNCNumber++;&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
            if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
                gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Complete&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // Wait for the next line to be read&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Do something with the notecard line&lt;br /&gt;
        // Note: Only get first 255 characters of each line&lt;br /&gt;
        llOwnerSay (data);&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(gNCName, gNCLine);&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Alarm Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple script to trigger at a certain time and perform a function,&lt;br /&gt;
// in the default case send an IM to the specified avatar&lt;br /&gt;
//&lt;br /&gt;
// Notes&lt;br /&gt;
// Can specify a time in GMT (ie no seasonal changes) or SLT&lt;br /&gt;
// Uses 24 hour times&lt;br /&gt;
// Can include touch control if required&lt;br /&gt;
// Sends the specified message to the specified UUID &lt;br /&gt;
//&lt;br /&gt;
// If you want it to do something else, code it in the alarm() function&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2012&lt;br /&gt;
// http://kimmscripts.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
integer gHour = 7;  // 24 hour clock&lt;br /&gt;
integer gMin = 30;&lt;br /&gt;
integer gSec = 0;&lt;br /&gt;
integer gGMT = TRUE;   // GMT or SL time&lt;br /&gt;
integer gTouchControl = TRUE;&lt;br /&gt;
string gMsg = &amp;quot;Wake up!&amp;quot;;&lt;br /&gt;
key gAv = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer gArmed;&lt;br /&gt;
&lt;br /&gt;
setAlarm ()&lt;br /&gt;
{&lt;br /&gt;
    // set a timer event for destination time - current time&lt;br /&gt;
    float desttime = (float)(gHour*60*60 + gMin*60 + gSec);&lt;br /&gt;
&lt;br /&gt;
    // This is the number of seconds since midnight&lt;br /&gt;
    // so the required setting until the destination time&lt;br /&gt;
    // will depend on if the time is in the past or not.&lt;br /&gt;
    // If we happen to get lucky and &lt;br /&gt;
    float nowtime = llGetWallclock ();&lt;br /&gt;
    if (gGMT)&lt;br /&gt;
    {&lt;br /&gt;
        nowtime = llGetGMTclock ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (nowtime &amp;gt;= desttime)&lt;br /&gt;
    {&lt;br /&gt;
        // Need to add 24 hours before subtracting&lt;br /&gt;
        desttime = desttime + 24.0*60.0*60.0;&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableAlarm()&lt;br /&gt;
{&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// This is what happens on the alarm&lt;br /&gt;
alarm ()&lt;br /&gt;
{&lt;br /&gt;
    //llOwnerSay (&amp;quot;Alarm&amp;quot;);&lt;br /&gt;
    llInstantMessage (gAv, gMsg);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string zone = &amp;quot; SLT&amp;quot;;&lt;br /&gt;
        if (gGMT)&lt;br /&gt;
        {&lt;br /&gt;
            zone = &amp;quot; GMT&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        llOwnerSay (&amp;quot;Alarm set for &amp;quot; + (string)gHour + &amp;quot; h &amp;quot; + (string)gMin + &amp;quot; m&amp;quot; + (string)gSec + &amp;quot; s &amp;quot; + zone);&lt;br /&gt;
        gArmed = TRUE;&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gArmed)&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = FALSE;&lt;br /&gt;
                disableAlarm();&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = TRUE;&lt;br /&gt;
                setAlarm();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        alarm();&lt;br /&gt;
        // Reset alarm each time, to allow for any drift in time&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Channel Relay ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple relay script.  Listens on one channel and relays&lt;br /&gt;
// everything to the another channel.&lt;br /&gt;
//&lt;br /&gt;
// Can be useful for testing things - e.g. if you are listening&lt;br /&gt;
// on a negative channel in your main script and want a way&lt;br /&gt;
// to send it test strings, you could drop this in a nearby&lt;br /&gt;
// prim and have it listen on a chat channel and pass the messages&lt;br /&gt;
// onto your prim under test.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Nov 2012&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel = 88;&lt;br /&gt;
integer gSpeakChannel = -88;&lt;br /&gt;
&lt;br /&gt;
relayMessage (string message)&lt;br /&gt;
{&lt;br /&gt;
    // Only use one of these as required:&lt;br /&gt;
    // whisper = &amp;lt;10m; say = 20m; shout &amp;gt; 20m; region = whole region&lt;br /&gt;
&lt;br /&gt;
    //llWhisper (gSpeakChannel, message);&lt;br /&gt;
    llSay (gSpeakChannel, message);&lt;br /&gt;
    //llShout (gSpeakChannel, message);&lt;br /&gt;
    //llRegionSay (gSpeakChannel, message);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        llListen (gListenChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            relayMessage (message);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTTP Server and Client Example ==&lt;br /&gt;
&lt;br /&gt;
These two scripts can be used (once you&#039;ve hard-coded in the right URL into the client script) to highlight basic prim to prim communications using HTTP without requiring an external server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Very, very simple HTTP server test script, as seen on&lt;br /&gt;
// http://wiki.secondlife.com/wiki/LSL_http_server/examples&lt;br /&gt;
//&lt;br /&gt;
// Note: It gets a new public URL each time it runs or&lt;br /&gt;
// when the object moves Sims ...&lt;br /&gt;
//&lt;br /&gt;
// So, you&#039;ll need to update the URL used by any client objects,&lt;br /&gt;
// or use some kind of dynamic URL service - there are some around&lt;br /&gt;
// on the Internet - search/read about HTTP-in&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2009&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;URL: &amp;quot; + body);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Handling Response ...&amp;quot;);&lt;br /&gt;
            llHTTPResponse(id,200,&amp;quot;Hello From Kimm&#039;s HTTP Test&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// HTTP Test.  This will request the contents of the specified&lt;br /&gt;
// URL.  The idea is that the URL is provided by a companion object&lt;br /&gt;
// in SL.  Note that the URL created by the llRequestURL call changes&lt;br /&gt;
// when the server object is rezzed or moves sims though ...&lt;br /&gt;
//&lt;br /&gt;
// There are some services on the Net that provide a semi-permanent&lt;br /&gt;
// URL for use with HTTP-in like this though ...&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2009&lt;br /&gt;
&lt;br /&gt;
string URL = &amp;quot;past in your URL from the server script here&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;
        llHTTPRequest (URL, [HTTP_METHOD, &amp;quot;GET&amp;quot;], &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_response(key id, integer status, list meta, string body)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (PUBLIC_CHANNEL, &amp;quot;Response: &amp;quot; + (string)body);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTTP POST Client and Server Example ==&lt;br /&gt;
&lt;br /&gt;
This is similar to the above pair of scripts, but uses HTTP POST to send a message from the client to the server.  The message is entered using a text box.  It also uses the text box to enter in the server&#039;s URL when it first starts up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Very, very simple HTTP server test script, as seen on&lt;br /&gt;
// http://wiki.secondlife.com/wiki/LSL_http_server/examples&lt;br /&gt;
//&lt;br /&gt;
// but configured to accept and display what gets sent to&lt;br /&gt;
// it via a POST request.&lt;br /&gt;
//&lt;br /&gt;
// Note: It gets a new public URL each time it runs or&lt;br /&gt;
// when the object moves Sims ...&lt;br /&gt;
//&lt;br /&gt;
// So, you&#039;ll need to update the URL used by any client objects,&lt;br /&gt;
// or use some kind of dynamic URL service - there are some around&lt;br /&gt;
// on the Internet - search/read about HTTP-in.&lt;br /&gt;
//&lt;br /&gt;
// Also, as this is a demo script, it doesn&#039;t do things like clean&lt;br /&gt;
// up URLs and so on - see the wikis for details.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2012&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;URL: &amp;quot; + body);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Handling Response ...&amp;quot;);&lt;br /&gt;
            llHTTPResponse(id,200,&amp;quot;Post me something and I&#039;ll display it ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;POST&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Received: &amp;quot; + body);&lt;br /&gt;
            llHTTPResponse (id, 200, &amp;quot;&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the client ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// HTTP Test.  This will POST a message to the specified&lt;br /&gt;
// gUrl.  The idea is that the gUrl is provided by a companion object&lt;br /&gt;
// in SL.  Note that the gUrl created by the llHRequestgUrl call changes&lt;br /&gt;
// when the server object is rezzed or moves sims though ...&lt;br /&gt;
//&lt;br /&gt;
// There are some services on the Net that provide a semi-permanent&lt;br /&gt;
// gUrl for use with HTTP-in like this though ...&lt;br /&gt;
//&lt;br /&gt;
// The message is entered using a textbox on touch.  When the script&lt;br /&gt;
// first starts up, you need to paste in the URL of the server prim&lt;br /&gt;
// using the same text box.&lt;br /&gt;
//&lt;br /&gt;
// This is just a demo script.  You&#039;ll need to do proper listen and&lt;br /&gt;
// channel handling and so on.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2012&lt;br /&gt;
&lt;br /&gt;
string gUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer randChannel ()&lt;br /&gt;
{&lt;br /&gt;
	// Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
	// Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
	// Always leaves sign bit unset (so is always positive)&lt;br /&gt;
	integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gChannel = randChannel();&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);    // Uses simplest and laggiest form of listen/channel handling&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gUrl == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llTextBox (llDetectedKey (0), &amp;quot;Paste in the URL from the server prim and click submit&amp;quot;, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llTextBox (llDetectedKey (0), &amp;quot;Type in your message to send to the HTTP server&amp;quot;, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (llSubStringIndex (message, &amp;quot;http://&amp;quot;) == 0)&lt;br /&gt;
        {&lt;br /&gt;
            // this is a new gUrl ...&lt;br /&gt;
            gUrl = message;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llHTTPRequest (gUrl, [HTTP_METHOD, &amp;quot;POST&amp;quot;], message);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;You need to provide the URL of the server prim before sending any messages&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_response(key id, integer status, list meta, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (body != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llWhisper (PUBLIC_CHANNEL, &amp;quot;Response: &amp;quot; + (string)body);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Non-physical, non-mesh up/down/rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, using non-physical movement.&lt;br /&gt;
//&lt;br /&gt;
// Unfortunately, non-physical movement is jerky. If you can support it,&lt;br /&gt;
// a better up/down movement can be had using physics and up/down and&lt;br /&gt;
// rotate is better using llSetKeyframedmotion.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  December 2012&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
&lt;br /&gt;
// Period for the up/down movement is MOVE_COUNT * MOVE_TIME&lt;br /&gt;
integer MOVE_COUNT=40;&lt;br /&gt;
float MOVE_TIME=0.1;&lt;br /&gt;
&lt;br /&gt;
// Rotation value to use&lt;br /&gt;
vector gRotationAxis = &amp;lt;0.0, 0.0, 1.0&amp;gt;;&lt;br /&gt;
float    gPiDivisor = 2.0;&lt;br /&gt;
 &lt;br /&gt;
// The vector to add to the start position for MOVE_COUNT times&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 0.05&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
vector gCurrentPosition;&lt;br /&gt;
integer gCount;&lt;br /&gt;
integer gDirection;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        gDirection = 1;&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
        gCurrentPosition = gStartPosition;&lt;br /&gt;
        &lt;br /&gt;
        // Start the rotation&lt;br /&gt;
         llTargetOmega (gRotationAxis, PI/gPiDivisor, 1.0);&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gCount++;&lt;br /&gt;
        if (gCount &amp;gt; MOVE_COUNT)&lt;br /&gt;
        {&lt;br /&gt;
            gCount = 0;&lt;br /&gt;
            gDirection = -gDirection;&lt;br /&gt;
            &lt;br /&gt;
            if (gState == DOWN)&lt;br /&gt;
            {&lt;br /&gt;
                gState = GO_UP;&lt;br /&gt;
                gState = UP;&lt;br /&gt;
            }&lt;br /&gt;
            else if (gState == UP)&lt;br /&gt;
            {&lt;br /&gt;
                gState = GO_DOWN;&lt;br /&gt;
                gState = DOWN;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        gCurrentPosition = gCurrentPosition + (gOffset * gDirection);&lt;br /&gt;
        &lt;br /&gt;
        llSetPos (gCurrentPosition);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1174555</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1174555"/>
		<updated>2012-11-17T22:45:29Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Added my HTTP POST example too&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up&lt;br /&gt;
// or derez a defined time after they unsit.&lt;br /&gt;
//&lt;br /&gt;
// Note: It doesn&#039;t unsit any other avatars sitting on other&lt;br /&gt;
// prims prior to derezzing, but derezzing will unsit them anyway!&lt;br /&gt;
//&lt;br /&gt;
// It will also (optionally) automatically derez itself after a specified&lt;br /&gt;
// time if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
// TRUE if want to immediately auto derez when av gets up.&lt;br /&gt;
// (overrides DEREZ_AFTER_UNSIT_TIMEOUT)&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Time to derez if noone sits down&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av sits down, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av gets up, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_UNSIT_TIMEOUT = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
integer gSitting = FALSE;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                gSitting = TRUE;&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gSitting)&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up - it was sitting and now isn&#039;t ...&lt;br /&gt;
                gSitting = FALSE;&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    // Want to derez straight away&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_UNSIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Could be unlinking going on&lt;br /&gt;
                // or maybe there is another sit target in a linked prim&lt;br /&gt;
                // that someone has just sat on or vacated&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;
== Timer Action Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Basic timer-driven state changing script.&lt;br /&gt;
// NB: Does not use the LSL ability to define&lt;br /&gt;
// states, but uses a counter to manage a simple&lt;br /&gt;
// incrementing state machine.&lt;br /&gt;
//&lt;br /&gt;
//  Every time interval, it will change its record of state&lt;br /&gt;
//  and you can add code to do something, then it will move&lt;br /&gt;
//  to the next state.&lt;br /&gt;
//&lt;br /&gt;
//  To add more things, just add more&lt;br /&gt;
//        else if (gState == 4)&lt;br /&gt;
//        {&lt;br /&gt;
//            // and the next&lt;br /&gt;
//        }&lt;br /&gt;
//  statements in the appropriate place.&lt;br /&gt;
//&lt;br /&gt;
// If you want the timer interval to be different for different&lt;br /&gt;
// states, then you could add more llSetTimerEvent() calls&lt;br /&gt;
// in each state to set the timer for the next one.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2012&lt;br /&gt;
 &lt;br /&gt;
// Timer interval in seconds&lt;br /&gt;
float TIMER_INTERVAL = 5.0;&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState ++;&lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            // Do the first thing here&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 2)&lt;br /&gt;
        {&lt;br /&gt;
            // After the timer interval this is next&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 3)&lt;br /&gt;
        {&lt;br /&gt;
            // and the next&lt;br /&gt;
        }&lt;br /&gt;
        // add more else if () statements here&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Once all states are complete, reset the counter ready for the next time&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multiple Notecard Reading Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example showing multiple notecard reading.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Oct 2012&lt;br /&gt;
&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
integer gNCNumber;&lt;br /&gt;
string   gNCName;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gNCNumber = 0;&lt;br /&gt;
        gNCLine = 0;&lt;br /&gt;
        gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
        if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Note: If the notecard contains embedded objects (like scripts, landmarks, etc)&lt;br /&gt;
        // then EOF is returned - so this will move onto the next one as if the notecard&lt;br /&gt;
        // was empty.&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // Move to the next notecard&lt;br /&gt;
            gNCNumber++;&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
            if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
                gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Complete&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // Wait for the next line to be read&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Do something with the notecard line&lt;br /&gt;
        // Note: Only get first 255 characters of each line&lt;br /&gt;
        llOwnerSay (data);&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(gNCName, gNCLine);&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Alarm Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple script to trigger at a certain time and perform a function,&lt;br /&gt;
// in the default case send an IM to the specified avatar&lt;br /&gt;
//&lt;br /&gt;
// Notes&lt;br /&gt;
// Can specify a time in GMT (ie no seasonal changes) or SLT&lt;br /&gt;
// Uses 24 hour times&lt;br /&gt;
// Can include touch control if required&lt;br /&gt;
// Sends the specified message to the specified UUID &lt;br /&gt;
//&lt;br /&gt;
// If you want it to do something else, code it in the alarm() function&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2012&lt;br /&gt;
// http://kimmscripts.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
integer gHour = 7;  // 24 hour clock&lt;br /&gt;
integer gMin = 30;&lt;br /&gt;
integer gSec = 0;&lt;br /&gt;
integer gGMT = TRUE;   // GMT or SL time&lt;br /&gt;
integer gTouchControl = TRUE;&lt;br /&gt;
string gMsg = &amp;quot;Wake up!&amp;quot;;&lt;br /&gt;
key gAv = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer gArmed;&lt;br /&gt;
&lt;br /&gt;
setAlarm ()&lt;br /&gt;
{&lt;br /&gt;
    // set a timer event for destination time - current time&lt;br /&gt;
    float desttime = (float)(gHour*60*60 + gMin*60 + gSec);&lt;br /&gt;
&lt;br /&gt;
    // This is the number of seconds since midnight&lt;br /&gt;
    // so the required setting until the destination time&lt;br /&gt;
    // will depend on if the time is in the past or not.&lt;br /&gt;
    // If we happen to get lucky and &lt;br /&gt;
    float nowtime = llGetWallclock ();&lt;br /&gt;
    if (gGMT)&lt;br /&gt;
    {&lt;br /&gt;
        nowtime = llGetGMTclock ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (nowtime &amp;gt;= desttime)&lt;br /&gt;
    {&lt;br /&gt;
        // Need to add 24 hours before subtracting&lt;br /&gt;
        desttime = desttime + 24.0*60.0*60.0;&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableAlarm()&lt;br /&gt;
{&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// This is what happens on the alarm&lt;br /&gt;
alarm ()&lt;br /&gt;
{&lt;br /&gt;
    //llOwnerSay (&amp;quot;Alarm&amp;quot;);&lt;br /&gt;
    llInstantMessage (gAv, gMsg);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string zone = &amp;quot; SLT&amp;quot;;&lt;br /&gt;
        if (gGMT)&lt;br /&gt;
        {&lt;br /&gt;
            zone = &amp;quot; GMT&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        llOwnerSay (&amp;quot;Alarm set for &amp;quot; + (string)gHour + &amp;quot; h &amp;quot; + (string)gMin + &amp;quot; m&amp;quot; + (string)gSec + &amp;quot; s &amp;quot; + zone);&lt;br /&gt;
        gArmed = TRUE;&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gArmed)&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = FALSE;&lt;br /&gt;
                disableAlarm();&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = TRUE;&lt;br /&gt;
                setAlarm();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        alarm();&lt;br /&gt;
        // Reset alarm each time, to allow for any drift in time&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Channel Relay ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple relay script.  Listens on one channel and relays&lt;br /&gt;
// everything to the another channel.&lt;br /&gt;
//&lt;br /&gt;
// Can be useful for testing things - e.g. if you are listening&lt;br /&gt;
// on a negative channel in your main script and want a way&lt;br /&gt;
// to send it test strings, you could drop this in a nearby&lt;br /&gt;
// prim and have it listen on a chat channel and pass the messages&lt;br /&gt;
// onto your prim under test.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Nov 2012&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel = 88;&lt;br /&gt;
integer gSpeakChannel = -88;&lt;br /&gt;
&lt;br /&gt;
relayMessage (string message)&lt;br /&gt;
{&lt;br /&gt;
    // Only use one of these as required:&lt;br /&gt;
    // whisper = &amp;lt;10m; say = 20m; shout &amp;gt; 20m; region = whole region&lt;br /&gt;
&lt;br /&gt;
    //llWhisper (gSpeakChannel, message);&lt;br /&gt;
    llSay (gSpeakChannel, message);&lt;br /&gt;
    //llShout (gSpeakChannel, message);&lt;br /&gt;
    //llRegionSay (gSpeakChannel, message);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        llListen (gListenChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            relayMessage (message);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTTP Server and Client Example ==&lt;br /&gt;
&lt;br /&gt;
These two scripts can be used (once you&#039;ve hard-coded in the right URL into the client script) to highlight basic prim to prim communications using HTTP without requiring an external server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Very, very simple HTTP server test script, as seen on&lt;br /&gt;
// http://wiki.secondlife.com/wiki/LSL_http_server/examples&lt;br /&gt;
//&lt;br /&gt;
// Note: It gets a new public URL each time it runs or&lt;br /&gt;
// when the object moves Sims ...&lt;br /&gt;
//&lt;br /&gt;
// So, you&#039;ll need to update the URL used by any client objects,&lt;br /&gt;
// or use some kind of dynamic URL service - there are some around&lt;br /&gt;
// on the Internet - search/read about HTTP-in&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2009&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;URL: &amp;quot; + body);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Handling Response ...&amp;quot;);&lt;br /&gt;
            llHTTPResponse(id,200,&amp;quot;Hello From Kimm&#039;s HTTP Test&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// HTTP Test.  This will request the contents of the specified&lt;br /&gt;
// URL.  The idea is that the URL is provided by a companion object&lt;br /&gt;
// in SL.  Note that the URL created by the llRequestURL call changes&lt;br /&gt;
// when the server object is rezzed or moves sims though ...&lt;br /&gt;
//&lt;br /&gt;
// There are some services on the Net that provide a semi-permanent&lt;br /&gt;
// URL for use with HTTP-in like this though ...&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2009&lt;br /&gt;
&lt;br /&gt;
string URL = &amp;quot;past in your URL from the server script here&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;
        llHTTPRequest (URL, [HTTP_METHOD, &amp;quot;GET&amp;quot;], &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_response(key id, integer status, list meta, string body)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (PUBLIC_CHANNEL, &amp;quot;Response: &amp;quot; + (string)body);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTTP POST Client and Server Example ==&lt;br /&gt;
&lt;br /&gt;
This is similar to the above pair of scripts, but uses HTTP POST to send a message from the client to the server.  The message is entered using a text box.  It also uses the text box to enter in the server&#039;s URL when it first starts up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Very, very simple HTTP server test script, as seen on&lt;br /&gt;
// http://wiki.secondlife.com/wiki/LSL_http_server/examples&lt;br /&gt;
//&lt;br /&gt;
// but configured to accept and display what gets sent to&lt;br /&gt;
// it via a POST request.&lt;br /&gt;
//&lt;br /&gt;
// Note: It gets a new public URL each time it runs or&lt;br /&gt;
// when the object moves Sims ...&lt;br /&gt;
//&lt;br /&gt;
// So, you&#039;ll need to update the URL used by any client objects,&lt;br /&gt;
// or use some kind of dynamic URL service - there are some around&lt;br /&gt;
// on the Internet - search/read about HTTP-in.&lt;br /&gt;
//&lt;br /&gt;
// Also, as this is a demo script, it doesn&#039;t do things like clean&lt;br /&gt;
// up URLs and so on - see the wikis for details.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2012&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;URL: &amp;quot; + body);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Handling Response ...&amp;quot;);&lt;br /&gt;
            llHTTPResponse(id,200,&amp;quot;Post me something and I&#039;ll display it ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;POST&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Received: &amp;quot; + body);&lt;br /&gt;
            llHTTPResponse (id, 200, &amp;quot;&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the client ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// HTTP Test.  This will POST a message to the specified&lt;br /&gt;
// gUrl.  The idea is that the gUrl is provided by a companion object&lt;br /&gt;
// in SL.  Note that the gUrl created by the llHRequestgUrl call changes&lt;br /&gt;
// when the server object is rezzed or moves sims though ...&lt;br /&gt;
//&lt;br /&gt;
// There are some services on the Net that provide a semi-permanent&lt;br /&gt;
// gUrl for use with HTTP-in like this though ...&lt;br /&gt;
//&lt;br /&gt;
// The message is entered using a textbox on touch.  When the script&lt;br /&gt;
// first starts up, you need to paste in the URL of the server prim&lt;br /&gt;
// using the same text box.&lt;br /&gt;
//&lt;br /&gt;
// This is just a demo script.  You&#039;ll need to do proper listen and&lt;br /&gt;
// channel handling and so on.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2012&lt;br /&gt;
&lt;br /&gt;
string gUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer randChannel ()&lt;br /&gt;
{&lt;br /&gt;
	// Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
	// Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
	// Always leaves sign bit unset (so is always positive)&lt;br /&gt;
	integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gChannel = randChannel();&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);    // Uses simplest and laggiest form of listen/channel handling&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gUrl == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llTextBox (llDetectedKey (0), &amp;quot;Paste in the URL from the server prim and click submit&amp;quot;, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llTextBox (llDetectedKey (0), &amp;quot;Type in your message to send to the HTTP server&amp;quot;, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (llSubStringIndex (message, &amp;quot;http://&amp;quot;) == 0)&lt;br /&gt;
        {&lt;br /&gt;
            // this is a new gUrl ...&lt;br /&gt;
            gUrl = message;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llHTTPRequest (gUrl, [HTTP_METHOD, &amp;quot;POST&amp;quot;], message);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;You need to provide the URL of the server prim before sending any messages&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_response(key id, integer status, list meta, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (body != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llWhisper (PUBLIC_CHANNEL, &amp;quot;Response: &amp;quot; + (string)body);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1174528</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1174528"/>
		<updated>2012-11-16T22:00:10Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up&lt;br /&gt;
// or derez a defined time after they unsit.&lt;br /&gt;
//&lt;br /&gt;
// Note: It doesn&#039;t unsit any other avatars sitting on other&lt;br /&gt;
// prims prior to derezzing, but derezzing will unsit them anyway!&lt;br /&gt;
//&lt;br /&gt;
// It will also (optionally) automatically derez itself after a specified&lt;br /&gt;
// time if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
// TRUE if want to immediately auto derez when av gets up.&lt;br /&gt;
// (overrides DEREZ_AFTER_UNSIT_TIMEOUT)&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Time to derez if noone sits down&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av sits down, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av gets up, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_UNSIT_TIMEOUT = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
integer gSitting = FALSE;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                gSitting = TRUE;&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gSitting)&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up - it was sitting and now isn&#039;t ...&lt;br /&gt;
                gSitting = FALSE;&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    // Want to derez straight away&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_UNSIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Could be unlinking going on&lt;br /&gt;
                // or maybe there is another sit target in a linked prim&lt;br /&gt;
                // that someone has just sat on or vacated&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;
== Timer Action Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Basic timer-driven state changing script.&lt;br /&gt;
// NB: Does not use the LSL ability to define&lt;br /&gt;
// states, but uses a counter to manage a simple&lt;br /&gt;
// incrementing state machine.&lt;br /&gt;
//&lt;br /&gt;
//  Every time interval, it will change its record of state&lt;br /&gt;
//  and you can add code to do something, then it will move&lt;br /&gt;
//  to the next state.&lt;br /&gt;
//&lt;br /&gt;
//  To add more things, just add more&lt;br /&gt;
//        else if (gState == 4)&lt;br /&gt;
//        {&lt;br /&gt;
//            // and the next&lt;br /&gt;
//        }&lt;br /&gt;
//  statements in the appropriate place.&lt;br /&gt;
//&lt;br /&gt;
// If you want the timer interval to be different for different&lt;br /&gt;
// states, then you could add more llSetTimerEvent() calls&lt;br /&gt;
// in each state to set the timer for the next one.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2012&lt;br /&gt;
 &lt;br /&gt;
// Timer interval in seconds&lt;br /&gt;
float TIMER_INTERVAL = 5.0;&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState ++;&lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            // Do the first thing here&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 2)&lt;br /&gt;
        {&lt;br /&gt;
            // After the timer interval this is next&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 3)&lt;br /&gt;
        {&lt;br /&gt;
            // and the next&lt;br /&gt;
        }&lt;br /&gt;
        // add more else if () statements here&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Once all states are complete, reset the counter ready for the next time&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multiple Notecard Reading Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example showing multiple notecard reading.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Oct 2012&lt;br /&gt;
&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
integer gNCNumber;&lt;br /&gt;
string   gNCName;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gNCNumber = 0;&lt;br /&gt;
        gNCLine = 0;&lt;br /&gt;
        gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
        if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Note: If the notecard contains embedded objects (like scripts, landmarks, etc)&lt;br /&gt;
        // then EOF is returned - so this will move onto the next one as if the notecard&lt;br /&gt;
        // was empty.&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // Move to the next notecard&lt;br /&gt;
            gNCNumber++;&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
            if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
                gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Complete&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // Wait for the next line to be read&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Do something with the notecard line&lt;br /&gt;
        // Note: Only get first 255 characters of each line&lt;br /&gt;
        llOwnerSay (data);&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(gNCName, gNCLine);&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Alarm Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple script to trigger at a certain time and perform a function,&lt;br /&gt;
// in the default case send an IM to the specified avatar&lt;br /&gt;
//&lt;br /&gt;
// Notes&lt;br /&gt;
// Can specify a time in GMT (ie no seasonal changes) or SLT&lt;br /&gt;
// Uses 24 hour times&lt;br /&gt;
// Can include touch control if required&lt;br /&gt;
// Sends the specified message to the specified UUID &lt;br /&gt;
//&lt;br /&gt;
// If you want it to do something else, code it in the alarm() function&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2012&lt;br /&gt;
// http://kimmscripts.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
integer gHour = 7;  // 24 hour clock&lt;br /&gt;
integer gMin = 30;&lt;br /&gt;
integer gSec = 0;&lt;br /&gt;
integer gGMT = TRUE;   // GMT or SL time&lt;br /&gt;
integer gTouchControl = TRUE;&lt;br /&gt;
string gMsg = &amp;quot;Wake up!&amp;quot;;&lt;br /&gt;
key gAv = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer gArmed;&lt;br /&gt;
&lt;br /&gt;
setAlarm ()&lt;br /&gt;
{&lt;br /&gt;
    // set a timer event for destination time - current time&lt;br /&gt;
    float desttime = (float)(gHour*60*60 + gMin*60 + gSec);&lt;br /&gt;
&lt;br /&gt;
    // This is the number of seconds since midnight&lt;br /&gt;
    // so the required setting until the destination time&lt;br /&gt;
    // will depend on if the time is in the past or not.&lt;br /&gt;
    // If we happen to get lucky and &lt;br /&gt;
    float nowtime = llGetWallclock ();&lt;br /&gt;
    if (gGMT)&lt;br /&gt;
    {&lt;br /&gt;
        nowtime = llGetGMTclock ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (nowtime &amp;gt;= desttime)&lt;br /&gt;
    {&lt;br /&gt;
        // Need to add 24 hours before subtracting&lt;br /&gt;
        desttime = desttime + 24.0*60.0*60.0;&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableAlarm()&lt;br /&gt;
{&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// This is what happens on the alarm&lt;br /&gt;
alarm ()&lt;br /&gt;
{&lt;br /&gt;
    //llOwnerSay (&amp;quot;Alarm&amp;quot;);&lt;br /&gt;
    llInstantMessage (gAv, gMsg);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string zone = &amp;quot; SLT&amp;quot;;&lt;br /&gt;
        if (gGMT)&lt;br /&gt;
        {&lt;br /&gt;
            zone = &amp;quot; GMT&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        llOwnerSay (&amp;quot;Alarm set for &amp;quot; + (string)gHour + &amp;quot; h &amp;quot; + (string)gMin + &amp;quot; m&amp;quot; + (string)gSec + &amp;quot; s &amp;quot; + zone);&lt;br /&gt;
        gArmed = TRUE;&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gArmed)&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = FALSE;&lt;br /&gt;
                disableAlarm();&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = TRUE;&lt;br /&gt;
                setAlarm();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        alarm();&lt;br /&gt;
        // Reset alarm each time, to allow for any drift in time&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Channel Relay ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple relay script.  Listens on one channel and relays&lt;br /&gt;
// everything to the another channel.&lt;br /&gt;
//&lt;br /&gt;
// Can be useful for testing things - e.g. if you are listening&lt;br /&gt;
// on a negative channel in your main script and want a way&lt;br /&gt;
// to send it test strings, you could drop this in a nearby&lt;br /&gt;
// prim and have it listen on a chat channel and pass the messages&lt;br /&gt;
// onto your prim under test.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Nov 2012&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel = 88;&lt;br /&gt;
integer gSpeakChannel = -88;&lt;br /&gt;
&lt;br /&gt;
relayMessage (string message)&lt;br /&gt;
{&lt;br /&gt;
    // Only use one of these as required:&lt;br /&gt;
    // whisper = &amp;lt;10m; say = 20m; shout &amp;gt; 20m; region = whole region&lt;br /&gt;
&lt;br /&gt;
    //llWhisper (gSpeakChannel, message);&lt;br /&gt;
    llSay (gSpeakChannel, message);&lt;br /&gt;
    //llShout (gSpeakChannel, message);&lt;br /&gt;
    //llRegionSay (gSpeakChannel, message);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        llListen (gListenChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            relayMessage (message);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTTP Server and Client Example ==&lt;br /&gt;
&lt;br /&gt;
These two scripts can be used (once you&#039;ve hard-coded in the right URL into the client script) to highlight basic prim to prim communications using HTTP without requiring an external server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Very, very simple HTTP server test script, as seen on&lt;br /&gt;
// http://wiki.secondlife.com/wiki/LSL_http_server/examples&lt;br /&gt;
//&lt;br /&gt;
// Note: It gets a new public URL each time it runs or&lt;br /&gt;
// when the object moves Sims ...&lt;br /&gt;
//&lt;br /&gt;
// So, you&#039;ll need to update the URL used by any client objects,&lt;br /&gt;
// or use some kind of dynamic URL service - there are some around&lt;br /&gt;
// on the Internet - search/read about HTTP-in&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2009&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;URL: &amp;quot; + body);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Handling Response ...&amp;quot;);&lt;br /&gt;
            llHTTPResponse(id,200,&amp;quot;Hello From Kimm&#039;s HTTP Test&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// HTTP Test.  This will request the contents of the specified&lt;br /&gt;
// URL.  The idea is that the URL is provided by a companion object&lt;br /&gt;
// in SL.  Note that the URL created by the llRequestURL call changes&lt;br /&gt;
// when the server object is rezzed or moves sims though ...&lt;br /&gt;
//&lt;br /&gt;
// There are some services on the Net that provide a semi-permanent&lt;br /&gt;
// URL for use with HTTP-in like this though ...&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Nov 2009&lt;br /&gt;
&lt;br /&gt;
string URL = &amp;quot;past in your URL from the server script here&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;
        llHTTPRequest (URL, [HTTP_METHOD, &amp;quot;GET&amp;quot;], &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_response(key id, integer status, list meta, string body)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (PUBLIC_CHANNEL, &amp;quot;Response: &amp;quot; + (string)body);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1174257</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1174257"/>
		<updated>2012-11-05T21:13:15Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Added my quick channel relay script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up&lt;br /&gt;
// or derez a defined time after they unsit.&lt;br /&gt;
//&lt;br /&gt;
// Note: It doesn&#039;t unsit any other avatars sitting on other&lt;br /&gt;
// prims prior to derezzing, but derezzing will unsit them anyway!&lt;br /&gt;
//&lt;br /&gt;
// It will also (optionally) automatically derez itself after a specified&lt;br /&gt;
// time if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
// TRUE if want to immediately auto derez when av gets up.&lt;br /&gt;
// (overrides DEREZ_AFTER_UNSIT_TIMEOUT)&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Time to derez if noone sits down&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av sits down, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av gets up, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_UNSIT_TIMEOUT = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
integer gSitting = FALSE;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                gSitting = TRUE;&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gSitting)&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up - it was sitting and now isn&#039;t ...&lt;br /&gt;
                gSitting = FALSE;&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    // Want to derez straight away&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_UNSIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Could be unlinking going on&lt;br /&gt;
                // or maybe there is another sit target in a linked prim&lt;br /&gt;
                // that someone has just sat on or vacated&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;
== Timer Action Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Basic timer-driven state changing script.&lt;br /&gt;
// NB: Does not use the LSL ability to define&lt;br /&gt;
// states, but uses a counter to manage a simple&lt;br /&gt;
// incrementing state machine.&lt;br /&gt;
//&lt;br /&gt;
//  Every time interval, it will change its record of state&lt;br /&gt;
//  and you can add code to do something, then it will move&lt;br /&gt;
//  to the next state.&lt;br /&gt;
//&lt;br /&gt;
//  To add more things, just add more&lt;br /&gt;
//        else if (gState == 4)&lt;br /&gt;
//        {&lt;br /&gt;
//            // and the next&lt;br /&gt;
//        }&lt;br /&gt;
//  statements in the appropriate place.&lt;br /&gt;
//&lt;br /&gt;
// If you want the timer interval to be different for different&lt;br /&gt;
// states, then you could add more llSetTimerEvent() calls&lt;br /&gt;
// in each state to set the timer for the next one.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2012&lt;br /&gt;
 &lt;br /&gt;
// Timer interval in seconds&lt;br /&gt;
float TIMER_INTERVAL = 5.0;&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState ++;&lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            // Do the first thing here&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 2)&lt;br /&gt;
        {&lt;br /&gt;
            // After the timer interval this is next&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 3)&lt;br /&gt;
        {&lt;br /&gt;
            // and the next&lt;br /&gt;
        }&lt;br /&gt;
        // add more else if () statements here&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Once all states are complete, reset the counter ready for the next time&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multiple Notecard Reading Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example showing multiple notecard reading.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Oct 2012&lt;br /&gt;
&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
integer gNCNumber;&lt;br /&gt;
string   gNCName;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gNCNumber = 0;&lt;br /&gt;
        gNCLine = 0;&lt;br /&gt;
        gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
        if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Note: If the notecard contains embedded objects (like scripts, landmarks, etc)&lt;br /&gt;
        // then EOF is returned - so this will move onto the next one as if the notecard&lt;br /&gt;
        // was empty.&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // Move to the next notecard&lt;br /&gt;
            gNCNumber++;&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
            if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
                gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Complete&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // Wait for the next line to be read&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Do something with the notecard line&lt;br /&gt;
        // Note: Only get first 255 characters of each line&lt;br /&gt;
        llOwnerSay (data);&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(gNCName, gNCLine);&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Alarm Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple script to trigger at a certain time and perform a function,&lt;br /&gt;
// in the default case send an IM to the specified avatar&lt;br /&gt;
//&lt;br /&gt;
// Notes&lt;br /&gt;
// Can specify a time in GMT (ie no seasonal changes) or SLT&lt;br /&gt;
// Uses 24 hour times&lt;br /&gt;
// Can include touch control if required&lt;br /&gt;
// Sends the specified message to the specified UUID &lt;br /&gt;
//&lt;br /&gt;
// If you want it to do something else, code it in the alarm() function&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2012&lt;br /&gt;
// http://kimmscripts.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
integer gHour = 7;  // 24 hour clock&lt;br /&gt;
integer gMin = 30;&lt;br /&gt;
integer gSec = 0;&lt;br /&gt;
integer gGMT = TRUE;   // GMT or SL time&lt;br /&gt;
integer gTouchControl = TRUE;&lt;br /&gt;
string gMsg = &amp;quot;Wake up!&amp;quot;;&lt;br /&gt;
key gAv = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer gArmed;&lt;br /&gt;
&lt;br /&gt;
setAlarm ()&lt;br /&gt;
{&lt;br /&gt;
    // set a timer event for destination time - current time&lt;br /&gt;
    float desttime = (float)(gHour*60*60 + gMin*60 + gSec);&lt;br /&gt;
&lt;br /&gt;
    // This is the number of seconds since midnight&lt;br /&gt;
    // so the required setting until the destination time&lt;br /&gt;
    // will depend on if the time is in the past or not.&lt;br /&gt;
    // If we happen to get lucky and &lt;br /&gt;
    float nowtime = llGetWallclock ();&lt;br /&gt;
    if (gGMT)&lt;br /&gt;
    {&lt;br /&gt;
        nowtime = llGetGMTclock ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (nowtime &amp;gt;= desttime)&lt;br /&gt;
    {&lt;br /&gt;
        // Need to add 24 hours before subtracting&lt;br /&gt;
        desttime = desttime + 24.0*60.0*60.0;&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableAlarm()&lt;br /&gt;
{&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// This is what happens on the alarm&lt;br /&gt;
alarm ()&lt;br /&gt;
{&lt;br /&gt;
    //llOwnerSay (&amp;quot;Alarm&amp;quot;);&lt;br /&gt;
    llInstantMessage (gAv, gMsg);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string zone = &amp;quot; SLT&amp;quot;;&lt;br /&gt;
        if (gGMT)&lt;br /&gt;
        {&lt;br /&gt;
            zone = &amp;quot; GMT&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        llOwnerSay (&amp;quot;Alarm set for &amp;quot; + (string)gHour + &amp;quot; h &amp;quot; + (string)gMin + &amp;quot; m&amp;quot; + (string)gSec + &amp;quot; s &amp;quot; + zone);&lt;br /&gt;
        gArmed = TRUE;&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gArmed)&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = FALSE;&lt;br /&gt;
                disableAlarm();&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = TRUE;&lt;br /&gt;
                setAlarm();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        alarm();&lt;br /&gt;
        // Reset alarm each time, to allow for any drift in time&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Channel Relay ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple relay script.  Listens on one channel and relays&lt;br /&gt;
// everything to the another channel.&lt;br /&gt;
//&lt;br /&gt;
// Can be useful for testing things - e.g. if you are listening&lt;br /&gt;
// on a negative channel in your main script and want a way&lt;br /&gt;
// to send it test strings, you could drop this in a nearby&lt;br /&gt;
// prim and have it listen on a chat channel and pass the messages&lt;br /&gt;
// onto your prim under test.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Nov 2012&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel = 88;&lt;br /&gt;
integer gSpeakChannel = -88;&lt;br /&gt;
&lt;br /&gt;
relayMessage (string message)&lt;br /&gt;
{&lt;br /&gt;
    // Only use one of these as required:&lt;br /&gt;
    // whisper = &amp;lt;10m; say = 20m; shout &amp;gt; 20m; region = whole region&lt;br /&gt;
&lt;br /&gt;
    //llWhisper (gSpeakChannel, message);&lt;br /&gt;
    llSay (gSpeakChannel, message);&lt;br /&gt;
    //llShout (gSpeakChannel, message);&lt;br /&gt;
    //llRegionSay (gSpeakChannel, message);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        llListen (gListenChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            relayMessage (message);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1173821</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1173821"/>
		<updated>2012-10-22T19:26:25Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up&lt;br /&gt;
// or derez a defined time after they unsit.&lt;br /&gt;
//&lt;br /&gt;
// Note: It doesn&#039;t unsit any other avatars sitting on other&lt;br /&gt;
// prims prior to derezzing, but derezzing will unsit them anyway!&lt;br /&gt;
//&lt;br /&gt;
// It will also (optionally) automatically derez itself after a specified&lt;br /&gt;
// time if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
// TRUE if want to immediately auto derez when av gets up.&lt;br /&gt;
// (overrides DEREZ_AFTER_UNSIT_TIMEOUT)&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Time to derez if noone sits down&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av sits down, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av gets up, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_UNSIT_TIMEOUT = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
integer gSitting = FALSE;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                gSitting = TRUE;&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gSitting)&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up - it was sitting and now isn&#039;t ...&lt;br /&gt;
                gSitting = FALSE;&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    // Want to derez straight away&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_UNSIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Could be unlinking going on&lt;br /&gt;
                // or maybe there is another sit target in a linked prim&lt;br /&gt;
                // that someone has just sat on or vacated&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;
== Timer Action Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Basic timer-driven state changing script.&lt;br /&gt;
// NB: Does not use the LSL ability to define&lt;br /&gt;
// states, but uses a counter to manage a simple&lt;br /&gt;
// incrementing state machine.&lt;br /&gt;
//&lt;br /&gt;
//  Every time interval, it will change its record of state&lt;br /&gt;
//  and you can add code to do something, then it will move&lt;br /&gt;
//  to the next state.&lt;br /&gt;
//&lt;br /&gt;
//  To add more things, just add more&lt;br /&gt;
//        else if (gState == 4)&lt;br /&gt;
//        {&lt;br /&gt;
//            // and the next&lt;br /&gt;
//        }&lt;br /&gt;
//  statements in the appropriate place.&lt;br /&gt;
//&lt;br /&gt;
// If you want the timer interval to be different for different&lt;br /&gt;
// states, then you could add more llSetTimerEvent() calls&lt;br /&gt;
// in each state to set the timer for the next one.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2012&lt;br /&gt;
 &lt;br /&gt;
// Timer interval in seconds&lt;br /&gt;
float TIMER_INTERVAL = 5.0;&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState ++;&lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            // Do the first thing here&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 2)&lt;br /&gt;
        {&lt;br /&gt;
            // After the timer interval this is next&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 3)&lt;br /&gt;
        {&lt;br /&gt;
            // and the next&lt;br /&gt;
        }&lt;br /&gt;
        // add more else if () statements here&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Once all states are complete, reset the counter ready for the next time&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multiple Notecard Reading Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example showing multiple notecard reading.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Oct 2012&lt;br /&gt;
&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
integer gNCNumber;&lt;br /&gt;
string   gNCName;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gNCNumber = 0;&lt;br /&gt;
        gNCLine = 0;&lt;br /&gt;
        gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
        if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Note: If the notecard contains embedded objects (like scripts, landmarks, etc)&lt;br /&gt;
        // then EOF is returned - so this will move onto the next one as if the notecard&lt;br /&gt;
        // was empty.&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // Move to the next notecard&lt;br /&gt;
            gNCNumber++;&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
            if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
                gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Complete&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // Wait for the next line to be read&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Do something with the notecard line&lt;br /&gt;
        // Note: Only get first 255 characters of each line&lt;br /&gt;
        llOwnerSay (data);&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(gNCName, gNCLine);&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Alarm Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple script to trigger at a certain time and perform a function,&lt;br /&gt;
// in the default case send an IM to the specified avatar&lt;br /&gt;
//&lt;br /&gt;
// Notes&lt;br /&gt;
// Can specify a time in GMT (ie no seasonal changes) or SLT&lt;br /&gt;
// Uses 24 hour times&lt;br /&gt;
// Can include touch control if required&lt;br /&gt;
// Sends the specified message to the specified UUID &lt;br /&gt;
//&lt;br /&gt;
// If you want it to do something else, code it in the alarm() function&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2012&lt;br /&gt;
// http://kimmscripts.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
integer gHour = 7;  // 24 hour clock&lt;br /&gt;
integer gMin = 30;&lt;br /&gt;
integer gSec = 0;&lt;br /&gt;
integer gGMT = TRUE;   // GMT or SL time&lt;br /&gt;
integer gTouchControl = TRUE;&lt;br /&gt;
string gMsg = &amp;quot;Wake up!&amp;quot;;&lt;br /&gt;
key gAv = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer gArmed;&lt;br /&gt;
&lt;br /&gt;
setAlarm ()&lt;br /&gt;
{&lt;br /&gt;
    // set a timer event for destination time - current time&lt;br /&gt;
    float desttime = (float)(gHour*60*60 + gMin*60 + gSec);&lt;br /&gt;
&lt;br /&gt;
    // This is the number of seconds since midnight&lt;br /&gt;
    // so the required setting until the destination time&lt;br /&gt;
    // will depend on if the time is in the past or not.&lt;br /&gt;
    // If we happen to get lucky and &lt;br /&gt;
    float nowtime = llGetWallclock ();&lt;br /&gt;
    if (gGMT)&lt;br /&gt;
    {&lt;br /&gt;
        nowtime = llGetGMTclock ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (nowtime &amp;gt;= desttime)&lt;br /&gt;
    {&lt;br /&gt;
        // Need to add 24 hours before subtracting&lt;br /&gt;
        desttime = desttime + 24.0*60.0*60.0;&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Dest: &amp;quot; + (string)desttime + &amp;quot; Now: &amp;quot; + (string)nowtime);&lt;br /&gt;
        llSetTimerEvent (desttime - nowtime);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableAlarm()&lt;br /&gt;
{&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// This is what happens on the alarm&lt;br /&gt;
alarm ()&lt;br /&gt;
{&lt;br /&gt;
    //llOwnerSay (&amp;quot;Alarm&amp;quot;);&lt;br /&gt;
    llInstantMessage (gAv, gMsg);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string zone = &amp;quot; SLT&amp;quot;;&lt;br /&gt;
        if (gGMT)&lt;br /&gt;
        {&lt;br /&gt;
            zone = &amp;quot; GMT&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        llOwnerSay (&amp;quot;Alarm set for &amp;quot; + (string)gHour + &amp;quot; h &amp;quot; + (string)gMin + &amp;quot; m&amp;quot; + (string)gSec + &amp;quot; s &amp;quot; + zone);&lt;br /&gt;
        gArmed = TRUE;&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gArmed)&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = FALSE;&lt;br /&gt;
                disableAlarm();&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gArmed = TRUE;&lt;br /&gt;
                setAlarm();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        alarm();&lt;br /&gt;
        // Reset alarm each time, to allow for any drift in time&lt;br /&gt;
        setAlarm();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1173067</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1173067"/>
		<updated>2012-10-04T21:50:47Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* (soon) */  Added example multiple-notecard reader template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up&lt;br /&gt;
// or derez a defined time after they unsit.&lt;br /&gt;
//&lt;br /&gt;
// Note: It doesn&#039;t unsit any other avatars sitting on other&lt;br /&gt;
// prims prior to derezzing, but derezzing will unsit them anyway!&lt;br /&gt;
//&lt;br /&gt;
// It will also (optionally) automatically derez itself after a specified&lt;br /&gt;
// time if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
// TRUE if want to immediately auto derez when av gets up.&lt;br /&gt;
// (overrides DEREZ_AFTER_UNSIT_TIMEOUT)&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Time to derez if noone sits down&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av sits down, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av gets up, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_UNSIT_TIMEOUT = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
integer gSitting = FALSE;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                gSitting = TRUE;&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gSitting)&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up - it was sitting and now isn&#039;t ...&lt;br /&gt;
                gSitting = FALSE;&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    // Want to derez straight away&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_UNSIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Could be unlinking going on&lt;br /&gt;
                // or maybe there is another sit target in a linked prim&lt;br /&gt;
                // that someone has just sat on or vacated&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;
== Timer Action Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Basic timer-driven state changing script.&lt;br /&gt;
// NB: Does not use the LSL ability to define&lt;br /&gt;
// states, but uses a counter to manage a simple&lt;br /&gt;
// incrementing state machine.&lt;br /&gt;
//&lt;br /&gt;
//  Every time interval, it will change its record of state&lt;br /&gt;
//  and you can add code to do something, then it will move&lt;br /&gt;
//  to the next state.&lt;br /&gt;
//&lt;br /&gt;
//  To add more things, just add more&lt;br /&gt;
//        else if (gState == 4)&lt;br /&gt;
//        {&lt;br /&gt;
//            // and the next&lt;br /&gt;
//        }&lt;br /&gt;
//  statements in the appropriate place.&lt;br /&gt;
//&lt;br /&gt;
// If you want the timer interval to be different for different&lt;br /&gt;
// states, then you could add more llSetTimerEvent() calls&lt;br /&gt;
// in each state to set the timer for the next one.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2012&lt;br /&gt;
 &lt;br /&gt;
// Timer interval in seconds&lt;br /&gt;
float TIMER_INTERVAL = 5.0;&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState ++;&lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            // Do the first thing here&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 2)&lt;br /&gt;
        {&lt;br /&gt;
            // After the timer interval this is next&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 3)&lt;br /&gt;
        {&lt;br /&gt;
            // and the next&lt;br /&gt;
        }&lt;br /&gt;
        // add more else if () statements here&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Once all states are complete, reset the counter ready for the next time&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multiple Notecard Reading Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example showing multiple notecard reading.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Oct 2012&lt;br /&gt;
&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
integer gNCNumber;&lt;br /&gt;
string   gNCName;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gNCNumber = 0;&lt;br /&gt;
        gNCLine = 0;&lt;br /&gt;
        gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
        if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Note: If the notecard contains embedded objects (like scripts, landmarks, etc)&lt;br /&gt;
        // then EOF is returned - so this will move onto the next one as if the notecard&lt;br /&gt;
        // was empty.&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // Move to the next notecard&lt;br /&gt;
            gNCNumber++;&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCName = llGetInventoryName (INVENTORY_NOTECARD, gNCNumber);&lt;br /&gt;
            if (gNCName != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Reading notecard &amp;quot; + gNCName + &amp;quot; (&amp;quot; + (string)gNCNumber + &amp;quot;)&amp;quot;);&lt;br /&gt;
                gNCQueryId = llGetNotecardLine (gNCName, gNCLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;=== Complete&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // Wait for the next line to be read&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Do something with the notecard line&lt;br /&gt;
        // Note: Only get first 255 characters of each line&lt;br /&gt;
        llOwnerSay (data);&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(gNCName, gNCLine);&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1172669</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1172669"/>
		<updated>2012-09-14T20:47:20Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Added template timer script (written to illustrate adding timer code to a script for someone)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up&lt;br /&gt;
// or derez a defined time after they unsit.&lt;br /&gt;
//&lt;br /&gt;
// Note: It doesn&#039;t unsit any other avatars sitting on other&lt;br /&gt;
// prims prior to derezzing, but derezzing will unsit them anyway!&lt;br /&gt;
//&lt;br /&gt;
// It will also (optionally) automatically derez itself after a specified&lt;br /&gt;
// time if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
// TRUE if want to immediately auto derez when av gets up.&lt;br /&gt;
// (overrides DEREZ_AFTER_UNSIT_TIMEOUT)&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Time to derez if noone sits down&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av sits down, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av gets up, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_UNSIT_TIMEOUT = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
integer gSitting = FALSE;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                gSitting = TRUE;&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gSitting)&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up - it was sitting and now isn&#039;t ...&lt;br /&gt;
                gSitting = FALSE;&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    // Want to derez straight away&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_UNSIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Could be unlinking going on&lt;br /&gt;
                // or maybe there is another sit target in a linked prim&lt;br /&gt;
                // that someone has just sat on or vacated&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;
== Timer Action Template ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Basic timer-driven state changing script.&lt;br /&gt;
// NB: Does not use the LSL ability to define&lt;br /&gt;
// states, but uses a counter to manage a simple&lt;br /&gt;
// incrementing state machine.&lt;br /&gt;
//&lt;br /&gt;
//  Every time interval, it will change its record of state&lt;br /&gt;
//  and you can add code to do something, then it will move&lt;br /&gt;
//  to the next state.&lt;br /&gt;
//&lt;br /&gt;
//  To add more things, just add more&lt;br /&gt;
//        else if (gState == 4)&lt;br /&gt;
//        {&lt;br /&gt;
//            // and the next&lt;br /&gt;
//        }&lt;br /&gt;
//  statements in the appropriate place.&lt;br /&gt;
//&lt;br /&gt;
// If you want the timer interval to be different for different&lt;br /&gt;
// states, then you could add more llSetTimerEvent() calls&lt;br /&gt;
// in each state to set the timer for the next one.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2012&lt;br /&gt;
 &lt;br /&gt;
// Timer interval in seconds&lt;br /&gt;
float TIMER_INTERVAL = 5.0;&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = 0;&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState ++;&lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            // Do the first thing here&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 2)&lt;br /&gt;
        {&lt;br /&gt;
            // After the timer interval this is next&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == 3)&lt;br /&gt;
        {&lt;br /&gt;
            // and the next&lt;br /&gt;
        }&lt;br /&gt;
        // add more else if () statements here&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Once all states are complete, reset the counter ready for the next time&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== (soon) ==&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1171517</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1171517"/>
		<updated>2012-08-08T21:18:36Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Simple Prim Texture Changer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        if (texture != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Update: April 2012: This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife:///app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Max buttons on a dialog is 12, so if more than that, then need to &lt;br /&gt;
    // include special next/back button handling&lt;br /&gt;
    integer first_texture = 0;&lt;br /&gt;
    integer last_texture = gNumTextures-1;&lt;br /&gt;
    if (gNumTextures &amp;gt; 12)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: This yields notecards counting as follows:&lt;br /&gt;
        // 0 to 8 = first page,&lt;br /&gt;
        // 9 to 17 = next page, etc&lt;br /&gt;
        first_texture = gMenuPage * 9;&lt;br /&gt;
        last_texture = first_texture + 9 - 1;&lt;br /&gt;
        if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
        {&lt;br /&gt;
            // recall last_texture indexed from 0, but&lt;br /&gt;
            // gNumTextures is indexed from 1&lt;br /&gt;
            last_texture = gNumTextures-1;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
// http://kimmscripts.wordpress.com/2012/02/23/move-up-and-down-and-rotate/&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&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;
== Notify List of Avatars ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM to the objects owner and the list of avs listed in the script.&lt;br /&gt;
// Will also send an acknowledgement IM to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// NB that SL includes delays and throttling to prevent spamming&lt;br /&gt;
// see: https://wiki.secondlife.com/wiki/LlInstantMessage&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Laz Longfall, Jun 2012&lt;br /&gt;
&lt;br /&gt;
// List of full avatar UUIDs.&lt;br /&gt;
// you can get this from viewing the profile of each avatar in SL&lt;br /&gt;
// (well in firestorm anyway)&lt;br /&gt;
//&lt;br /&gt;
// IMPORTANT: There is no error checking of these - make&lt;br /&gt;
// sure you paste them in correctly!&lt;br /&gt;
list avs = [&lt;br /&gt;
&amp;quot;12345678-f00d-cafe-9876-0987654321ef&amp;quot;,&lt;br /&gt;
&amp;quot;87654321-dead-dead-1234-fedcba012345&amp;quot;&lt;br /&gt;
// Remember no comma after the last entry ...&lt;br /&gt;
];&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d the store owners.  Someone will be along as soon as possible.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        string msg = time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;;&lt;br /&gt;
        llInstantMessage (owner, msg);&lt;br /&gt;
        integer num = llGetListLength (avs);&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;num ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            // It would be nice to check that the UUIDs provided are for&lt;br /&gt;
            // real avs but llKey2Name needs and avatar to be present&lt;br /&gt;
            // and llRequestAgentData makes it all asynchronous&lt;br /&gt;
            // and will only return for the valid ids - there is no&lt;br /&gt;
            // dataserver event (as far as I can tell) for invalid ones, so&lt;br /&gt;
            // I&#039;d have to have timeouts, etc, to check them.  Now I&lt;br /&gt;
            // could go through all that on startup to verify the UUIDs,&lt;br /&gt;
            // but this all seems like a significant complication in a&lt;br /&gt;
            // an otherwise really simple script ...&lt;br /&gt;
            // So just type the UUIDs correctly :)&lt;br /&gt;
            key uuid = llList2Key (avs, i);&lt;br /&gt;
            if (uuid == owner)&lt;br /&gt;
            {&lt;br /&gt;
                // we&#039;ve already done this one&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llOwnerSay (&amp;quot;Messaging: &amp;quot; + uuid);&lt;br /&gt;
                llInstantMessage (uuid, msg);&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;
== Simple Shower Particle Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple shower script.&lt;br /&gt;
// If you want the &amp;quot;droplet&amp;quot; texture, give me a shout (IM in-world)&lt;br /&gt;
//&lt;br /&gt;
// Particle Template from: http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryKeknehvParticles&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// March 2012&lt;br /&gt;
&lt;br /&gt;
integer gState = 0;&lt;br /&gt;
&lt;br /&gt;
StartWaterBurst ()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem([                   //KPSv1.0  &lt;br /&gt;
        PSYS_PART_FLAGS , 0 //Comment out any of the following masks to deactivate them&lt;br /&gt;
    //| PSYS_PART_BOUNCE_MASK           //Bounce on object&#039;s z-axis&lt;br /&gt;
    //| PSYS_PART_WIND_MASK             //Particles are moved by wind&lt;br /&gt;
    | PSYS_PART_INTERP_COLOR_MASK       //Colors fade from start to end&lt;br /&gt;
    | PSYS_PART_INTERP_SCALE_MASK       //Scale fades from beginning to end&lt;br /&gt;
    //| PSYS_PART_FOLLOW_SRC_MASK         //Particles follow the emitter&lt;br /&gt;
    //| PSYS_PART_FOLLOW_VELOCITY_MASK    //Particles are created at the velocity of the emitter&lt;br /&gt;
    //| PSYS_PART_TARGET_POS_MASK       //Particles follow the target&lt;br /&gt;
    | PSYS_PART_EMISSIVE_MASK           //Particles are self-lit (glow)&lt;br /&gt;
    //| PSYS_PART_TARGET_LINEAR_MASK    //Undocumented--Sends particles in straight line?&lt;br /&gt;
    ,&lt;br /&gt;
    &lt;br /&gt;
    //PSYS_SRC_TARGET_KEY , NULL_KEY,   //Key of the target for the particles to head towards&lt;br /&gt;
                                                //This one is particularly finicky, so be careful.&lt;br /&gt;
    //Choose one of these as a pattern:&lt;br /&gt;
    //PSYS_SRC_PATTERN_DROP                 Particles start at emitter with no velocity&lt;br /&gt;
    //PSYS_SRC_PATTERN_EXPLODE              Particles explode from the emitter&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE                Particles are emitted in a 2-D angle&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE           Particles are emitted in a 3-D cone&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY     Particles are emitted everywhere except for a 3-D cone&lt;br /&gt;
    &lt;br /&gt;
    PSYS_SRC_PATTERN,           PSYS_SRC_PATTERN_ANGLE_CONE&lt;br /&gt;
    &lt;br /&gt;
    ,PSYS_SRC_TEXTURE, &amp;quot;droplet&amp;quot;&lt;br /&gt;
    //,PSYS_SRC_TEXTURE,           &amp;quot;&amp;quot;                 //UUID of the desired particle texture, or inventory name&lt;br /&gt;
    ,PSYS_SRC_MAX_AGE,           0.0                //Time, in seconds, for particles to be emitted. 0 = forever&lt;br /&gt;
    ,PSYS_PART_MAX_AGE,          2.0                //Lifetime, in seconds, that a particle lasts&lt;br /&gt;
    ,PSYS_SRC_BURST_RATE,        0.0                //How long, in seconds, between each emission&lt;br /&gt;
    ,PSYS_SRC_BURST_PART_COUNT,  10                  //Number of particles per emission&lt;br /&gt;
    ,PSYS_SRC_BURST_RADIUS,      0.0                //Radius of emission&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MIN,   1.0                //Minimum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MAX,   2.0               //Maximum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_ACCEL,             &amp;lt;0.0,0.0,-2.0&amp;gt;     //Acceleration of particles each second&lt;br /&gt;
    ,PSYS_PART_START_COLOR,      &amp;lt;0.9,0.9,1.0&amp;gt;      //Starting RGB color&lt;br /&gt;
    ,PSYS_PART_END_COLOR,        &amp;lt;0.7,0.7,1.0&amp;gt;      //Ending RGB color, if INTERP_COLOR_MASK is on &lt;br /&gt;
    ,PSYS_PART_START_ALPHA,      0.7                //Starting transparency, 1 is opaque, 0 is transparent.&lt;br /&gt;
    ,PSYS_PART_END_ALPHA,        0.5                //Ending transparency&lt;br /&gt;
    ,PSYS_PART_START_SCALE,      &amp;lt;0.05,0.05,0.0&amp;gt;      //Starting particle size&lt;br /&gt;
    ,PSYS_PART_END_SCALE,        &amp;lt;0.12,0.12,0.0&amp;gt;      //Ending particle size, if INTERP_SCALE_MASK is on&lt;br /&gt;
    ,PSYS_SRC_ANGLE_BEGIN,       0                 //Inner angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_ANGLE_END,         PI / 6.0           //Outer angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_OMEGA,             &amp;lt;0.0,0.0,0.0&amp;gt;      //Rotation of ANGLE patterns, similar to llTargetOmega()&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
WaterStop()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem ([]);&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;
        gState = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start( integer num )&lt;br /&gt;
    {&lt;br /&gt;
        gState++;&lt;br /&gt;
        if (gState &amp;gt; 1)&lt;br /&gt;
        {&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            StartWaterBurst();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            WaterStop();&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1171515</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1171515"/>
		<updated>2012-08-08T21:16:57Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Simple Prim Texture Changer */  Finally added a changed event handler!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Update: April 2012: This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife:///app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Max buttons on a dialog is 12, so if more than that, then need to &lt;br /&gt;
    // include special next/back button handling&lt;br /&gt;
    integer first_texture = 0;&lt;br /&gt;
    integer last_texture = gNumTextures-1;&lt;br /&gt;
    if (gNumTextures &amp;gt; 12)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: This yields notecards counting as follows:&lt;br /&gt;
        // 0 to 8 = first page,&lt;br /&gt;
        // 9 to 17 = next page, etc&lt;br /&gt;
        first_texture = gMenuPage * 9;&lt;br /&gt;
        last_texture = first_texture + 9 - 1;&lt;br /&gt;
        if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
        {&lt;br /&gt;
            // recall last_texture indexed from 0, but&lt;br /&gt;
            // gNumTextures is indexed from 1&lt;br /&gt;
            last_texture = gNumTextures-1;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
// http://kimmscripts.wordpress.com/2012/02/23/move-up-and-down-and-rotate/&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&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;
== Notify List of Avatars ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM to the objects owner and the list of avs listed in the script.&lt;br /&gt;
// Will also send an acknowledgement IM to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// NB that SL includes delays and throttling to prevent spamming&lt;br /&gt;
// see: https://wiki.secondlife.com/wiki/LlInstantMessage&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Laz Longfall, Jun 2012&lt;br /&gt;
&lt;br /&gt;
// List of full avatar UUIDs.&lt;br /&gt;
// you can get this from viewing the profile of each avatar in SL&lt;br /&gt;
// (well in firestorm anyway)&lt;br /&gt;
//&lt;br /&gt;
// IMPORTANT: There is no error checking of these - make&lt;br /&gt;
// sure you paste them in correctly!&lt;br /&gt;
list avs = [&lt;br /&gt;
&amp;quot;12345678-f00d-cafe-9876-0987654321ef&amp;quot;,&lt;br /&gt;
&amp;quot;87654321-dead-dead-1234-fedcba012345&amp;quot;&lt;br /&gt;
// Remember no comma after the last entry ...&lt;br /&gt;
];&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d the store owners.  Someone will be along as soon as possible.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        string msg = time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;;&lt;br /&gt;
        llInstantMessage (owner, msg);&lt;br /&gt;
        integer num = llGetListLength (avs);&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;num ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            // It would be nice to check that the UUIDs provided are for&lt;br /&gt;
            // real avs but llKey2Name needs and avatar to be present&lt;br /&gt;
            // and llRequestAgentData makes it all asynchronous&lt;br /&gt;
            // and will only return for the valid ids - there is no&lt;br /&gt;
            // dataserver event (as far as I can tell) for invalid ones, so&lt;br /&gt;
            // I&#039;d have to have timeouts, etc, to check them.  Now I&lt;br /&gt;
            // could go through all that on startup to verify the UUIDs,&lt;br /&gt;
            // but this all seems like a significant complication in a&lt;br /&gt;
            // an otherwise really simple script ...&lt;br /&gt;
            // So just type the UUIDs correctly :)&lt;br /&gt;
            key uuid = llList2Key (avs, i);&lt;br /&gt;
            if (uuid == owner)&lt;br /&gt;
            {&lt;br /&gt;
                // we&#039;ve already done this one&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llOwnerSay (&amp;quot;Messaging: &amp;quot; + uuid);&lt;br /&gt;
                llInstantMessage (uuid, msg);&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;
== Simple Shower Particle Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple shower script.&lt;br /&gt;
// If you want the &amp;quot;droplet&amp;quot; texture, give me a shout (IM in-world)&lt;br /&gt;
//&lt;br /&gt;
// Particle Template from: http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryKeknehvParticles&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// March 2012&lt;br /&gt;
&lt;br /&gt;
integer gState = 0;&lt;br /&gt;
&lt;br /&gt;
StartWaterBurst ()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem([                   //KPSv1.0  &lt;br /&gt;
        PSYS_PART_FLAGS , 0 //Comment out any of the following masks to deactivate them&lt;br /&gt;
    //| PSYS_PART_BOUNCE_MASK           //Bounce on object&#039;s z-axis&lt;br /&gt;
    //| PSYS_PART_WIND_MASK             //Particles are moved by wind&lt;br /&gt;
    | PSYS_PART_INTERP_COLOR_MASK       //Colors fade from start to end&lt;br /&gt;
    | PSYS_PART_INTERP_SCALE_MASK       //Scale fades from beginning to end&lt;br /&gt;
    //| PSYS_PART_FOLLOW_SRC_MASK         //Particles follow the emitter&lt;br /&gt;
    //| PSYS_PART_FOLLOW_VELOCITY_MASK    //Particles are created at the velocity of the emitter&lt;br /&gt;
    //| PSYS_PART_TARGET_POS_MASK       //Particles follow the target&lt;br /&gt;
    | PSYS_PART_EMISSIVE_MASK           //Particles are self-lit (glow)&lt;br /&gt;
    //| PSYS_PART_TARGET_LINEAR_MASK    //Undocumented--Sends particles in straight line?&lt;br /&gt;
    ,&lt;br /&gt;
    &lt;br /&gt;
    //PSYS_SRC_TARGET_KEY , NULL_KEY,   //Key of the target for the particles to head towards&lt;br /&gt;
                                                //This one is particularly finicky, so be careful.&lt;br /&gt;
    //Choose one of these as a pattern:&lt;br /&gt;
    //PSYS_SRC_PATTERN_DROP                 Particles start at emitter with no velocity&lt;br /&gt;
    //PSYS_SRC_PATTERN_EXPLODE              Particles explode from the emitter&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE                Particles are emitted in a 2-D angle&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE           Particles are emitted in a 3-D cone&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY     Particles are emitted everywhere except for a 3-D cone&lt;br /&gt;
    &lt;br /&gt;
    PSYS_SRC_PATTERN,           PSYS_SRC_PATTERN_ANGLE_CONE&lt;br /&gt;
    &lt;br /&gt;
    ,PSYS_SRC_TEXTURE, &amp;quot;droplet&amp;quot;&lt;br /&gt;
    //,PSYS_SRC_TEXTURE,           &amp;quot;&amp;quot;                 //UUID of the desired particle texture, or inventory name&lt;br /&gt;
    ,PSYS_SRC_MAX_AGE,           0.0                //Time, in seconds, for particles to be emitted. 0 = forever&lt;br /&gt;
    ,PSYS_PART_MAX_AGE,          2.0                //Lifetime, in seconds, that a particle lasts&lt;br /&gt;
    ,PSYS_SRC_BURST_RATE,        0.0                //How long, in seconds, between each emission&lt;br /&gt;
    ,PSYS_SRC_BURST_PART_COUNT,  10                  //Number of particles per emission&lt;br /&gt;
    ,PSYS_SRC_BURST_RADIUS,      0.0                //Radius of emission&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MIN,   1.0                //Minimum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MAX,   2.0               //Maximum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_ACCEL,             &amp;lt;0.0,0.0,-2.0&amp;gt;     //Acceleration of particles each second&lt;br /&gt;
    ,PSYS_PART_START_COLOR,      &amp;lt;0.9,0.9,1.0&amp;gt;      //Starting RGB color&lt;br /&gt;
    ,PSYS_PART_END_COLOR,        &amp;lt;0.7,0.7,1.0&amp;gt;      //Ending RGB color, if INTERP_COLOR_MASK is on &lt;br /&gt;
    ,PSYS_PART_START_ALPHA,      0.7                //Starting transparency, 1 is opaque, 0 is transparent.&lt;br /&gt;
    ,PSYS_PART_END_ALPHA,        0.5                //Ending transparency&lt;br /&gt;
    ,PSYS_PART_START_SCALE,      &amp;lt;0.05,0.05,0.0&amp;gt;      //Starting particle size&lt;br /&gt;
    ,PSYS_PART_END_SCALE,        &amp;lt;0.12,0.12,0.0&amp;gt;      //Ending particle size, if INTERP_SCALE_MASK is on&lt;br /&gt;
    ,PSYS_SRC_ANGLE_BEGIN,       0                 //Inner angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_ANGLE_END,         PI / 6.0           //Outer angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_OMEGA,             &amp;lt;0.0,0.0,0.0&amp;gt;      //Rotation of ANGLE patterns, similar to llTargetOmega()&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
WaterStop()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem ([]);&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;
        gState = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start( integer num )&lt;br /&gt;
    {&lt;br /&gt;
        gState++;&lt;br /&gt;
        if (gState &amp;gt; 1)&lt;br /&gt;
        {&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            StartWaterBurst();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            WaterStop();&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1171437</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1171437"/>
		<updated>2012-08-06T22:12:13Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Derez After Sitting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up&lt;br /&gt;
// or derez a defined time after they unsit.&lt;br /&gt;
//&lt;br /&gt;
// Note: It doesn&#039;t unsit any other avatars sitting on other&lt;br /&gt;
// prims prior to derezzing, but derezzing will unsit them anyway!&lt;br /&gt;
//&lt;br /&gt;
// It will also (optionally) automatically derez itself after a specified&lt;br /&gt;
// time if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
// TRUE if want to immediately auto derez when av gets up.&lt;br /&gt;
// (overrides DEREZ_AFTER_UNSIT_TIMEOUT)&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Time to derez if noone sits down&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av sits down, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;&lt;br /&gt;
&lt;br /&gt;
// Once an av gets up, this timer starts&lt;br /&gt;
// and will derez when it times out.&lt;br /&gt;
// (in seconds - 0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_UNSIT_TIMEOUT = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
integer gSitting = FALSE;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                gSitting = TRUE;&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gSitting)&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up - it was sitting and now isn&#039;t ...&lt;br /&gt;
                gSitting = FALSE;&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    // Want to derez straight away&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_UNSIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Could be unlinking going on&lt;br /&gt;
                // or maybe there is another sit target in a linked prim&lt;br /&gt;
                // that someone has just sat on or vacated&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;
== More to follow ==&lt;br /&gt;
&lt;br /&gt;
== (soon) ==&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1171331</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1171331"/>
		<updated>2012-08-01T20:26:22Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Derez After Sitting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up.&lt;br /&gt;
//&lt;br /&gt;
// Note: It doesn&#039;t unsit any other avatars sitting on other&lt;br /&gt;
// prims prior to derezzing, but that will unsit them anyway!&lt;br /&gt;
//&lt;br /&gt;
// It will also automatically derez itself after a specified time&lt;br /&gt;
// if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;     // TRUE if want to auto derez when av gets up&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;                 // In seconds (0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;   // In seconds (0.0 to disable)&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
integer gSitting = FALSE;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                gSitting = TRUE;&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gSitting)&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up - it was sitting and now isn&#039;t ...&lt;br /&gt;
                gSitting = FALSE;&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Could be unlinking going on&lt;br /&gt;
                // or maybe there is another sit target in a linked prim&lt;br /&gt;
                // that someone has just sat on or vacated&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;
== More to follow ==&lt;br /&gt;
&lt;br /&gt;
== (soon) ==&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170550</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170550"/>
		<updated>2012-07-12T21:06:26Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Derez After Sitting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up.&lt;br /&gt;
//&lt;br /&gt;
// It will also automatically derez itself after a specified time&lt;br /&gt;
// if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;     // TRUE if want to auto derez when av gets up&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;                 // In seconds (0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;   // In seconds (0.0 to disable)&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - ZERO_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != ZERO_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up (might not be true - could be unlinking going on)&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&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;
== More to follow ==&lt;br /&gt;
&lt;br /&gt;
== (soon) ==&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170548</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170548"/>
		<updated>2012-07-12T21:02:10Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Derez After Sitting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//           But this script does not have to be the thing setting it,&lt;br /&gt;
//           if the sit target is set to &amp;lt;0.0,0.0,0.0&amp;gt; in this script,&lt;br /&gt;
//           then no call to llSitTarget is made - so another script&lt;br /&gt;
//           can do it instead.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up.&lt;br /&gt;
//&lt;br /&gt;
// It will also automatically derez itself after a specified time&lt;br /&gt;
// if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;     // TRUE if want to auto derez when av gets up&lt;br /&gt;
float DEREZ_TIMEOUT = 60.0;                 // In seconds (0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 30.0;   // In seconds (0.0 to disable)&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - NULL_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (SIT_VECTOR != NULL_VECTOR)&lt;br /&gt;
        {&lt;br /&gt;
            llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up (might not be true - could be unlinking going on)&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&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;
== More to follow ==&lt;br /&gt;
&lt;br /&gt;
== (soon) ==&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170460</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170460"/>
		<updated>2012-07-10T21:27:31Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up.&lt;br /&gt;
//&lt;br /&gt;
// It will also automatically derez itself after a specified time&lt;br /&gt;
// if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// If used with the sensing rezzer, then could be the basis of&lt;br /&gt;
// a vehicle rezzing system.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;     // TRUE if want to auto derez when av gets up&lt;br /&gt;
float DEREZ_TIMEOUT = 600.0;                 // In seconds (0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 300.0;   // In seconds (0.0 to disable)&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - NULL_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up (might not be true - could be unlinking going on)&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&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;
== More to follow ==&lt;br /&gt;
&lt;br /&gt;
== (soon) ==&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170459</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170459"/>
		<updated>2012-07-10T21:25:57Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up.&lt;br /&gt;
//&lt;br /&gt;
// It will also automatically derez itself after a specified time&lt;br /&gt;
// if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// If used with the sensing rezzer, then could be the basis of&lt;br /&gt;
// a vehicle rezzing system.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;     // TRUE if want to auto derez when av gets up&lt;br /&gt;
float DEREZ_TIMEOUT = 600.0;                 // In seconds (0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 300.0;   // In seconds (0.0 to disable)&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - NULL_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up (might not be true - could be unlinking going on)&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&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;
== More to follow ==&lt;br /&gt;
&lt;br /&gt;
(soon)&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170458</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170458"/>
		<updated>2012-07-10T21:25:34Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up.&lt;br /&gt;
//&lt;br /&gt;
// It will also automatically derez itself after a specified time&lt;br /&gt;
// if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// If used with the sensing rezzer, then could be the basis of&lt;br /&gt;
// a vehicle rezzing system.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;     // TRUE if want to auto derez when av gets up&lt;br /&gt;
float DEREZ_TIMEOUT = 600.0;                 // In seconds (0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 300.0;   // In seconds (0.0 to disable)&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - NULL_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up (might not be true - could be unlinking going on)&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&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;
== More to follow ==&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1170457</id>
		<title>User:Kimm Paulino</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1170457"/>
		<updated>2012-07-10T21:09:34Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{skills&lt;br /&gt;
|Architect=&lt;br /&gt;
|Builder=&lt;br /&gt;
|Machinima=&lt;br /&gt;
|Roleplayer=&lt;br /&gt;
|Scenographer=&lt;br /&gt;
|Scripter=*&lt;br /&gt;
|SLogistician=&lt;br /&gt;
|Terraformer=&lt;br /&gt;
|}}&lt;br /&gt;
&lt;br /&gt;
=== About ===&lt;br /&gt;
&lt;br /&gt;
Been in SL since September 2008.  Slowly started experimenting more with scripting during that time.  Usually happy to say &#039;hi&#039;.&lt;br /&gt;
&lt;br /&gt;
At the moment, I am fairly well preoccupied helping set up http://synzcreations.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
Users with good scripting info:&lt;br /&gt;
* [[User:Becky Pippen]]&lt;br /&gt;
* [[User:Fred Gandt]]&lt;br /&gt;
* [[User:Void Singer]]&lt;br /&gt;
* [[User:Opensource_Obscure]]&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
List most scripters, I&#039;ve collected various scripting odds and ends and share a few of them here for good measure in case they are of wider use.  They are provided &#039;as is&#039; for free use.  I make no claim about their fitness for purpose. If I&#039;ve used something from a resource somewhere I&#039;ve tried to include a credit, but if I&#039;ve missed any - sorry!  Do let me know and I&#039;ll add it back in.&lt;br /&gt;
&lt;br /&gt;
Feel free to drop me a im if you find anything useful. Unfortunately I am unlikely to be able to answer questions about them.  If you have scripting questions, try the in-world scripting groups.&lt;br /&gt;
&lt;br /&gt;
The scripts:&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts]]&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts1]]&lt;br /&gt;
&lt;br /&gt;
Other info:&lt;br /&gt;
* http://kimmscripts.wordpress.com/ - help and usage information&lt;br /&gt;
* http://kimmscripts.wordpress.com/about/ - my views on scripting&lt;br /&gt;
&lt;br /&gt;
=== Scripting Tips and Techniques ===&lt;br /&gt;
&lt;br /&gt;
Optimisations and Memory Efficient Scripting:&lt;br /&gt;
* [[User:Void Singer/Optimizations]]&lt;br /&gt;
* [[LSL_Script_Memory]]&lt;br /&gt;
* http://www.lslwiki.net/lslwiki/wakka.php?wakka=MemoryUsage&lt;br /&gt;
* [[User:Becky Pippen/Script_Memory_Limits]]&lt;br /&gt;
&lt;br /&gt;
Other stuff&lt;br /&gt;
* https://wiki.secondlife.com/wiki/Category:LSL_Avatar/Name&lt;br /&gt;
* [[User:Void_Singer/Rotations]], also SLU Tutorials on rotations [http://www.sluniverse.com/php/vb/tutorials/62235-basic-introduction-rotations.html here] and [http://www.sluniverse.com/php/vb/tutorials/62479-introduction-rotations-translations-rotation-tutorial.html here]&lt;br /&gt;
&lt;br /&gt;
=== Open Source or Freely Available Scripting Systems ===&lt;br /&gt;
&lt;br /&gt;
This is a list of personal bookmarks for things I&#039;ve found interesting, not an exaustive list - see the [http://community.secondlife.com/t5/LSL-Library/bd-p/LSLScriptingLibrary Library Forum] and [[LSL_Library]] wiki pages for that.&lt;br /&gt;
&lt;br /&gt;
* [[User:Nandana_Singh/nPose]]&lt;br /&gt;
* [[User:Rufus_Darkfold/PrimControl_HUD]]&lt;br /&gt;
* [[XyzzyText]]&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170425</id>
		<title>User:Kimm Paulino/Scripts1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts1&amp;diff=1170425"/>
		<updated>2012-07-09T22:07:46Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Created page with &amp;quot;== Rez and Sense ==  &amp;lt;lsl&amp;gt; // Rezzer that will only rez an object (from inventory) if it // can&amp;#039;t detect the specified number of objects in the region nearby already. // // Note:…&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Rez and Sense ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Rezzer that will only rez an object (from inventory) if it&lt;br /&gt;
// can&#039;t detect the specified number of objects in the region nearby already.&lt;br /&gt;
//&lt;br /&gt;
// Note: Sensing is limitd to a maximum of 96m in all directions.  If the&lt;br /&gt;
// objects pass out of that range, this won&#039;t find them.&lt;br /&gt;
//&lt;br /&gt;
// Always looks for (and rezzes) the first object found in inventory.&lt;br /&gt;
// NB: This must have copy permissions if you want to rez it more than once!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer MAX_REZZED_OBJECTS = 5;&lt;br /&gt;
vector REZ_POSITION = &amp;lt;1.0, 0.0, 0.0&amp;gt;;       // Relative to the rezzing prim, must be less than 10m away&lt;br /&gt;
vector REZ_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;      // In degrees&lt;br /&gt;
&lt;br /&gt;
string gObjectName;&lt;br /&gt;
&lt;br /&gt;
rezObject ()&lt;br /&gt;
{&lt;br /&gt;
    llRezObject (gObjectName, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gObjectName = llGetInventoryName (INVENTORY_OBJECT, 0);&lt;br /&gt;
        if (gObjectName == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note to owner: No objects found in this prims inventory&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gObjectName != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Trigger a single sensor event for the full range/arc looking for any non-avatar&lt;br /&gt;
            // objects with the same name as our rezzing object.&lt;br /&gt;
            llSensor (gObjectName, NULL_KEY, (ACTIVE|PASSIVE), 96.0, PI);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    sensor (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (num_detected &amp;lt; MAX_REZZED_OBJECTS)&lt;br /&gt;
        {&lt;br /&gt;
            rezObject();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Max Objects detected ...&amp;quot;);&lt;br /&gt;
            // Nothing to do&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor ()&lt;br /&gt;
    {&lt;br /&gt;
        // None found, so ok to rez one&lt;br /&gt;
        rezObject();&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Derez After Sitting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, the specified time after someone&lt;br /&gt;
// sits on the prim.  It will unsit them before derezzing.&lt;br /&gt;
//&lt;br /&gt;
// Note: This only works when the prim has a sittarget defined.&lt;br /&gt;
//&lt;br /&gt;
// It can optionally derez on unsit too - i.e. when they get up.&lt;br /&gt;
//&lt;br /&gt;
// It will also automatically derez itself after a specified time&lt;br /&gt;
// if noone sits down on it.&lt;br /&gt;
//&lt;br /&gt;
// If used with the sensing rezzer, then could be the basis of&lt;br /&gt;
// a vehicle rezzing system.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, July 2012&lt;br /&gt;
&lt;br /&gt;
integer DEREZ_ON_UNSIT = FALSE;     // TRUE if want to auto derez when av gets up&lt;br /&gt;
float DEREZ_TIMEOUT = 600.0;                 // In seconds (0.0 to disable)&lt;br /&gt;
float DEREZ_AFTER_SIT_TIMEOUT = 300.0;   // In seconds (0.0 to disable)&lt;br /&gt;
&lt;br /&gt;
// Position of the sittarget&lt;br /&gt;
vector SIT_VECTOR = &amp;lt;0.0, 0.0, 0.5&amp;gt;;    // In metres - NULL_VECTOR to disable&lt;br /&gt;
vector SIT_ROTATION = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // In degrees&lt;br /&gt;
&lt;br /&gt;
key gAvUuid;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSitTarget (SIT_VECTOR, llEuler2Rot (SIT_ROTATION * DEG_TO_RAD));&lt;br /&gt;
        llSetTimerEvent (DEREZ_TIMEOUT);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gAvUuid)&lt;br /&gt;
        {&lt;br /&gt;
            llUnSit (gAvUuid);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAvUuid = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAvUuid)&lt;br /&gt;
            {&lt;br /&gt;
                // Avatar has just sat down&lt;br /&gt;
                llSetTimerEvent (DEREZ_AFTER_SIT_TIMEOUT);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Assume av just got up (might not be true - could be unlinking going on)&lt;br /&gt;
                if (DEREZ_ON_UNSIT)&lt;br /&gt;
                {&lt;br /&gt;
                    llDie();&lt;br /&gt;
                }&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1170423</id>
		<title>User:Kimm Paulino</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1170423"/>
		<updated>2012-07-09T21:56:31Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{skills&lt;br /&gt;
|Architect=&lt;br /&gt;
|Builder=&lt;br /&gt;
|Machinima=&lt;br /&gt;
|Roleplayer=&lt;br /&gt;
|Scenographer=&lt;br /&gt;
|Scripter=*&lt;br /&gt;
|SLogistician=&lt;br /&gt;
|Terraformer=&lt;br /&gt;
|}}&lt;br /&gt;
&lt;br /&gt;
=== About ===&lt;br /&gt;
&lt;br /&gt;
Been in SL since September 2008.  Slowly started experimenting more with scripting during that time.  Usually happy to say &#039;hi&#039;.&lt;br /&gt;
&lt;br /&gt;
At the moment, I am fairly well preoccupied helping set up http://synzcreations.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
Users with good scripting info:&lt;br /&gt;
* [[User:Becky Pippen]]&lt;br /&gt;
* [[User:Fred Gandt]]&lt;br /&gt;
* [[User:Void Singer]]&lt;br /&gt;
* [[User:Opensource_Obscure]]&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
List most scripters, I&#039;ve collected various scripting odds and ends and share a few of them here for good measure in case they are of wider use.  They are provided &#039;as is&#039; for free use.  I make no claim about their fitness for purpose. If I&#039;ve used something from a resource somewhere I&#039;ve tried to include a credit, but if I&#039;ve missed any - sorry!  Do let me know and I&#039;ll add it back in.&lt;br /&gt;
&lt;br /&gt;
Feel free to drop me a im if you find anything useful. Unfortunately I am unlikely to be able to answer questions about them.  If you have scripting questions, try the in-world scripting groups.&lt;br /&gt;
&lt;br /&gt;
* http://kimmscripts.wordpress.com/ - help and usage information&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts]] - the scripts themselves (first page)&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts1]] - the next set of scripts&lt;br /&gt;
* http://kimmscripts.wordpress.com/about/ - my views on scripting&lt;br /&gt;
&lt;br /&gt;
=== Scripting Tips and Techniques ===&lt;br /&gt;
&lt;br /&gt;
Optimisations and Memory Efficient Scripting:&lt;br /&gt;
* [[User:Void Singer/Optimizations]]&lt;br /&gt;
* [[LSL_Script_Memory]]&lt;br /&gt;
* http://www.lslwiki.net/lslwiki/wakka.php?wakka=MemoryUsage&lt;br /&gt;
* [[User:Becky Pippen/Script_Memory_Limits]]&lt;br /&gt;
&lt;br /&gt;
Other stuff&lt;br /&gt;
* https://wiki.secondlife.com/wiki/Category:LSL_Avatar/Name&lt;br /&gt;
* [[User:Void_Singer/Rotations]], also SLU Tutorials on rotations [http://www.sluniverse.com/php/vb/tutorials/62235-basic-introduction-rotations.html here] and [http://www.sluniverse.com/php/vb/tutorials/62479-introduction-rotations-translations-rotation-tutorial.html here]&lt;br /&gt;
&lt;br /&gt;
=== Open Source or Freely Available Scripting Systems ===&lt;br /&gt;
&lt;br /&gt;
This is a list of personal bookmarks for things I&#039;ve found interesting, not an exaustive list - see the [http://community.secondlife.com/t5/LSL-Library/bd-p/LSLScriptingLibrary Library Forum] and [[LSL_Library]] wiki pages for that.&lt;br /&gt;
&lt;br /&gt;
* [[User:Nandana_Singh/nPose]]&lt;br /&gt;
* [[User:Rufus_Darkfold/PrimControl_HUD]]&lt;br /&gt;
* [[XyzzyText]]&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1169793</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1169793"/>
		<updated>2012-06-26T20:14:05Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Added simple shower script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Update: April 2012: This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife:///app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Max buttons on a dialog is 12, so if more than that, then need to &lt;br /&gt;
    // include special next/back button handling&lt;br /&gt;
    integer first_texture = 0;&lt;br /&gt;
    integer last_texture = gNumTextures-1;&lt;br /&gt;
    if (gNumTextures &amp;gt; 12)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: This yields notecards counting as follows:&lt;br /&gt;
        // 0 to 8 = first page,&lt;br /&gt;
        // 9 to 17 = next page, etc&lt;br /&gt;
        first_texture = gMenuPage * 9;&lt;br /&gt;
        last_texture = first_texture + 9 - 1;&lt;br /&gt;
        if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
        {&lt;br /&gt;
            // recall last_texture indexed from 0, but&lt;br /&gt;
            // gNumTextures is indexed from 1&lt;br /&gt;
            last_texture = gNumTextures-1;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
// http://kimmscripts.wordpress.com/2012/02/23/move-up-and-down-and-rotate/&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&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;
== Notify List of Avatars ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM to the objects owner and the list of avs listed in the script.&lt;br /&gt;
// Will also send an acknowledgement IM to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// NB that SL includes delays and throttling to prevent spamming&lt;br /&gt;
// see: https://wiki.secondlife.com/wiki/LlInstantMessage&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Laz Longfall, Jun 2012&lt;br /&gt;
&lt;br /&gt;
// List of full avatar UUIDs.&lt;br /&gt;
// you can get this from viewing the profile of each avatar in SL&lt;br /&gt;
// (well in firestorm anyway)&lt;br /&gt;
//&lt;br /&gt;
// IMPORTANT: There is no error checking of these - make&lt;br /&gt;
// sure you paste them in correctly!&lt;br /&gt;
list avs = [&lt;br /&gt;
&amp;quot;12345678-f00d-cafe-9876-0987654321ef&amp;quot;,&lt;br /&gt;
&amp;quot;87654321-dead-dead-1234-fedcba012345&amp;quot;&lt;br /&gt;
// Remember no comma after the last entry ...&lt;br /&gt;
];&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d the store owners.  Someone will be along as soon as possible.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        string msg = time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;;&lt;br /&gt;
        llInstantMessage (owner, msg);&lt;br /&gt;
        integer num = llGetListLength (avs);&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;num ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            // It would be nice to check that the UUIDs provided are for&lt;br /&gt;
            // real avs but llKey2Name needs and avatar to be present&lt;br /&gt;
            // and llRequestAgentData makes it all asynchronous&lt;br /&gt;
            // and will only return for the valid ids - there is no&lt;br /&gt;
            // dataserver event (as far as I can tell) for invalid ones, so&lt;br /&gt;
            // I&#039;d have to have timeouts, etc, to check them.  Now I&lt;br /&gt;
            // could go through all that on startup to verify the UUIDs,&lt;br /&gt;
            // but this all seems like a significant complication in a&lt;br /&gt;
            // an otherwise really simple script ...&lt;br /&gt;
            // So just type the UUIDs correctly :)&lt;br /&gt;
            key uuid = llList2Key (avs, i);&lt;br /&gt;
            if (uuid == owner)&lt;br /&gt;
            {&lt;br /&gt;
                // we&#039;ve already done this one&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llOwnerSay (&amp;quot;Messaging: &amp;quot; + uuid);&lt;br /&gt;
                llInstantMessage (uuid, msg);&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;
== Simple Shower Particle Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple shower script.&lt;br /&gt;
// If you want the &amp;quot;droplet&amp;quot; texture, give me a shout (IM in-world)&lt;br /&gt;
//&lt;br /&gt;
// Particle Template from: http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryKeknehvParticles&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// March 2012&lt;br /&gt;
&lt;br /&gt;
integer gState = 0;&lt;br /&gt;
&lt;br /&gt;
StartWaterBurst ()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem([                   //KPSv1.0  &lt;br /&gt;
        PSYS_PART_FLAGS , 0 //Comment out any of the following masks to deactivate them&lt;br /&gt;
    //| PSYS_PART_BOUNCE_MASK           //Bounce on object&#039;s z-axis&lt;br /&gt;
    //| PSYS_PART_WIND_MASK             //Particles are moved by wind&lt;br /&gt;
    | PSYS_PART_INTERP_COLOR_MASK       //Colors fade from start to end&lt;br /&gt;
    | PSYS_PART_INTERP_SCALE_MASK       //Scale fades from beginning to end&lt;br /&gt;
    //| PSYS_PART_FOLLOW_SRC_MASK         //Particles follow the emitter&lt;br /&gt;
    //| PSYS_PART_FOLLOW_VELOCITY_MASK    //Particles are created at the velocity of the emitter&lt;br /&gt;
    //| PSYS_PART_TARGET_POS_MASK       //Particles follow the target&lt;br /&gt;
    | PSYS_PART_EMISSIVE_MASK           //Particles are self-lit (glow)&lt;br /&gt;
    //| PSYS_PART_TARGET_LINEAR_MASK    //Undocumented--Sends particles in straight line?&lt;br /&gt;
    ,&lt;br /&gt;
    &lt;br /&gt;
    //PSYS_SRC_TARGET_KEY , NULL_KEY,   //Key of the target for the particles to head towards&lt;br /&gt;
                                                //This one is particularly finicky, so be careful.&lt;br /&gt;
    //Choose one of these as a pattern:&lt;br /&gt;
    //PSYS_SRC_PATTERN_DROP                 Particles start at emitter with no velocity&lt;br /&gt;
    //PSYS_SRC_PATTERN_EXPLODE              Particles explode from the emitter&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE                Particles are emitted in a 2-D angle&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE           Particles are emitted in a 3-D cone&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY     Particles are emitted everywhere except for a 3-D cone&lt;br /&gt;
    &lt;br /&gt;
    PSYS_SRC_PATTERN,           PSYS_SRC_PATTERN_ANGLE_CONE&lt;br /&gt;
    &lt;br /&gt;
    ,PSYS_SRC_TEXTURE, &amp;quot;droplet&amp;quot;&lt;br /&gt;
    //,PSYS_SRC_TEXTURE,           &amp;quot;&amp;quot;                 //UUID of the desired particle texture, or inventory name&lt;br /&gt;
    ,PSYS_SRC_MAX_AGE,           0.0                //Time, in seconds, for particles to be emitted. 0 = forever&lt;br /&gt;
    ,PSYS_PART_MAX_AGE,          2.0                //Lifetime, in seconds, that a particle lasts&lt;br /&gt;
    ,PSYS_SRC_BURST_RATE,        0.0                //How long, in seconds, between each emission&lt;br /&gt;
    ,PSYS_SRC_BURST_PART_COUNT,  10                  //Number of particles per emission&lt;br /&gt;
    ,PSYS_SRC_BURST_RADIUS,      0.0                //Radius of emission&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MIN,   1.0                //Minimum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MAX,   2.0               //Maximum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_ACCEL,             &amp;lt;0.0,0.0,-2.0&amp;gt;     //Acceleration of particles each second&lt;br /&gt;
    ,PSYS_PART_START_COLOR,      &amp;lt;0.9,0.9,1.0&amp;gt;      //Starting RGB color&lt;br /&gt;
    ,PSYS_PART_END_COLOR,        &amp;lt;0.7,0.7,1.0&amp;gt;      //Ending RGB color, if INTERP_COLOR_MASK is on &lt;br /&gt;
    ,PSYS_PART_START_ALPHA,      0.7                //Starting transparency, 1 is opaque, 0 is transparent.&lt;br /&gt;
    ,PSYS_PART_END_ALPHA,        0.5                //Ending transparency&lt;br /&gt;
    ,PSYS_PART_START_SCALE,      &amp;lt;0.05,0.05,0.0&amp;gt;      //Starting particle size&lt;br /&gt;
    ,PSYS_PART_END_SCALE,        &amp;lt;0.12,0.12,0.0&amp;gt;      //Ending particle size, if INTERP_SCALE_MASK is on&lt;br /&gt;
    ,PSYS_SRC_ANGLE_BEGIN,       0                 //Inner angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_ANGLE_END,         PI / 6.0           //Outer angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_OMEGA,             &amp;lt;0.0,0.0,0.0&amp;gt;      //Rotation of ANGLE patterns, similar to llTargetOmega()&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
WaterStop()&lt;br /&gt;
{&lt;br /&gt;
    llParticleSystem ([]);&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;
        gState = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start( integer num )&lt;br /&gt;
    {&lt;br /&gt;
        gState++;&lt;br /&gt;
        if (gState &amp;gt; 1)&lt;br /&gt;
        {&lt;br /&gt;
            gState = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gState == 1)&lt;br /&gt;
        {&lt;br /&gt;
            StartWaterBurst();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            WaterStop();&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1169792</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1169792"/>
		<updated>2012-06-26T19:48:51Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Added notification list script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Update: April 2012: This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife:///app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Max buttons on a dialog is 12, so if more than that, then need to &lt;br /&gt;
    // include special next/back button handling&lt;br /&gt;
    integer first_texture = 0;&lt;br /&gt;
    integer last_texture = gNumTextures-1;&lt;br /&gt;
    if (gNumTextures &amp;gt; 12)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: This yields notecards counting as follows:&lt;br /&gt;
        // 0 to 8 = first page,&lt;br /&gt;
        // 9 to 17 = next page, etc&lt;br /&gt;
        first_texture = gMenuPage * 9;&lt;br /&gt;
        last_texture = first_texture + 9 - 1;&lt;br /&gt;
        if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
        {&lt;br /&gt;
            // recall last_texture indexed from 0, but&lt;br /&gt;
            // gNumTextures is indexed from 1&lt;br /&gt;
            last_texture = gNumTextures-1;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
// http://kimmscripts.wordpress.com/2012/02/23/move-up-and-down-and-rotate/&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&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;
== Notify List of Avatars ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM to the objects owner and the list of avs listed in the script.&lt;br /&gt;
// Will also send an acknowledgement IM to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// NB that SL includes delays and throttling to prevent spamming&lt;br /&gt;
// see: https://wiki.secondlife.com/wiki/LlInstantMessage&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Laz Longfall, Jun 2012&lt;br /&gt;
&lt;br /&gt;
// List of full avatar UUIDs.&lt;br /&gt;
// you can get this from viewing the profile of each avatar in SL&lt;br /&gt;
// (well in firestorm anyway)&lt;br /&gt;
//&lt;br /&gt;
// IMPORTANT: There is no error checking of these - make&lt;br /&gt;
// sure you paste them in correctly!&lt;br /&gt;
list avs = [&lt;br /&gt;
&amp;quot;12345678-f00d-cafe-9876-0987654321ef&amp;quot;,&lt;br /&gt;
&amp;quot;87654321-dead-dead-1234-fedcba012345&amp;quot;&lt;br /&gt;
// Remember no comma after the last entry ...&lt;br /&gt;
];&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d the store owners.  Someone will be along as soon as possible.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        string msg = time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;;&lt;br /&gt;
        llInstantMessage (owner, msg);&lt;br /&gt;
        integer num = llGetListLength (avs);&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;num ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            // It would be nice to check that the UUIDs provided are for&lt;br /&gt;
            // real avs but llKey2Name needs and avatar to be present&lt;br /&gt;
            // and llRequestAgentData makes it all asynchronous&lt;br /&gt;
            // and will only return for the valid ids - there is no&lt;br /&gt;
            // dataserver event (as far as I can tell) for invalid ones, so&lt;br /&gt;
            // I&#039;d have to have timeouts, etc, to check them.  Now I&lt;br /&gt;
            // could go through all that on startup to verify the UUIDs,&lt;br /&gt;
            // but this all seems like a significant complication in a&lt;br /&gt;
            // an otherwise really simple script ...&lt;br /&gt;
            // So just type the UUIDs correctly :)&lt;br /&gt;
            key uuid = llList2Key (avs, i);&lt;br /&gt;
            if (uuid == owner)&lt;br /&gt;
            {&lt;br /&gt;
                // we&#039;ve already done this one&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llOwnerSay (&amp;quot;Messaging: &amp;quot; + uuid);&lt;br /&gt;
                llInstantMessage (uuid, msg);&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1168904</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1168904"/>
		<updated>2012-06-11T20:15:26Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Dialog Texture Changer */ Added better single page dialog handling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Update: April 2012: This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife:///app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Max buttons on a dialog is 12, so if more than that, then need to &lt;br /&gt;
    // include special next/back button handling&lt;br /&gt;
    integer first_texture = 0;&lt;br /&gt;
    integer last_texture = gNumTextures-1;&lt;br /&gt;
    if (gNumTextures &amp;gt; 12)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: This yields notecards counting as follows:&lt;br /&gt;
        // 0 to 8 = first page,&lt;br /&gt;
        // 9 to 17 = next page, etc&lt;br /&gt;
        first_texture = gMenuPage * 9;&lt;br /&gt;
        last_texture = first_texture + 9 - 1;&lt;br /&gt;
        if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
        {&lt;br /&gt;
            // recall last_texture indexed from 0, but&lt;br /&gt;
            // gNumTextures is indexed from 1&lt;br /&gt;
            last_texture = gNumTextures-1;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
// http://kimmscripts.wordpress.com/2012/02/23/move-up-and-down-and-rotate/&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1167199</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1167199"/>
		<updated>2012-05-13T21:37:47Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* LM, Notecard, Group, URL giver */ Minor bug fix in group handling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Update: April 2012: This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife:///app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
// http://kimmscripts.wordpress.com/2012/02/23/move-up-and-down-and-rotate/&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1166553</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1166553"/>
		<updated>2012-04-30T20:18:00Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Phantom Prim Setter */ no longer needed see Jira PATHBUG-69&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Update: April 2012: This is no longer required - see https://jira.secondlife.com/browse/PATHBUG-69?&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
// http://kimmscripts.wordpress.com/2012/02/23/move-up-and-down-and-rotate/&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1165297</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1165297"/>
		<updated>2012-04-07T20:53:12Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Added orbit (maintaining face orientation) script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
// http://kimmscripts.wordpress.com/2012/02/23/move-up-and-down-and-rotate/&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orbit Maintaining Face Orientation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to perform orbit whilst maintaining the same face&lt;br /&gt;
// to a specific direction.  This is designed for use with two linked&lt;br /&gt;
// prims, the root is the centre prim, and a second prim orbits around&lt;br /&gt;
// the root, always keeping its face in the same (global) direction.&lt;br /&gt;
//&lt;br /&gt;
// There are two ways of using this script - as a single script in&lt;br /&gt;
// the root prim, or with copies of the script in both root and any&lt;br /&gt;
// rotating child prims.&lt;br /&gt;
//&lt;br /&gt;
// Set gScriptScriptVersion = TRUE/FALSE as required&lt;br /&gt;
//&lt;br /&gt;
// The single script version is for placing in the central root&lt;br /&gt;
// prim and it will make the 1st linked prim orbit it.&lt;br /&gt;
//&lt;br /&gt;
// The multi-script version will need the script in the root (centre)&lt;br /&gt;
// prim and in any child prims that you wish to be orbiting.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// April 2012&lt;br /&gt;
&lt;br /&gt;
// Single or multiple script version&lt;br /&gt;
integer gSingleScriptVersion = FALSE;&lt;br /&gt;
&lt;br /&gt;
// Configure the script&lt;br /&gt;
integer gTouchControl = FALSE;&lt;br /&gt;
float   ROT_PERIOD = 5.0;&lt;br /&gt;
integer ROT_STEPS = 20;&lt;br /&gt;
&lt;br /&gt;
// Don&#039;t change below here&lt;br /&gt;
integer gStep = 0;&lt;br /&gt;
integer gRotating = FALSE;&lt;br /&gt;
integer gRoot = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gStep = 0;&lt;br /&gt;
        integer num = llGetLinkNumber();&lt;br /&gt;
        if (num &amp;lt;= 1)&lt;br /&gt;
        {&lt;br /&gt;
            gRoot = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            // In single script version, only function if we are the root&lt;br /&gt;
            llOwnerSay (&amp;quot;This script is configured for Single Script use and so must be in the root (centre) prim.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (!gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gTouchControl)&lt;br /&gt;
        {&lt;br /&gt;
            if (gRotating)&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = FALSE;&lt;br /&gt;
                llSetTimerEvent (0.0);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gRotating = TRUE;&lt;br /&gt;
                llSetTimerEvent (ROT_PERIOD/(float)ROT_STEPS);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gSingleScriptVersion &amp;amp;&amp;amp; !gRoot)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gStep ++;&lt;br /&gt;
        if (gStep &amp;gt; ROT_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            gStep = 0;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If this is the root, it is the centre prim&lt;br /&gt;
        &lt;br /&gt;
        // If single script, then move the slave then the root together&lt;br /&gt;
        if (gSingleScriptVersion)&lt;br /&gt;
        {&lt;br /&gt;
            // Now move the first linked prim&lt;br /&gt;
            float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetLinkPrimitiveParamsFast (2, [PRIM_ROTATION, llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation()]);&lt;br /&gt;
&lt;br /&gt;
            // Move the root&lt;br /&gt;
            rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
            llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
        }&lt;br /&gt;
        else // multiple scripts - just move one ...&lt;br /&gt;
        {&lt;br /&gt;
            if (gRoot)&lt;br /&gt;
            {&lt;br /&gt;
                // Move the root&lt;br /&gt;
                float rot = gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD));       &lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // Move this prim, as a child&lt;br /&gt;
                float rot = - gStep * (360.0/(float)ROT_STEPS);&lt;br /&gt;
                llSetRot (llEuler2Rot (&amp;lt;0.0, 0.0, rot&amp;gt;*DEG_TO_RAD) / llGetRootRotation());       &lt;br /&gt;
            }&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>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1163941</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1163941"/>
		<updated>2012-03-09T21:53:13Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Dialog Texture Changer */  Updated to allow setting of face and texture properties&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// There are two methods of setting textures - one (gSetTexture = TRUE)&lt;br /&gt;
// allows you to use UUIDs, etc, but the other (gSetTexture = FALSE)&lt;br /&gt;
// will allow you to specify the rotation and offset values.&lt;br /&gt;
//&lt;br /&gt;
// There is also an option to just use the values from the texture already&lt;br /&gt;
// on the face (but this won&#039;t work for ALL_SIDES).&lt;br /&gt;
//&lt;br /&gt;
// Both allow you to set the face.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
// Controls how the script operates:&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
integer gSetTexture = FALSE;               // Use SetTexture method (needed for textures not in the prim inventory)&lt;br /&gt;
integer gNotecards = FALSE;               // Get textures to use from a notecard not inventory&lt;br /&gt;
integer gPreserveTextures = FALSE;      // Read offset/rotation values from existing texture&lt;br /&gt;
&lt;br /&gt;
// configures how textures appear&lt;br /&gt;
integer gFace = ALL_SIDES;&lt;br /&gt;
vector  gRepeats = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
vector  gOffsets = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float     gRotationInDegrees = 0.0;&lt;br /&gt;
&lt;br /&gt;
// Do not change anything below this line (unless you know what you are doing)&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    if (gSetTexture)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTexture (texture, gFace);&lt;br /&gt;
    }&lt;br /&gt;
    else if (gPreserveTextures &amp;amp;&amp;amp; gFace != ALL_SIDES)&lt;br /&gt;
    {&lt;br /&gt;
        // returns: [string texture, vector scale, vector offset, float rotation]&lt;br /&gt;
        list scale_offset_rot = llGetPrimitiveParams ([PRIM_TEXTURE, gFace]);&lt;br /&gt;
&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 1),&lt;br /&gt;
                                    llList2Vector (scale_offset_rot, 2),&lt;br /&gt;
                                    llList2Float   (scale_offset_rot, 3)]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TEXTURE,&lt;br /&gt;
                                    gFace,&lt;br /&gt;
                                    texture,&lt;br /&gt;
                                    gRepeats,&lt;br /&gt;
                                    gOffsets,&lt;br /&gt;
                                    gRotationInDegrees*DEG_TO_RAD]&lt;br /&gt;
                                    );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                set_texture (texture_uuid);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                set_texture (texture_full);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
// http://kimmscripts.wordpress.com/2012/02/23/move-up-and-down-and-rotate/&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1163619</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1163619"/>
		<updated>2012-03-01T22:19:36Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Visitor Counter and LM Giver */  Added Option to run just as a simple &amp;quot;touch me&amp;quot; waiting list script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script.&lt;br /&gt;
//&lt;br /&gt;
// Can also run as a simple &#039;add me to the waiting list&#039; script&lt;br /&gt;
// too (i.e. remembers everyone who touches the object).&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
// Updated for waiting list, Mar 2012&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gWaitingList = FALSE;      // enable waiting list only functionality&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;		 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;        // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
	if (gJustDates)&lt;br /&gt;
	{&lt;br /&gt;
		gVisitorTimes += llGetDate();&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
		string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
		gVisitorTimes += time;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        if (!gWaitingList)&lt;br /&gt;
        {&lt;br /&gt;
            // Range, angle, rate&lt;br /&gt;
            // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
            llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0 ; i&amp;lt;num_detected ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            if (avid == llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
                llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
                gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
                llDialog (avid, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
            }&lt;br /&gt;
            else if (gWaitingList)&lt;br /&gt;
            {&lt;br /&gt;
                string av = llKey2Name (avid);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
                llInstantMessage (avid, &amp;quot;Thank you, &amp;quot; + av + &amp;quot;, you have been added to the waiting list.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // get the name of the first landmark in the inventory&lt;br /&gt;
                string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
                if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llGiveInventory(avid, lm); &lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
&lt;br /&gt;
integer gNotecards = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                llSetTexture (texture_uuid, ALL_SIDES);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                llSetTexture (texture_full, ALL_SIDES);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
// http://kimmscripts.wordpress.com/2012/02/23/move-up-and-down-and-rotate/&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1163440</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1163440"/>
		<updated>2012-02-23T22:13:27Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;	 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;      // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
    if (gJustDates)&lt;br /&gt;
    {&lt;br /&gt;
	gVisitorTimes += llGetDate();&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
	string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
	gVisitorTimes += time;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        // Range, angle, rate&lt;br /&gt;
        // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
        llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Two things to do on touch&lt;br /&gt;
        // If its the owner, dump list of visitors&lt;br /&gt;
        // If its not, then give a lm if one exists&lt;br /&gt;
        string visitor = llDetectedKey (0);&lt;br /&gt;
        if (visitor == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
            llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
            gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
            llDialog (visitor, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // get the name of the first landmark in the inventory&lt;br /&gt;
            string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
            if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llGiveInventory(visitor, lm); &lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
&lt;br /&gt;
integer gNotecards = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                llSetTexture (texture_uuid, ALL_SIDES);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                llSetTexture (texture_full, ALL_SIDES);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and Down and rotate ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually,&lt;br /&gt;
// with a slow rotation.&lt;br /&gt;
//&lt;br /&gt;
// Thanks to the members of the Advanced Scripters of SL group.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  February 2012&lt;br /&gt;
//&lt;br /&gt;
// http://kimmscripts.wordpress.com/2012/02/23/move-up-and-down-and-rotate/&lt;br /&gt;
&lt;br /&gt;
float gMoveTime = 4.0;                // Time for each movement&lt;br /&gt;
vector gOffset  = &amp;lt;0.0, 0.0, 2.0&amp;gt;;    // Where to move to (and back from)&lt;br /&gt;
vector gDegRot  = &amp;lt;0.0, 0.0, 180.0&amp;gt;;  // rotation to apply going up, then going down again&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
        llSetKeyframedMotion (&lt;br /&gt;
            [&lt;br /&gt;
                gOffset, llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime,&lt;br /&gt;
                -gOffset,  llEuler2Rot (gDegRot*DEG_TO_RAD), gMoveTime&lt;br /&gt;
            ],&lt;br /&gt;
            [KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1163315</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1163315"/>
		<updated>2012-02-18T20:59:38Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Added some more freebie utility scripts that I&amp;#039;ve done for people ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;	 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;      // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
    if (gJustDates)&lt;br /&gt;
    {&lt;br /&gt;
	gVisitorTimes += llGetDate();&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
	string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
	gVisitorTimes += time;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        // Range, angle, rate&lt;br /&gt;
        // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
        llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Two things to do on touch&lt;br /&gt;
        // If its the owner, dump list of visitors&lt;br /&gt;
        // If its not, then give a lm if one exists&lt;br /&gt;
        string visitor = llDetectedKey (0);&lt;br /&gt;
        if (visitor == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
            llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
            gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
            llDialog (visitor, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // get the name of the first landmark in the inventory&lt;br /&gt;
            string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
            if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llGiveInventory(visitor, lm); &lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
&lt;br /&gt;
integer gNotecards = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                llSetTexture (texture_uuid, ALL_SIDES);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                llSetTexture (texture_full, ALL_SIDES);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notify Owner on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Send an IM using the text in helpmsg to the objects owner on touch.&lt;br /&gt;
// Will also send an acknowledgement IM using the text in ackmsg to the touching av.&lt;br /&gt;
//&lt;br /&gt;
// Optionally, if a notecard exists in the prim, it will also&lt;br /&gt;
// send that to the owner, as an extra, more &#039;in your face&#039; prompt.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, Aug 2011&lt;br /&gt;
&lt;br /&gt;
string helpmsg = &amp;quot;Someone needs help!&amp;quot;;&lt;br /&gt;
string ackmsg = &amp;quot;I&#039;ve IM&#039;d Syn, the store owner.  If she doesn&#039;t materialise in a puff of smoke in the next few minutes, well, I guess she is offline or afk, but I&#039;m sure she will get back to you as soon as she can.  Do feel free to continue browsing and thank you for stopping by the home of Synz Creations - http://synzcreations.wordpress.com/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        key owner = llGetOwner();&lt;br /&gt;
        key sender = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name (sender);&lt;br /&gt;
        &lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
        string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
        &lt;br /&gt;
        llInstantMessage (sender, ackmsg);&lt;br /&gt;
        llInstantMessage (owner, time + &amp;quot; &amp;quot; + helpmsg + &amp;quot; [&amp;quot; + name + &amp;quot;]&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // as an extra prompt, if a notecard is stored in the prim, send that&lt;br /&gt;
        // to the owner too ...&lt;br /&gt;
        string nc = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
        if (nc != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llGiveInventory(owner, nc); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Touch to disappear ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Touch to make an object disappear and reappear.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Sept 2011&lt;br /&gt;
integer gGone = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gGone = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (gGone)&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
            gGone = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
            gGone = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1163313</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1163313"/>
		<updated>2012-02-18T20:46:28Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Added simple tint-on-touch script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;	 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;      // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
    if (gJustDates)&lt;br /&gt;
    {&lt;br /&gt;
	gVisitorTimes += llGetDate();&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
	string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
	gVisitorTimes += time;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        // Range, angle, rate&lt;br /&gt;
        // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
        llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Two things to do on touch&lt;br /&gt;
        // If its the owner, dump list of visitors&lt;br /&gt;
        // If its not, then give a lm if one exists&lt;br /&gt;
        string visitor = llDetectedKey (0);&lt;br /&gt;
        if (visitor == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
            llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
            gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
            llDialog (visitor, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // get the name of the first landmark in the inventory&lt;br /&gt;
            string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
            if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llGiveInventory(visitor, lm); &lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
&lt;br /&gt;
integer gNotecards = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                llSetTexture (texture_uuid, ALL_SIDES);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                llSetTexture (texture_full, ALL_SIDES);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tint on Touch ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple opacity level changing script.&lt;br /&gt;
// Script cycles through the values on touch.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Tanisha Benoir, Feb 2012&lt;br /&gt;
 &lt;br /&gt;
integer gLowestLevel = 0;    // This is the most transparent setting (0, 1, 2, etc)&lt;br /&gt;
integer gSteps = 4;          // This is the number of steps to support&lt;br /&gt;
&lt;br /&gt;
// Do not change below here&lt;br /&gt;
integer gOpacityLevel = 0;  &lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        gOpacityLevel++;&lt;br /&gt;
        if (gOpacityLevel &amp;gt; gSteps)&lt;br /&gt;
        {&lt;br /&gt;
            gOpacityLevel = gLowestLevel;&lt;br /&gt;
        }&lt;br /&gt;
        float opacity = (1.0/(float)gSteps) * gOpacityLevel;&lt;br /&gt;
        llSetAlpha(opacity, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User_talk:Void_Singer&amp;diff=1163132</id>
		<title>User talk:Void Singer</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User_talk:Void_Singer&amp;diff=1163132"/>
		<updated>2012-02-15T21:52:06Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Comments: ==&lt;br /&gt;
{{message}} Comment Format&lt;br /&gt;
&amp;lt;pre&amp;gt;=== Topic === &amp;lt;-- this line is optional&lt;br /&gt;
{{message}} this is my comment&lt;br /&gt;
~~~~ &amp;lt;-- will be replaced by User Name + Time Stamp automatically&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{message}} welcome all to my User Talk page. Feel Free to leave a message below, and thanks for stopping by! --[[User:Void Singer|Void Singer]] 05:54, 20 November 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
=== Advanced Visitor Greeter ===&lt;br /&gt;
{{message}} Void.  Not had a detailed look, but it would appear that the call to llRegionSayTo has too many parameters ... looks like the edit from oct has broken it ...?&lt;br /&gt;
[[User:Kimm Paulino|Kimm Paulino]] 13:52, 15 February 2012 (PST)&lt;br /&gt;
=== LandMark Teleport Script === &lt;br /&gt;
{{message}} Hello Void! Just wanted to know where I&#039;d put the landmarks and positions in the script and in what format. When you state min. 3 linked prims, what does this mean? Sorry, new to all this. I&#039;ve noticed most teleporters are of &amp;quot;Sit&amp;quot; type and I need to teleport to a location about 2700m from ground level. Any feedback is appreciated. Thank you&lt;br /&gt;
[[User:HDBadBoy Afterthought|HDBadBoy Afterthought]] 11:59, 6 September 2011 (PDT)&lt;br /&gt;
&lt;br /&gt;
:{{message}} the Landmark Teleport script uses the map window to send teleport locations, it work much like the favorite locations bar on V2+ (except for others if you set it out).... no special format is needed for the landmarks, but if you rename them then the hover text it generates for them will use the new name. as for the 3 prims, in the instructions you&#039;ll note that the script itself goes in the root, and you need two more with the name &amp;quot;next&amp;quot; and &amp;quot;prev&amp;quot; which will be buttons for the script to change landmarks.... although it&#039;s important to mention that this is NOT the ideal script for teleport locations on the same region. for that I suggest a [[PosJump]] type of script, which gives you the type of immediate &amp;quot;sit&amp;quot; style action most users expect for local teleports.&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 04:45, 7 September 2011 (PDT)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Re: Formatting [topic added by Void due to page reordering] ===&lt;br /&gt;
{{message}}It looks well thought out. I&#039;m pretty laid back about style as long as it&#039;s consistent. The only thing I put my foot down on is tabs being 4 spaces. All a matter of preference thou. I find prefixing variables with anything other then a letter to indicate type is overkill. I write my LSL as ESL (which is LSL passed through a C precompiler) and I reserve all uppercase lettered names for ESL macro&#039;s and defines. -- [[User:Strife Onizuka|Strife Onizuka]] 03:09, 3 November 2007 (PDT)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;{{message}}Amazing. I&#039;ve been programming for 25 years and have developed a style that chooses the opposite of most of Void&#039;s rules. Why is it that these questions lead to such equally satisfactory results in competent programming organizations that are so different. I suppose that it&#039;s similar to the reason that Spanish isn&#039;t the same as French.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I&#039;ll go Strife one further, though, and put my particular foot down about the insane (to me) verbosity of prefixing variables, function names, etc. with garbage characters that serve no useful purpose I can see, and is constantly bonking the reader who has to read through several largely irrelevant or self-evident characters to get to the important part - what the variable is. It&#039;s like getting tapped on the side of the head with a pencil every time I trip over one of the darn things. Is this another sad legacy of Microsoft? I&#039;d never seen such a thing before I had to start writing Windows code. And I&#039;ll note, I work in RL in an environment where we have several hundred thousand lines of legacy code I have to refer to regularly, (and a couple of legacy programmers) that use &amp;quot;Hungarian&amp;quot; notation like this, and after 10 years of reading it I STILL get tapped every time I see one.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I do have one possibly pertinent point, though. I had been ambivalent about where the brace at the opening of a block goes for a couple years, having programmed in environments for most of my time where they were to be on a (wasteful) line of their own. After spending some time in Java, where the convention tends to be &#039;on the same line&#039; I was still uncertain I had an opinion, except that I really don&#039;t like the effect that mixing the styles has. (That happens with templates, copy/paste, etc.) However, a few weeks ago when working on some poor code (mine) that was too long and nested too deeply I spent quite a while tracking down a missing opening brace. I realized that had it been on its own line I&#039;d have seen it almost immediately. Given modern monitor resolutions and sizes, I don&#039;t think the vertical height saved is worth the obviousness that it exists.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;So there, finally the definitive answer to the &amp;quot;same line or different line&amp;quot; question.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Ah, the style wars, long shall they rage.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the end, as both you and Strife observe, it is all personal preference as modified by the need to be consistent with those you work with. Thanks, much, for taking the time to write it down. I should do it too if I care so much I guess. --[[User:RJ Thibaud|RJ Thibaud]] 12:25, 23 December 2007 (PST)&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RE: style etc ===&lt;br /&gt;
{{message}} heh, thanks for reading it at least, I&#039;m not fanatical about it, each person develops their own style, and to be honest I only adapted the style I normally use for lsl, from my other coding projects, so it&#039;s prone to updates (a few of which I&#039;ve yet to add in). The particular style I use is geared towards maximum understanding of the code for those new to scripting/programming so they can more easily find their way through code. But as noted, for an experienced coder it can be a bit like &#039;duh I know that&#039;. Coming from an enviroment with lots of new coders though, I tend to keep it up for their benefit more than my own. The opening brace debate is long running with me, and I do realize the pro&#039;s and cons, but have gotten myself in the habit of expecting open braces on the same line, and visually reading the statement (if, do, etc) and the indent as opening the statement and even briefly played with inlining the closing statement (but found it interfered with the visual nesting effect sometimes).&lt;br /&gt;
&lt;br /&gt;
I mostly provided the example style as something to explain, rather than recommend, because I was bored enough to write it one day, and had been asked a few times about it. I have found that prefixing of some kind tends to avoid collisions with developing languages like lsl, as I noticed happened once or twice when people named constants or variables that later became LSL constants, and I&#039;ve discouraged a few people from using llFunctionName for that and other reasons (like people that see the call and try to use it elsewhere). I&#039;ts all good though, whatever gets the job done and works as expected. [[User:Void Singer|Void Singer]] 13:35, 25 December 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== 0x80000000 X_X ==&lt;br /&gt;
&lt;br /&gt;
Yep I forgot about 0x80000000. The limit however accepts 2038 and then overflows. So I wrote a version that detects overflows and accepts the entire integer range. It should be noted that if you get clever on it, and give it a year before 1970 but have the final date fall in or after 1970 it will have a fit. Likewise for years after 1969 but the final dates fall before 1970. Could turn off the overflow detection for centrally located years but that&#039;s more work. But it will parse [2100,12,13,23,59, -2147483648] and [1845, 1, 1, 0, 0, 2147483647] properly... i think. =^_^= -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 06:28, 20 January 2010 (UTC)&lt;br /&gt;
:{{message}} I&#039;ll take a look in a bit, and I do like the integer division and bit shift solution in the unix2stamp, much cleaner... in the other, subtracting out 68 less to make the entire range positive... I like that part, shouldve done it from the start (it was converted from a quickie 1970+ version that I think argent did) although I had capped the dates to provide symmetry with the opposite function (since it&#039;s much easier to cap that one on a particular day, and 19 days on the edge seemed a small loss, vs detecting up to the last available second)... haven&#039;t checked the leap day / month detection in the loop replacement but I&#039;ll assume it&#039;s good until I double check. ps, I appreciate the fixes (always something to be learned) but can we separate out revisions that are more than corrections or order changes... it makes it harder to compare versions side by side (as the wiki only gives changed lines)... not complaining, I appreciate the feedback... PPS bad cabbit you didn&#039;t test to be sure? =)&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 23:37, 20 January 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: As I was reading the code, I was like &amp;quot;this code is so evil I think it is something I must have done in a past life&amp;quot;. I really enjoy niggling away at code like this, reducing it to it&#039;s bare essentials. With that loop, once I saw that the sister function shared it, it made sense why you used it, symmetry. Yeah I agree with you about the comparisons being easier but it all sort of rolled out all at once; it didn&#039;t help that I pushed allot of the adjustment math through multiplications and divides. P.S. This version I posted I did check (in LSLEditor, with only minor mods, casting the bools to ints), I wanted to make sure I didn&#039;t screw up the math somewhere. P.S.S. I was considering replacing the (i * 30) with (i &amp;lt;&amp;lt; 5) - (i &amp;lt;&amp;lt; 1) cause it would be theoretically faster to execute but I didn&#039;t because it would probably take longer to setup the registers. P.S.S.S. I really enjoyed the coding (It&#039;s a great piece of code) but I forgot about everything else I was supposed to be doing yesterday; the secretary of my Physical Therapist was nonplussed that I hadn&#039;t called to cancel. *sigh* P.S^4 I was thinking I would work on the sister function, see if the loop can be eliminated altogether. Could do it with a list. A tree of if&#039;s would be better but more expensive. I think instead I&#039;ll trick out [[Float2Hex]] to use my super evil [[User:Strife_Onizuka/int2hex|Int-Base64-Hex converter]]. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 03:47, 21 January 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:{{message}}well I&#039;m glad I could give you something fun to play with, though I am sorry it interfered with your RL schedule (such is the nature of our passions eh?) still haven&#039;t had a chance to poke at it... I&#039;m barely fitting forum posts in between RL concerns =/ stupid RL, always demanding I do things like work and eat and sleep... meh &amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 16:47, 21 January 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:{{message}}&#039;&#039;&#039;Update:&#039;&#039;&#039; looking at it, the month calc doesn&#039;t look right, as it would include the current month and looks to be off by a day for some months... after fiddling with it, I came up with this... &amp;lt;lsl&amp;gt;//rtn = &lt;br /&gt;
86400 *&lt;br /&gt;
(//y -= 1902&lt;br /&gt;
 (int)(y*365.25 + 0.25) - 24837 + // (y&amp;gt;&amp;gt;2)*1461 + (int)((y&amp;amp;3)*365.375) - 24837 +&lt;br /&gt;
 //m -= 1&lt;br /&gt;
 m*30 +(m-(m&amp;lt;7)&amp;gt;&amp;gt;1) + (m&amp;lt;2) - ((y&amp;amp;3)&amp;gt;0)*(m&amp;gt;1) +&lt;br /&gt;
 //d -= 1&lt;br /&gt;
 d) +&lt;br /&gt;
h +&lt;br /&gt;
m +&lt;br /&gt;
s&amp;lt;/lsl&amp;gt; check me on that but I think that&#039;s right for the symmetry capped version. shouldn&#039;t flow unless it&#039;s fed bad m/d/h/n/s, which I could force cap with llAbs(x%#) to prevent, so that even purposely malformed dates would fall in the +/-2145916800 range.&lt;br /&gt;
&lt;br /&gt;
::Interesting solution. Hadn&#039;t thought to use a typecast. That is a great simplification. The problem was probably caused by the right shift, as -1 &amp;gt;&amp;gt; 1 == -1, not the same as -1 / 2 == 0. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 20:17, 24 January 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:{{message}} I did finally figure out that the extra months says were being subtracted out of the year calc, but had to abandon that for protection of missing months. I did note  &amp;quot;&amp;amp;&amp;amp; ((vIntYear - 100) % 200)&amp;quot; was overkill, since those dates would fall outside the full valid range anyhow.&lt;br /&gt;
:&amp;quot;1+(d-(5+(y==4))/30&amp;quot; is as far as I got on loop replacement for the sister function, too hard to calculate a variable cutoff for a variable number based on that number... I may test whether an if structure will be smaller or faster.. or maybe a string or list with cutoff dates.. not as elegent as I&#039;d have liked but ::shrug:: whatever works.&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 00:01, 25 January 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== References to forum threads ==&lt;br /&gt;
{{message}}The references to these threads: http://forums.secondlife.com/showthread.php?t=108960 and http://forums.secondlife.com/showthread.php?t=109571 in the caveat on throttling on the [[llHTTPRequest]] page are now broken. Did your archive project manage to catch any of theses? If so is it possible to distill the relevant info from them and add it to the page? [[User:Pete Olihenge|Pete Olihenge]] 10:18, 16 February 2010 (UTC) PS: I mean if you can give me access to the text of those threads, I can have a go at making a précis.&lt;br /&gt;
&lt;br /&gt;
{{message}}I&#039;ll take a look today, I didn&#039;t archive them by their thread ID&#039;s but rather by their page titles (or part thereof), but the links should still be in the page in print view, so I&#039;ll run text search and see if anything turns up... Gromlocks case probably won&#039;t be helped by self throttling, but I did think about that when he posted.&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 15:56, 16 February 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:oh gods, you didn&#039;t just spider the forums? -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 17:08, 16 February 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
::@Strife: I know, but with the load it was experiencing (probably from unthrottled spider requests =P), the fact that I didn&#039;t have anything on hand to do it with, and I wanted relevant description on the file names it was faster to just do a quick link rewrite to get the print view, and grab the pages manually.... it&#039;s only about 23*40 pages or so.... I just went after the most valuable stuff to cut down on chatter, so library scripts, a few posts I had bookmarked, and stickies.... what can I say, I was really busy doing other stuff too, and the archiving was what I was doing in between.... unfortunately I&#039;m going to need to do a parser for the broken bbcode, because you&#039;rs won&#039;t work on print view pages, even after adding the local url and setting fileIsGreasable... c&#039;est la vie &lt;br /&gt;
&lt;br /&gt;
::PS. when you have a chance, can you show me what I might change in Template:void-box so that when clicking edit on the container in a page I get the content of the box to edit, instead of the template page? my wiki foo is weak. I love the layout / ease of use, but would like to make it more functional so I don&#039;t have to do full page edits for just a single box (plus then others can use it easier too)&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 23:07, 16 February 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
{{message}} sorry Pete, it&#039;s not in there, unfortunately the wiki pages don&#039;t have something similar (though it&#039;s the same setup as a notecard reader which there are examples of) &amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 23:25, 16 February 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:As to fixing the template... I haven&#039;t ever found a solution. It was the original reason LSL documents had section editing turned off (now the templates are so complex that edit links don&#039;t make sense). Shoot, I nearly forgot I need to make a template for Operators. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 06:16, 17 February 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
{{message}} Note to self: fix those links when the forum archives come online. Hmm, that page is a bit... forbidding? [[User:Pete Olihenge|Pete Olihenge]] 07:32, 17 February 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== RE: list format to Unix timestamp ===&lt;br /&gt;
{{message}} hello. I&#039;m using for over a year your u2StampUnixInt function and I have found a bug. If I submit at your function a time superior at 2010 2 28 with 0h00 (example [2010,3,14,0,0,0]) the day is additionned of 1 day.&lt;br /&gt;
[[User:Elenia Boucher|Elenia Boucher]] 19:58, 14 March 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
{{message}} Thanks for that Elenia I found the bug, and posted the corrected change (there was a bad transposed leap year calculation)... should work fine now, and again, thank you &amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 06:39, 17 March 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== nPose wiki page ==&lt;br /&gt;
&lt;br /&gt;
Hi, Void.   I&#039;ve been trying to contact you via the blogorum messaging system, but it claims you don&#039;t exist! (I&#039;ve stared a jira about that about that http://jira.secondlife.com/browse/WEB-1622).  &lt;br /&gt;
&lt;br /&gt;
Anyway, Nandana Singh has asked me to help with the admin and distribution for nPose, and I&#039;d like to take up your suggestion of posting the code in the wiki as well as continuing to distribute it in world via the GridShout system.   I&#039;m going to need some help setting up the pages, though, and I&#039;m wondering if you could assist me with this some time over the next week or so.&lt;br /&gt;
&lt;br /&gt;
I&#039;ll watch this page, though maybe you&#039;ll have better luck with the messaging system than have I.   Or you could reach me via SLU.&lt;br /&gt;
&lt;br /&gt;
[[User:Innula Zenovka|Innula Zenovka]] 12:11, 28 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Hi Inunla, more than happy to help, I&#039;ve setup an easy to edit basis on a [[User:Nandana_Singh/nPose|sub page of Nandana&#039;s user page]], with a link to and from [[User:Nandana_Singh|her main user page]], and can add another link to the library once it&#039;s all in place. if you have any trouble getting it working right, just paste plain text of the information that needs to go the page below the existing content (PS use the edit tab at the top of the page to add content, the in-page edit links can&#039;t be made to work, and apparently can&#039;t be removed just for templates).&lt;br /&gt;
:as for the problem with messaging me on the blogorums, use a period instead of a space in my name and it should work, although I often miss them for days =X &amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 09:11, 29 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Re: Weekday from ( Y, M, D ) format ==&lt;br /&gt;
{{message}} [http://mathforum.org/library/drmath/view/55837.html This item] may be of relevance and/or interest; the author claims the algorithm to be accurate for &#039;&#039;any&#039;&#039; date. I came across it via the [http://lslwiki.net/lslwiki/wakka.php?wakka=llGetTimestamp llGetTimestamp page in the old waka ]. [[User:Pete Olihenge|Pete Olihenge]] 02:27, 31 July 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1162336</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1162336"/>
		<updated>2012-02-01T22:36:27Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Added option to read UUIDs from notecards&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;	 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;      // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
    if (gJustDates)&lt;br /&gt;
    {&lt;br /&gt;
	gVisitorTimes += llGetDate();&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
	string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
	gVisitorTimes += time;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        // Range, angle, rate&lt;br /&gt;
        // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
        llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Two things to do on touch&lt;br /&gt;
        // If its the owner, dump list of visitors&lt;br /&gt;
        // If its not, then give a lm if one exists&lt;br /&gt;
        string visitor = llDetectedKey (0);&lt;br /&gt;
        if (visitor == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
            llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
            gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
            llDialog (visitor, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // get the name of the first landmark in the inventory&lt;br /&gt;
            string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
            if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llGiveInventory(visitor, lm); &lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// either from the prims inventory or specified by UUID in a notecard.&lt;br /&gt;
//&lt;br /&gt;
// Notecard lines have the form:&lt;br /&gt;
//    Texture Name=UUID&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Feb 2012&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
&lt;br /&gt;
integer gNotecards = FALSE;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
list gTextureUUIDs;&lt;br /&gt;
&lt;br /&gt;
string gNotecardName;&lt;br /&gt;
integer gNotecardLine = 0;&lt;br /&gt;
key gQueryID;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_inventory ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return gNumTextures;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer read_textures_from_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    // Read texture information from the first notecard in inventory&lt;br /&gt;
    gNotecardName = llGetInventoryName(INVENTORY_NOTECARD, 0);&lt;br /&gt;
    if (gNotecardName == &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (gNotecards)&lt;br /&gt;
        {&lt;br /&gt;
            string texture_uuid = llList2Key (gTextureUUIDs, idx);&lt;br /&gt;
            if (texture_uuid != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_uuid);&lt;br /&gt;
                llSetTexture (texture_uuid, ALL_SIDES);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
            if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
            {&lt;br /&gt;
                // This is the one&lt;br /&gt;
                doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
                llSetTexture (texture_full, ALL_SIDES);&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (read_textures_from_inventory())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures in the inventory and have read them&lt;br /&gt;
            gNotecards = FALSE;&lt;br /&gt;
        }&lt;br /&gt;
        else if (read_textures_from_notecards())&lt;br /&gt;
        {&lt;br /&gt;
            // We have textures read in from a notecard by UUID&lt;br /&gt;
            // (or will have pretty soon)&lt;br /&gt;
            gNotecards = TRUE;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay (&amp;quot;Note: There are no textures or notecards in this prim ...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    dataserver(key query_id, string line)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id == gQueryID)&lt;br /&gt;
        {&lt;br /&gt;
            if (line != EOF)&lt;br /&gt;
            {&lt;br /&gt;
                if (llSubStringIndex (line, &amp;quot;=&amp;quot;) != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    list vals = llParseString2List (line, [&amp;quot;=&amp;quot;], []);&lt;br /&gt;
                    &lt;br /&gt;
                    // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
                    // show in a dialog anyway&lt;br /&gt;
                    string texture = llList2String (vals, 0);&lt;br /&gt;
                    string uuid = llList2Key (vals, 1);&lt;br /&gt;
                    gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
                    gTextureUUIDs += uuid;&lt;br /&gt;
                    doDebug (&amp;quot;Adding: &amp;quot; + texture + &amp;quot; (&amp;quot;+uuid+&amp;quot;)&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
                // Now get the next line&lt;br /&gt;
                gNotecardLine++;&lt;br /&gt;
                gQueryID = llGetNotecardLine(gNotecardName, gNotecardLine);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                gNumTextures = llGetListLength (gTextures);&lt;br /&gt;
                doDebug (&amp;quot;Found &amp;quot; + (string)gNumTextures + &amp;quot; textures.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1162279</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1162279"/>
		<updated>2012-01-30T20:25:51Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Added simple prim lighting script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;	 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;      // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
    if (gJustDates)&lt;br /&gt;
    {&lt;br /&gt;
	gVisitorTimes += llGetDate();&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
	string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
	gVisitorTimes += time;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        // Range, angle, rate&lt;br /&gt;
        // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
        llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Two things to do on touch&lt;br /&gt;
        // If its the owner, dump list of visitors&lt;br /&gt;
        // If its not, then give a lm if one exists&lt;br /&gt;
        string visitor = llDetectedKey (0);&lt;br /&gt;
        if (visitor == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
            llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
            gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
            llDialog (visitor, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // get the name of the first landmark in the inventory&lt;br /&gt;
            string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
            if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llGiveInventory(visitor, lm); &lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// from the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// December 2011&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gReshow = TRUE;&lt;br /&gt;
&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_textures ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no textures in this prim ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
        if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
            llSetTexture (texture_full, ALL_SIDES);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        read_textures();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Lighting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lighting (prim glow) script&lt;br /&gt;
//&lt;br /&gt;
// Lighting toggled on touch.&lt;br /&gt;
//&lt;br /&gt;
// For a version of this script that includes remote switching&lt;br /&gt;
// and multi-prim switching functionality, see:&lt;br /&gt;
// http://kimmscripts.wordpress.com/2011/11/23/simple-remote-lighting/&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// January 2012&lt;br /&gt;
&lt;br /&gt;
// Properties of the light you may wish to change&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
// LIGHT = TRUE or FALSE - turns the light on or off (lights contribute to lag in SL)&lt;br /&gt;
integer LIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// BRIGHT = TRUE or FALSE - turns brightness on or off (less laggy than lights)&lt;br /&gt;
integer BRIGHT = TRUE;&lt;br /&gt;
&lt;br /&gt;
// GLOW = Range 0.0 to 1.0 - dim to full glow&lt;br /&gt;
float GLOW = 1.0;&lt;br /&gt;
&lt;br /&gt;
// See: http://lslwiki.net/lslwiki/wakka.php?wakka=color&lt;br /&gt;
vector COLOUR = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Intensity of the radiated light - range 0.0 to 1.0&lt;br /&gt;
float INTENSITY = 1.0;    &lt;br /&gt;
&lt;br /&gt;
// Radius of the radiated light (in metres) - range 0.1 to 20.0&lt;br /&gt;
float RADIUS = 5.0;&lt;br /&gt;
&lt;br /&gt;
// Rate light decays - range 0.01 to 2.0 (no decay to quick decay)&lt;br /&gt;
float FALLOFF = 0.5;&lt;br /&gt;
&lt;br /&gt;
// See: http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
integer FACE = ALL_SIDES;&lt;br /&gt;
// ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
integer gOn = FALSE;&lt;br /&gt;
&lt;br /&gt;
on ()&lt;br /&gt;
{&lt;br /&gt;
    // Turn on to the required settings&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, LIGHT, COLOUR, INTENSITY, RADIUS, FALLOFF,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, BRIGHT,&lt;br /&gt;
            PRIM_GLOW, FACE, GLOW&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
off ()&lt;br /&gt;
{&lt;br /&gt;
    llSetPrimitiveParams([&lt;br /&gt;
            PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 0.0,&lt;br /&gt;
            PRIM_FULLBRIGHT, FACE, FALSE,&lt;br /&gt;
            PRIM_GLOW, FACE, FALSE&lt;br /&gt;
            ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
performLightCmd ()&lt;br /&gt;
{&lt;br /&gt;
    if (gOn)&lt;br /&gt;
    {&lt;br /&gt;
        off();&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        on();&lt;br /&gt;
        gOn = TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        gOn = FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        performLightCmd();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1161697</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1161697"/>
		<updated>2012-01-19T21:22:57Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Move up and down */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
// Update: Jan 2012&lt;br /&gt;
//  Add correction factor to correct for but SVC2441, when an&lt;br /&gt;
//  object will descend too fast.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
 &lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
 &lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
float DOWN_CORRECTION=1.5;  // Use trial-and-error to correct for SVC-2441&lt;br /&gt;
 &lt;br /&gt;
// Move to 2m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 2.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
 &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            // Need to compensate (a bit) for SVC-2441&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING*DOWN_CORRECTION);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;	 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;      // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
    if (gJustDates)&lt;br /&gt;
    {&lt;br /&gt;
	gVisitorTimes += llGetDate();&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
	string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
	gVisitorTimes += time;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        // Range, angle, rate&lt;br /&gt;
        // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
        llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Two things to do on touch&lt;br /&gt;
        // If its the owner, dump list of visitors&lt;br /&gt;
        // If its not, then give a lm if one exists&lt;br /&gt;
        string visitor = llDetectedKey (0);&lt;br /&gt;
        if (visitor == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
            llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
            gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
            llDialog (visitor, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // get the name of the first landmark in the inventory&lt;br /&gt;
            string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
            if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llGiveInventory(visitor, lm); &lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// from the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// December 2011&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gReshow = TRUE;&lt;br /&gt;
&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_textures ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no textures in this prim ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
        if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
            llSetTexture (texture_full, ALL_SIDES);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        read_textures();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1161468</id>
		<title>User:Kimm Paulino</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1161468"/>
		<updated>2012-01-15T22:39:40Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{skills&lt;br /&gt;
|Architect=&lt;br /&gt;
|Builder=&lt;br /&gt;
|Machinima=&lt;br /&gt;
|Roleplayer=&lt;br /&gt;
|Scenographer=&lt;br /&gt;
|Scripter=*&lt;br /&gt;
|SLogistician=&lt;br /&gt;
|Terraformer=&lt;br /&gt;
|}}&lt;br /&gt;
&lt;br /&gt;
=== About ===&lt;br /&gt;
&lt;br /&gt;
Been in SL since September 2008.  Slowly started experimenting more with scripting during that time.  Usually happy to say &#039;hi&#039;.&lt;br /&gt;
&lt;br /&gt;
At the moment, I am fairly well preoccupied helping set up http://synzcreations.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
Users with good scripting info:&lt;br /&gt;
* [[User:Becky Pippen]]&lt;br /&gt;
* [[User:Fred Gandt]]&lt;br /&gt;
* [[User:Void Singer]]&lt;br /&gt;
* [[User:Opensource_Obscure]]&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
List most scripters, I&#039;ve collected various scripting odds and ends and share a few of them here for good measure in case they are of wider use.  They are provided &#039;as is&#039; for free use.  I make no claim about their fitness for purpose. If I&#039;ve used something from a resource somewhere I&#039;ve tried to include a credit, but if I&#039;ve missed any - sorry!  Do let me know and I&#039;ll add it back in.&lt;br /&gt;
&lt;br /&gt;
Feel free to drop me a im if you find anything useful. Unfortunately I am unlikely to be able to answer questions about them.  If you have scripting questions, try the in-world scripting groups.&lt;br /&gt;
&lt;br /&gt;
* http://kimmscripts.wordpress.com/ - help and usage information&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts]] - the scripts themselves&lt;br /&gt;
* http://kimmscripts.wordpress.com/about/ - my views on scripting&lt;br /&gt;
&lt;br /&gt;
=== Scripting Tips and Techniques ===&lt;br /&gt;
&lt;br /&gt;
Optimisations and Memory Efficient Scripting:&lt;br /&gt;
* [[User:Void Singer/Optimizations]]&lt;br /&gt;
* [[LSL_Script_Memory]]&lt;br /&gt;
* http://www.lslwiki.net/lslwiki/wakka.php?wakka=MemoryUsage&lt;br /&gt;
* [[User:Becky Pippen/Script_Memory_Limits]]&lt;br /&gt;
&lt;br /&gt;
Other stuff&lt;br /&gt;
* https://wiki.secondlife.com/wiki/Category:LSL_Avatar/Name&lt;br /&gt;
* [[User:Void_Singer/Rotations]], also SLU Tutorials on rotations [http://www.sluniverse.com/php/vb/tutorials/62235-basic-introduction-rotations.html here] and [http://www.sluniverse.com/php/vb/tutorials/62479-introduction-rotations-translations-rotation-tutorial.html here]&lt;br /&gt;
&lt;br /&gt;
=== Open Source or Freely Available Scripting Systems ===&lt;br /&gt;
&lt;br /&gt;
This is a list of personal bookmarks for things I&#039;ve found interesting, not an exaustive list - see the [http://community.secondlife.com/t5/LSL-Library/bd-p/LSLScriptingLibrary Library Forum] and [[LSL_Library]] wiki pages for that.&lt;br /&gt;
&lt;br /&gt;
* [[User:Nandana_Singh/nPose]]&lt;br /&gt;
* [[User:Rufus_Darkfold/PrimControl_HUD]]&lt;br /&gt;
* [[XyzzyText]]&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1161467</id>
		<title>User:Kimm Paulino</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1161467"/>
		<updated>2012-01-15T22:38:55Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{skills&lt;br /&gt;
|Architect=&lt;br /&gt;
|Builder=&lt;br /&gt;
|Machinima=&lt;br /&gt;
|Roleplayer=&lt;br /&gt;
|Scenographer=&lt;br /&gt;
|Scripter=*&lt;br /&gt;
|SLogistician=&lt;br /&gt;
|Terraformer=&lt;br /&gt;
|}}&lt;br /&gt;
&lt;br /&gt;
=== About ===&lt;br /&gt;
&lt;br /&gt;
Been in SL since September 2008.  Slowly started experimenting more with scripting during that time.  Usually happy to say &#039;hi&#039;.&lt;br /&gt;
&lt;br /&gt;
At the moment, I am fairly well preoccupied helping set up http://synzcreations.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
Users with good scripting info:&lt;br /&gt;
* [[User:Becky Pippen]]&lt;br /&gt;
* [[User:Fred Gandt]]&lt;br /&gt;
* [[User:Void Singer]]&lt;br /&gt;
* [[User:Opensource_Obscure]]&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
List most scripters, I&#039;ve collected various scripting odds and ends and share a few of them here for good measure in case they are of wider use.  They are provided &#039;as is&#039; for free use.  I make no claim about their fitness for purpose. If I&#039;ve used something from a resource somewhere I&#039;ve tried to include a credit, but if I&#039;ve missed any - sorry!  Do let me know and I&#039;ll add it back in.&lt;br /&gt;
&lt;br /&gt;
Feel free to drop me a im if you find anything useful. Unfortunately I am unlikely to be able to answer questions about them.  If you have scripting questions, try the in-world scripting groups.&lt;br /&gt;
&lt;br /&gt;
* http://kimmscripts.wordpress.com/ - help and usage information&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts]] - the scripts themselves&lt;br /&gt;
&lt;br /&gt;
=== Scripting Tips and Techniques ===&lt;br /&gt;
&lt;br /&gt;
Optimisations and Memory Efficient Scripting:&lt;br /&gt;
* [[User:Void Singer/Optimizations]]&lt;br /&gt;
* [[LSL_Script_Memory]]&lt;br /&gt;
* http://www.lslwiki.net/lslwiki/wakka.php?wakka=MemoryUsage&lt;br /&gt;
* [[User:Becky Pippen/Script_Memory_Limits]]&lt;br /&gt;
&lt;br /&gt;
Other stuff&lt;br /&gt;
* https://wiki.secondlife.com/wiki/Category:LSL_Avatar/Name&lt;br /&gt;
* [[User:Void_Singer/Rotations]], also SLU Tutorials on rotations [http://www.sluniverse.com/php/vb/tutorials/62235-basic-introduction-rotations.html here] and [http://www.sluniverse.com/php/vb/tutorials/62479-introduction-rotations-translations-rotation-tutorial.html here]&lt;br /&gt;
&lt;br /&gt;
=== Open Source or Freely Available Scripting Systems ===&lt;br /&gt;
&lt;br /&gt;
This is a list of personal bookmarks for things I&#039;ve found interesting, not an exaustive list - see the [http://community.secondlife.com/t5/LSL-Library/bd-p/LSLScriptingLibrary Library Forum] and [[LSL_Library]] wiki pages for that.&lt;br /&gt;
&lt;br /&gt;
* [[User:Nandana_Singh/nPose]]&lt;br /&gt;
* [[User:Rufus_Darkfold/PrimControl_HUD]]&lt;br /&gt;
* [[XyzzyText]]&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1161464</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1161464"/>
		<updated>2012-01-15T22:25:09Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Dialog Texture Changer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
&lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
&lt;br /&gt;
// Move to 1m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 1.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
        &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;	 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;      // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
    if (gJustDates)&lt;br /&gt;
    {&lt;br /&gt;
	gVisitorTimes += llGetDate();&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
	string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
	gVisitorTimes += time;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        // Range, angle, rate&lt;br /&gt;
        // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
        llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Two things to do on touch&lt;br /&gt;
        // If its the owner, dump list of visitors&lt;br /&gt;
        // If its not, then give a lm if one exists&lt;br /&gt;
        string visitor = llDetectedKey (0);&lt;br /&gt;
        if (visitor == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
            llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
            gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
            llDialog (visitor, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // get the name of the first landmark in the inventory&lt;br /&gt;
            string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
            if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llGiveInventory(visitor, lm); &lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// from the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// December 2011&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gReshow = TRUE;&lt;br /&gt;
&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_textures ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no textures in this prim ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
        if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
            llSetTexture (texture_full, ALL_SIDES);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        read_textures();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1161455</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1161455"/>
		<updated>2012-01-15T22:08:51Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: Added dialog texture changer (and fixed some formatting)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
&lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
&lt;br /&gt;
// Move to 1m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 1.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
        &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;        // Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;                // Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;    // Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;            // Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;            // of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;        // What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
    if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (gErrorMsg);&lt;br /&gt;
        disableMove();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
    {&lt;br /&gt;
        if (gLoop)&lt;br /&gt;
        {&lt;br /&gt;
            // Loop around for another go&lt;br /&gt;
            gCurrentIdx = 0;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // All complete&lt;br /&gt;
            disableMove();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
    rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        if (gPhysics)&lt;br /&gt;
        {&lt;br /&gt;
            llMoveToTarget(next_pos, gTau);&lt;br /&gt;
            llLookAt(next_pos,1,1);&lt;br /&gt;
            llRotLookAt(next_rot,1,1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
//            doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
            llSetRot (next_rot);&lt;br /&gt;
            llSetPos (next_pos);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Move on to the next point&lt;br /&gt;
    gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
    list buttons;&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
    }&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
    if (gPhysics)&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
        llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
        llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
    }&lt;br /&gt;
    llSetTimerEvent (gTimePeriod);&lt;br /&gt;
    gCurrentIdx = 0;&lt;br /&gt;
    doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
    doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
    llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
    llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
        // inventory have rerez it with the same path stored.&lt;br /&gt;
        //&lt;br /&gt;
        // Means that if they do want to clear the path, say because&lt;br /&gt;
        // the position in the Sim has changed, then they have to use&lt;br /&gt;
        // the &#039;reset&#039; option.&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() &lt;br /&gt;
    {   &lt;br /&gt;
        llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
        gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer who)&lt;br /&gt;
    {&lt;br /&gt;
        gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
        {&lt;br /&gt;
            dialog();&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            if (!gLoop)&lt;br /&gt;
            {&lt;br /&gt;
                // Let nearby users start the moving&lt;br /&gt;
                llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        vector pos = llGetPos();&lt;br /&gt;
        rotation rot = llGetRot();&lt;br /&gt;
        &lt;br /&gt;
        if (channel == LISTEN_CH)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
            {&lt;br /&gt;
                enableMove();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // non-owners can&#039;t do anything else&lt;br /&gt;
            if (id != gOwnerId)&lt;br /&gt;
            {&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
                &lt;br /&gt;
            if (msg == SAVE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gPositionData += pos;&lt;br /&gt;
                gRotationData += rot;&lt;br /&gt;
                dialog ();&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == STOP_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                disableMove();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == RESET_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == TIME_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == TAU_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
                llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
            } &lt;br /&gt;
            else if (msg == DONE_BTN)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (channel == TIME_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTimePeriod = (float)msg;&lt;br /&gt;
            llListenRemove (gTimeHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
&lt;br /&gt;
        if (channel == TAU_CH)&lt;br /&gt;
        {&lt;br /&gt;
            gTau = (float)msg;&lt;br /&gt;
            llListenRemove (gTauHandle);&lt;br /&gt;
            llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
        } &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    changed(integer ch)&lt;br /&gt;
    {&lt;br /&gt;
        if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
        {&lt;br /&gt;
            if (gResetOnOwnerChange)&lt;br /&gt;
            {&lt;br /&gt;
                // This will clear out all stored positions of course!&lt;br /&gt;
                llResetScript();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
         doMove();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;	 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;      // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
    if (gJustDates)&lt;br /&gt;
    {&lt;br /&gt;
	gVisitorTimes += llGetDate();&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
	string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
	gVisitorTimes += time;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        // Range, angle, rate&lt;br /&gt;
        // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
        llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Two things to do on touch&lt;br /&gt;
        // If its the owner, dump list of visitors&lt;br /&gt;
        // If its not, then give a lm if one exists&lt;br /&gt;
        string visitor = llDetectedKey (0);&lt;br /&gt;
        if (visitor == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
            llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
            gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
            llDialog (visitor, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // get the name of the first landmark in the inventory&lt;br /&gt;
            string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
            if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llGiveInventory(visitor, lm); &lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;                    // HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;        // UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Use the group from the prim&lt;br /&gt;
            gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // See if there are landmarks to give out&lt;br /&gt;
        gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
        gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
        gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        list buttons=[];&lt;br /&gt;
        if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
        }&lt;br /&gt;
        integer i;&lt;br /&gt;
        for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
        {&lt;br /&gt;
            llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_landmark(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_link(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_group(id);&lt;br /&gt;
        }&lt;br /&gt;
        else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            give_notecard(id);&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;    // See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
    integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    integer i;&lt;br /&gt;
    string  htmlnote;&lt;br /&gt;
    gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
        {&lt;br /&gt;
            gNCLine = 0;&lt;br /&gt;
            gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
    // if got here then there is no notecard with HTML info in it,&lt;br /&gt;
    // so show the current page and return&lt;br /&gt;
    show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
    if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (gHtmlPage);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
    }&lt;br /&gt;
    // note that this is limited to 1024 characters&lt;br /&gt;
    // See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
    llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,    // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,        // Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,        // The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,            // The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,        // Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,        //   rounded up to nearest power of 2.&lt;br /&gt;
             PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
            PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
            ]);&lt;br /&gt;
&lt;br /&gt;
    // Request a new Tiny URL for this data&lt;br /&gt;
    gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        check_notecards();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if (query_id != gNCQueryId)&lt;br /&gt;
        {&lt;br /&gt;
            // Not for us&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (data == EOF)&lt;br /&gt;
        {&lt;br /&gt;
            // All done&lt;br /&gt;
            show_html_page();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
        gHtmlPage += data;&lt;br /&gt;
        &lt;br /&gt;
        // and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
        {&lt;br /&gt;
            check_notecards();&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;
        if (request_id == gUrlReqId)&lt;br /&gt;
        {&lt;br /&gt;
            if (status == 200)&lt;br /&gt;
            {&lt;br /&gt;
                gTinyUrl = body;&lt;br /&gt;
                llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
                gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the notecard that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
        if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            llGiveInventory (id, nc_full);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumNotecards == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_nc = gMenuPage * 9;&lt;br /&gt;
    integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
    if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_nc indexed from 0, but&lt;br /&gt;
        // gNumNotecards is indexed from 1&lt;br /&gt;
        last_nc = gNumNotecards-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
//    llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//    llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//    llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage == 0)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        buttons += [MENU_TOP];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        // Would be less laggy to close listen when not in use&lt;br /&gt;
        // but then if two people attempted to use the giver,&lt;br /&gt;
        // it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
        // use it at the same time ...&lt;br /&gt;
        llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                give_notecard (id, msg);&lt;br /&gt;
            }&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dialog Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of textures&lt;br /&gt;
// from the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the texture names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two textures have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Aug 2011&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gReshow = FALSE;&lt;br /&gt;
&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
list gTextures;&lt;br /&gt;
&lt;br /&gt;
integer gListenChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
float     gListenTimer;&lt;br /&gt;
float     LISTEN_TIMEOUT=300.0;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
    if (gDebug)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (msg);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
    // Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
    // Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
    // Always leaves sign bit unset (so is always positive)&lt;br /&gt;
    integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_textures ()&lt;br /&gt;
{&lt;br /&gt;
    gNumTextures = llGetInventoryNumber (INVENTORY_TEXTURE);&lt;br /&gt;
    gTextures = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay (&amp;quot;Note: There are no textures in this prim ...&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture = llGetInventoryName (INVENTORY_TEXTURE, i);&lt;br /&gt;
        // Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
        // show in a dialog anyway&lt;br /&gt;
        gTextures += [llGetSubString (texture, 0, 23)];&lt;br /&gt;
        doDebug (&amp;quot;read_textures: adding texture: &amp;quot; + texture);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apply_texture (string texture)&lt;br /&gt;
{&lt;br /&gt;
    integer idx = llListFindList (gTextures, [texture]);&lt;br /&gt;
    if (idx == -1)&lt;br /&gt;
    {&lt;br /&gt;
        // Didn&#039;t find it in the list - might not be a texture&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Now need to find the texture that matches from the inventory&lt;br /&gt;
    // and give it out&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumTextures ; i++)&lt;br /&gt;
    {&lt;br /&gt;
        string texture_full = llGetInventoryName(INVENTORY_TEXTURE, i);&lt;br /&gt;
        if (llGetSubString (texture_full, 0, 23) == texture)&lt;br /&gt;
        {&lt;br /&gt;
            // This is the one&lt;br /&gt;
            doDebug (&amp;quot;apply_texture: applying texture: &amp;quot; + texture_full);&lt;br /&gt;
            llSetTexture (texture_full, ALL_SIDES);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
    &lt;br /&gt;
    if (gNumTextures == 0)&lt;br /&gt;
    {&lt;br /&gt;
        do_dialog (id, &amp;quot;There are no textures to select at present.&amp;quot;, []);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // If several people are using the giver, then it is possible&lt;br /&gt;
    // for gMenuPage to go negative or too high&lt;br /&gt;
    if (gMenuPage &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        // Reset ...&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
    integer num_pages = ((gNumTextures+8)/9);&lt;br /&gt;
    if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
    {&lt;br /&gt;
        // gMenuPage is an index starting at 0...&lt;br /&gt;
        // max is a 1...&lt;br /&gt;
        gMenuPage = num_pages-1;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Note: This yields notecards counting as follows:&lt;br /&gt;
    // 0 to 8 = first page,&lt;br /&gt;
    // 9 to 17 = next page, etc&lt;br /&gt;
    integer first_texture = gMenuPage * 9;&lt;br /&gt;
    integer last_texture = first_texture + 9 - 1;&lt;br /&gt;
    if (last_texture &amp;gt;= gNumTextures)&lt;br /&gt;
    {&lt;br /&gt;
        // recall last_texture indexed from 0, but&lt;br /&gt;
        // gNumTextures is indexed from 1&lt;br /&gt;
        last_texture = gNumTextures-1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (num_pages &amp;gt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        if (gMenuPage &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_BACK];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (gMenuPage == 0)&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }    &lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_TOP];&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // If not on the last page, and there are more pages to come ...&lt;br /&gt;
        if (gNumTextures &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_NEXT];&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            buttons += [MENU_SPACE];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_texture; (i &amp;lt;= last_texture) &amp;amp;&amp;amp; (i &amp;lt; gNumTextures); i++)&lt;br /&gt;
    {&lt;br /&gt;
        buttons += [llList2String (gTextures, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    do_dialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
do_dialog (key id, string msg, list buttons)&lt;br /&gt;
{&lt;br /&gt;
    llListenRemove (gListenHandle);&lt;br /&gt;
    gListenChannel = getRandomChannel();&lt;br /&gt;
    gListenHandle = llListen (gListenChannel, &amp;quot;&amp;quot;, id, &amp;quot;&amp;quot;);&lt;br /&gt;
    llSetTimerEvent (LISTEN_TIMEOUT);&lt;br /&gt;
    llDialog (id, msg, buttons, gListenChannel);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        read_textures();&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
        // with several people trying to touch it at the same time - it will&lt;br /&gt;
        // always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
        // happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
        // Eventually, they will sort themselves out!&lt;br /&gt;
        gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel == gListenChannel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
            {&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                // should be something in the inventory to give out&lt;br /&gt;
                apply_texture (msg);&lt;br /&gt;
                &lt;br /&gt;
                // reshow the dialog&lt;br /&gt;
                if (gReshow)&lt;br /&gt;
                {&lt;br /&gt;
                    show_dialog(id);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // First see if we are timing out on a listen event&lt;br /&gt;
        if (gListenHandle != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Remove the old listen&lt;br /&gt;
            llListenRemove (gListenHandle);&lt;br /&gt;
            gListenHandle = 0;&lt;br /&gt;
            gListenChannel = 0;&lt;br /&gt;
        }&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;
        {&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1161173</id>
		<title>User:Kimm Paulino</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1161173"/>
		<updated>2012-01-11T22:33:39Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Open Source or Freely Available Scripting Systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{skills&lt;br /&gt;
|Architect=&lt;br /&gt;
|Builder=&lt;br /&gt;
|Machinima=&lt;br /&gt;
|Roleplayer=&lt;br /&gt;
|Scenographer=&lt;br /&gt;
|Scripter=*&lt;br /&gt;
|SLogistician=&lt;br /&gt;
|Terraformer=&lt;br /&gt;
|}}&lt;br /&gt;
&lt;br /&gt;
=== About ===&lt;br /&gt;
&lt;br /&gt;
Been in SL since September 2008.  Slowly started experimenting more with scripting during that time.  Usually happy to say &#039;hi&#039;.&lt;br /&gt;
&lt;br /&gt;
At the moment, I am fairly well preoccupied helping set up http://synzcreations.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
Other users with good scripting info:&lt;br /&gt;
* [[User:Becky Pippen]]&lt;br /&gt;
* [[User:Fred Gandt]]&lt;br /&gt;
* [[User:Void Singer]]&lt;br /&gt;
* [[User:Opensource_Obscure]]&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
List most scripters, I&#039;ve collected various scripting odds and ends and share a few of them here for good measure in case they are of wider use.  They are provided &#039;as is&#039; for free use.  I make no claim about their fitness for purpose. If I&#039;ve used something from a resource somewhere I&#039;ve tried to include a credit, but if I&#039;ve missed any - sorry!  Do let me know and I&#039;ll add it back in.&lt;br /&gt;
&lt;br /&gt;
Feel free to drop me a im if you find anything useful. Unfortunately I am unlikely to be able to answer questions about them.  If you have scripting questions, try the in-world scripting groups.&lt;br /&gt;
&lt;br /&gt;
* http://kimmscripts.wordpress.com/ - help and usage information&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts]] - the scripts themselves&lt;br /&gt;
&lt;br /&gt;
=== Scripting Tips and Techniques ===&lt;br /&gt;
&lt;br /&gt;
Optimisations and Memory Efficient Scripting:&lt;br /&gt;
* [[User:Void Singer/Optimizations]]&lt;br /&gt;
* [[LSL_Script_Memory]]&lt;br /&gt;
* http://www.lslwiki.net/lslwiki/wakka.php?wakka=MemoryUsage&lt;br /&gt;
* [[User:Becky Pippen/Script_Memory_Limits]]&lt;br /&gt;
&lt;br /&gt;
Other stuff&lt;br /&gt;
* https://wiki.secondlife.com/wiki/Category:LSL_Avatar/Name&lt;br /&gt;
* [[User:Void_Singer/Rotations]], also SLU Tutorials on rotations [http://www.sluniverse.com/php/vb/tutorials/62235-basic-introduction-rotations.html here] and [http://www.sluniverse.com/php/vb/tutorials/62479-introduction-rotations-translations-rotation-tutorial.html here]&lt;br /&gt;
&lt;br /&gt;
=== Open Source or Freely Available Scripting Systems ===&lt;br /&gt;
&lt;br /&gt;
This is a list of personal bookmarks for things I&#039;ve found interesting, not an exaustive list - see the [http://community.secondlife.com/t5/LSL-Library/bd-p/LSLScriptingLibrary Library Forum] and [[LSL_Library]] wiki pages for that.&lt;br /&gt;
&lt;br /&gt;
* [[User:Nandana_Singh/nPose]]&lt;br /&gt;
* [[User:Rufus_Darkfold/PrimControl_HUD]]&lt;br /&gt;
* [[XyzzyText]]&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1160364</id>
		<title>User:Kimm Paulino</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino&amp;diff=1160364"/>
		<updated>2012-01-02T00:06:17Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Scripting Tips and Techniques */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{skills&lt;br /&gt;
|Architect=&lt;br /&gt;
|Builder=&lt;br /&gt;
|Machinima=&lt;br /&gt;
|Roleplayer=&lt;br /&gt;
|Scenographer=&lt;br /&gt;
|Scripter=*&lt;br /&gt;
|SLogistician=&lt;br /&gt;
|Terraformer=&lt;br /&gt;
|}}&lt;br /&gt;
&lt;br /&gt;
=== About ===&lt;br /&gt;
&lt;br /&gt;
Been in SL since September 2008.  Slowly started experimenting more with scripting during that time.  Usually happy to say &#039;hi&#039;.&lt;br /&gt;
&lt;br /&gt;
At the moment, I am fairly well preoccupied helping set up http://synzcreations.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
Other users with good scripting info:&lt;br /&gt;
* [[User:Becky Pippen]]&lt;br /&gt;
* [[User:Fred Gandt]]&lt;br /&gt;
* [[User:Void Singer]]&lt;br /&gt;
* [[User:Opensource_Obscure]]&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
&lt;br /&gt;
List most scripters, I&#039;ve collected various scripting odds and ends and share a few of them here for good measure in case they are of wider use.  They are provided &#039;as is&#039; for free use.  I make no claim about their fitness for purpose. If I&#039;ve used something from a resource somewhere I&#039;ve tried to include a credit, but if I&#039;ve missed any - sorry!  Do let me know and I&#039;ll add it back in.&lt;br /&gt;
&lt;br /&gt;
Feel free to drop me a im if you find anything useful. Unfortunately I am unlikely to be able to answer questions about them.  If you have scripting questions, try the in-world scripting groups.&lt;br /&gt;
&lt;br /&gt;
* http://kimmscripts.wordpress.com/ - help and usage information&lt;br /&gt;
* [[User:Kimm_Paulino/Scripts]] - the scripts themselves&lt;br /&gt;
&lt;br /&gt;
=== Scripting Tips and Techniques ===&lt;br /&gt;
&lt;br /&gt;
Optimisations and Memory Efficient Scripting:&lt;br /&gt;
* [[User:Void Singer/Optimizations]]&lt;br /&gt;
* [[LSL_Script_Memory]]&lt;br /&gt;
* http://www.lslwiki.net/lslwiki/wakka.php?wakka=MemoryUsage&lt;br /&gt;
* [[User:Becky Pippen/Script_Memory_Limits]]&lt;br /&gt;
&lt;br /&gt;
Other stuff&lt;br /&gt;
* https://wiki.secondlife.com/wiki/Category:LSL_Avatar/Name&lt;br /&gt;
* [[User:Void_Singer/Rotations]], also SLU Tutorials on rotations [http://www.sluniverse.com/php/vb/tutorials/62235-basic-introduction-rotations.html here] and [http://www.sluniverse.com/php/vb/tutorials/62479-introduction-rotations-translations-rotation-tutorial.html here]&lt;br /&gt;
&lt;br /&gt;
=== Open Source or Freely Available Scripting Systems ===&lt;br /&gt;
&lt;br /&gt;
This is a list of personal bookmarks for things I&#039;ve found interesting, not an exaustive list - see the [http://community.secondlife.com/t5/LSL-Library/bd-p/LSLScriptingLibrary Library Forum] and [[LSL_Library]] wiki pages for that.&lt;br /&gt;
&lt;br /&gt;
* [[User:Nandana_Singh/nPose]]&lt;br /&gt;
* [[User:Rufus_Darkfold/PrimControl_HUD]]&lt;/div&gt;</summary>
		<author><name>Kimm Paulino</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1160269</id>
		<title>User:Kimm Paulino/Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Kimm_Paulino/Scripts&amp;diff=1160269"/>
		<updated>2011-12-29T22:36:35Z</updated>

		<summary type="html">&lt;p&gt;Kimm Paulino: /* Floating Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Teleport ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Teleports on &#039;left click&#039; (touch).&lt;br /&gt;
//&lt;br /&gt;
// Set the coordinates to tp to in the DEST= line after these comments.&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Sept 2009&lt;br /&gt;
//&lt;br /&gt;
// Teleport bit based on the following:&lt;br /&gt;
//&lt;br /&gt;
// Copyright (c) 2008, Scripting Your World&lt;br /&gt;
// All rights reserved.&lt;br /&gt;
//&lt;br /&gt;
// Scripting Your World&lt;br /&gt;
// By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh&lt;br /&gt;
// http://syw.fabulo.us&lt;br /&gt;
// http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/&lt;br /&gt;
//&lt;br /&gt;
// You are permitted to use, share, and adapt this code under the &lt;br /&gt;
// terms of the Creative Commons Public License described in full&lt;br /&gt;
// at http://creativecommons.org/licenses/by/3.0/legalcode.&lt;br /&gt;
// That means you must keep the credits, do nothing to damage our&lt;br /&gt;
// reputation, and do not suggest that we endorse you or your work.&lt;br /&gt;
//&lt;br /&gt;
// Listing 2.4: Teleport3 - Optimized Intrasim Teleport&lt;br /&gt;
&lt;br /&gt;
vector DEST = &amp;lt;224, 213, 22&amp;gt;; // the teleport will be to this location&lt;br /&gt;
vector SITPOS = &amp;lt;0,0,0.5&amp;gt;;&lt;br /&gt;
key gAv;&lt;br /&gt;
&lt;br /&gt;
moveTo(vector origin, vector destination ) { // removed jumpdist&lt;br /&gt;
    float dist = llVecDist(origin, destination);&lt;br /&gt;
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );&lt;br /&gt;
    integer i;&lt;br /&gt;
    list params = [PRIM_POSITION, destination];&lt;br /&gt;
    for (i=0; i&amp;lt;passes; i++) {&lt;br /&gt;
        params = (params=[]) + params + params;&lt;br /&gt;
    }&lt;br /&gt;
    llSetPrimitiveParams(params);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
teleport(key av) {&lt;br /&gt;
    if (av == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vector origin = llGetPos();&lt;br /&gt;
    llSetAlpha (0.0, ALL_SIDES);&lt;br /&gt;
    moveTo(origin, DEST);&lt;br /&gt;
    // no need to sleep -- llSetPrimParams has 0.2s delay&lt;br /&gt;
    llUnSit(av);&lt;br /&gt;
    moveTo(DEST, origin);&lt;br /&gt;
    llSetAlpha (1.0, ALL_SIDES);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetClickAction (CLICK_ACTION_SIT);&lt;br /&gt;
        llSitTarget(SITPOS, ZERO_ROTATION);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed(integer changebits)&lt;br /&gt;
    {&lt;br /&gt;
        if (changebits &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            gAv = llAvatarOnSitTarget();&lt;br /&gt;
            if (gAv != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                teleport(gAv);&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;
== Die after 10 minutes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This will kill the prim it is in, 10 minutes after the prim has been rezzed.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, June 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // 10 minutes&lt;br /&gt;
        llSetTimerEvent (600.0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
        llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simple Prim Texture Changer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Texture changer.  Will cycle through all textures&lt;br /&gt;
// in the prims inventory.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Bebelou Naidoo, April 2010&lt;br /&gt;
&lt;br /&gt;
float TIMER_PERIOD = 5.0; // in seconds.&lt;br /&gt;
integer RANDOM = 1;     // 0 = sequential, 1 = random&lt;br /&gt;
&lt;br /&gt;
// globals&lt;br /&gt;
integer gNumTextures;&lt;br /&gt;
integer gLastTexture;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gLastTexture = 0;&lt;br /&gt;
        gNumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);&lt;br /&gt;
        llSetTimerEvent(TIMER_PERIOD);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        integer nextTexture;&lt;br /&gt;
        if (RANDOM)&lt;br /&gt;
        {&lt;br /&gt;
            // Randomly choose one&lt;br /&gt;
            nextTexture = (integer)llFrand (gNumTextures);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // Move on from the last one&lt;br /&gt;
            gLastTexture ++;&lt;br /&gt;
            if (gLastTexture &amp;gt; gNumTextures)&lt;br /&gt;
            {&lt;br /&gt;
                gLastTexture = 0;&lt;br /&gt;
            }&lt;br /&gt;
            nextTexture = gLastTexture;&lt;br /&gt;
        }&lt;br /&gt;
        string texture = llGetInventoryName(INVENTORY_TEXTURE, nextTexture);&lt;br /&gt;
        llSetTexture(texture, ALL_SIDES);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phantom Prim Setter ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to make a prim appear to be phantom, so it can be linked, etc,&lt;br /&gt;
// without actually being phantom.&lt;br /&gt;
//&lt;br /&gt;
// Procedure:&lt;br /&gt;
//  1. Create prim (not linked to anything)&lt;br /&gt;
//  2. Put this script in it and let it run&lt;br /&gt;
//  3. Link the prim to everything else&lt;br /&gt;
//  4. Delete the script if you like (no reason to keep it)&lt;br /&gt;
//&lt;br /&gt;
// Basic technique found on the SL forums.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, May 2010&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		// This makes the prim appear to be &#039;phantom like&#039; without&lt;br /&gt;
		// actually making it phantom ...&lt;br /&gt;
		llVolumeDetect(TRUE);&lt;br /&gt;
		&lt;br /&gt;
		// Now disable the script once we&#039;ve done our job&lt;br /&gt;
		llSetScriptState(llGetScriptName(), FALSE);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Floating Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script for applying a small, random impulse to physical objects&lt;br /&gt;
// to make them float about.&lt;br /&gt;
//&lt;br /&gt;
// Note: There is no bound to where the objects go, this script&lt;br /&gt;
// is meant for objects in a physically bounded area (like a fish tank with a lid)&lt;br /&gt;
//&lt;br /&gt;
// Feel free to use as you wish, but do let me know if you find something&lt;br /&gt;
// interesting to do with it ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Synonyme Toll, Sept 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// How often to apply the new impulse (in seconds)&lt;br /&gt;
float IMPULSE_TIME = 3.0;&lt;br /&gt;
&lt;br /&gt;
// Range for the magnitude and x, y, z directions of the impulse&lt;br /&gt;
float IMPULSE_RANGE = 0.5;&lt;br /&gt;
&lt;br /&gt;
float newRand (float range)&lt;br /&gt;
{&lt;br /&gt;
    // Want a random number in range +- &#039;range&#039;&lt;br /&gt;
    return (llFrand(2.0*range) - range);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
applySmallImpulse ()&lt;br /&gt;
{&lt;br /&gt;
    vector my_vec = llGetVel();&lt;br /&gt;
    float  my_mag = llVecMag (my_vec);&lt;br /&gt;
    vector my_dir = llVecNorm (my_vec);&lt;br /&gt;
&lt;br /&gt;
    // Change the magnitude slightly ...&lt;br /&gt;
    my_mag = my_mag + newRand(IMPULSE_RANGE);&lt;br /&gt;
    &lt;br /&gt;
    // Change the direction slightly too ...&lt;br /&gt;
    my_dir = &amp;lt;my_dir.x + newRand(IMPULSE_RANGE), my_dir.y + newRand(IMPULSE_RANGE), my_dir.z + newRand(IMPULSE_RANGE)&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
    vector new_vec = my_dir * my_mag;&lt;br /&gt;
    &lt;br /&gt;
    //llOwnerSay (&amp;quot;Applying Impulse: &amp;quot; + (string)new_vec);&lt;br /&gt;
&lt;br /&gt;
    // apply the impulse to us&lt;br /&gt;
    llApplyImpulse (new_vec, TRUE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript ();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Turn on Physics&lt;br /&gt;
        llSetPrimitiveParams ([PRIM_PHYSICS, TRUE]);&lt;br /&gt;
&lt;br /&gt;
	// The following will stop it rotating and keep it facing the same direction if required&lt;br /&gt;
	// llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        &lt;br /&gt;
        // Set the boyancy to &amp;gt; 1.0 so that it floats&lt;br /&gt;
        llSetBuoyancy (1.0);&lt;br /&gt;
        &lt;br /&gt;
        // Set up a timer to apply an impulse&lt;br /&gt;
        llSetTimerEvent (IMPULSE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        applySmallImpulse();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sit and Play Animation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Sets a sit target and plays whatever animation is &lt;br /&gt;
// stored in the contents on the prim when someone sits down.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Synonyme Toll, April 2010&lt;br /&gt;
&lt;br /&gt;
// These numbers are totally dependent on the object containing&lt;br /&gt;
// the script, and possibly even the animation to be used too.&lt;br /&gt;
vector gPosition = &amp;lt;0.0, 0.0, 0.1&amp;gt;;&lt;br /&gt;
vector gRotation = &amp;lt;0.0, 0.0, 0.0&amp;gt;;  // in degrees&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // These numbers are totally dependent on the object containing the script!&lt;br /&gt;
        llSitTarget (gPosition, llEuler2Rot (gRotation * DEG_TO_RAD));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    changed (integer change)&lt;br /&gt;
    {&lt;br /&gt;
        // When someone sits on an object, the av is considered to be&lt;br /&gt;
        // a linked-in child prim, so the link number changes&lt;br /&gt;
        if (change &amp;amp; CHANGED_LINK)&lt;br /&gt;
        {&lt;br /&gt;
            key av = llAvatarOnSitTarget();&lt;br /&gt;
            if (av)&lt;br /&gt;
            {&lt;br /&gt;
                // yes so need to play the animation&lt;br /&gt;
                // first request permissions - results in the callback ...&lt;br /&gt;
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    run_time_permissions(integer perms)&lt;br /&gt;
    {&lt;br /&gt;
        // Do we have permissions to run the animations?&lt;br /&gt;
        // results in the timer!&lt;br /&gt;
        if(perms)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(1.0);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        key av = llAvatarOnSitTarget();&lt;br /&gt;
        // If the av is still sitting, play the animation stored in the prim&lt;br /&gt;
        if (av)&lt;br /&gt;
        {&lt;br /&gt;
            llStopAnimation(&amp;quot;sit&amp;quot;);&lt;br /&gt;
            llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0 ));&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // stop playing the animations for sitting if the av&lt;br /&gt;
            // is no longer sitting ...&lt;br /&gt;
            llStopAnimation(&amp;quot;sit_generic&amp;quot;);&lt;br /&gt;
            llSetTimerEvent(0.0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move up and down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Makes an object go up or down, gradually, when touched.&lt;br /&gt;
// In order to make it a gradual movement, it uses a physical&lt;br /&gt;
// object, which means it might be a little wobbly ...&lt;br /&gt;
//&lt;br /&gt;
//  Kimm Paulino&lt;br /&gt;
//  Written for Nicollette Arabello, November 2009&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
integer gState;&lt;br /&gt;
integer DOWN=0;&lt;br /&gt;
integer GO_UP=1;&lt;br /&gt;
integer UP=2;&lt;br /&gt;
integer GO_DOWN=3;&lt;br /&gt;
&lt;br /&gt;
float MOVE_DAMPING=4.0;&lt;br /&gt;
float MOVE_TIME=4.0;&lt;br /&gt;
&lt;br /&gt;
// Move to 1m above starting position&lt;br /&gt;
vector gOffset = &amp;lt;0.0, 0.0, 1.0&amp;gt;;&lt;br /&gt;
vector gStartPosition;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // Use physics so that can use MoveToTarget&lt;br /&gt;
        gStartPosition = llGetPos ();&lt;br /&gt;
        &lt;br /&gt;
        // Stop the object rotating&lt;br /&gt;
        llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;
        llMoveToTarget (gStartPosition, MOVE_DAMPING);&lt;br /&gt;
        llSetTimerEvent (MOVE_TIME);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    on_rez(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == DOWN)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_UP;&lt;br /&gt;
            llMoveToTarget(gStartPosition + gOffset, MOVE_DAMPING);&lt;br /&gt;
            gState = UP;&lt;br /&gt;
        }&lt;br /&gt;
        else if (gState == UP)&lt;br /&gt;
        {&lt;br /&gt;
            gState = GO_DOWN;&lt;br /&gt;
            llMoveToTarget(gStartPosition, MOVE_DAMPING);&lt;br /&gt;
            gState = DOWN;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Door ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Was asked to modify an existing door script.  I was just given&lt;br /&gt;
// this to update so afraid I can&#039;t give credit, but if you know where&lt;br /&gt;
// the original came from, do let me know.&lt;br /&gt;
//&lt;br /&gt;
// Swinging door LSL script #1&lt;br /&gt;
// Handles the touch event.&lt;br /&gt;
// Handles the collision event.&lt;br /&gt;
// Handles closing the door automatically via a timer event.&lt;br /&gt;
// Triggers sounds when the door opens or closes.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, April 2010, for Synonyme Toll,&lt;br /&gt;
// to use local coords for the rotations instead of global&lt;br /&gt;
// coords.&lt;br /&gt;
//&lt;br /&gt;
// Updated by Kimm Paulino, May 2010, for Synonyme Toll,&lt;br /&gt;
// to use messages to link two doors together.&lt;br /&gt;
//&lt;br /&gt;
// Note: For this to work, you need a door with a path cut&lt;br /&gt;
//       of 0.375 to 0.875 and a width that is twice as wide&lt;br /&gt;
//       as you need (the cut brings it back down to the right&lt;br /&gt;
//       size).  Without this, it will just rotate on the spot,&lt;br /&gt;
//       not swing at the edge.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
// Parameters you might want to change&lt;br /&gt;
&lt;br /&gt;
float  delay = 3.0;             // time to wait before automatically closing door&lt;br /&gt;
                                // set to 0.0 to not automatically close&lt;br /&gt;
float  direction = 1.0;         // set to 1.0 or -1.0 to control direction the door swings&lt;br /&gt;
float  volume = 0.5;            // 0.0 is off, 1.0 is loudest&lt;br /&gt;
integer linked_doors = 0;       // set to 1 if using this script in a linked set of doors&lt;br /&gt;
float  angle = 90.0;            // angle to open in degrees&lt;br /&gt;
integer coll_detect = 1;        // set to 1 to make door open on approach&lt;br /&gt;
&lt;br /&gt;
// Variables you will most likely leave the same&lt;br /&gt;
&lt;br /&gt;
key    open_sound  = &amp;quot;cb340647-9680-dd5e-49c0-86edfa01b3ac&amp;quot;;&lt;br /&gt;
key    close_sound = &amp;quot;e7ff1054-003d-d134-66be-207573f2b535&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// KP: Link send/recv functions&lt;br /&gt;
// IMPORTANT&lt;br /&gt;
// If you only have one pair of doors using this script, then&lt;br /&gt;
// these will be fine.  If you have several doors using this&lt;br /&gt;
// script that you don&#039;t want all opening together, then&lt;br /&gt;
// you&#039;ll have to change these to something unique.&lt;br /&gt;
//&lt;br /&gt;
integer LINK_MSG_NUM = 452345;&lt;br /&gt;
string LINK_MSG_STR_OPEN = &amp;quot;Open the door&amp;quot;;&lt;br /&gt;
string LINK_MSG_STR_CLOSE = &amp;quot;Close the door&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
linkSend (string dir)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Note: Could try to work out the link numbers of the doors,&lt;br /&gt;
        // but simplest is to send to all other prims in the build.&lt;br /&gt;
        llMessageLinked (LINK_ALL_OTHERS, LINK_MSG_NUM, dir, NULL_KEY);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer linkRecv (integer sender_num, integer num, string str, key id, string str_to_check)&lt;br /&gt;
{&lt;br /&gt;
    if (linked_doors)&lt;br /&gt;
    {&lt;br /&gt;
        // Check it really is a message for these doors&lt;br /&gt;
        if (num == LINK_MSG_NUM)&lt;br /&gt;
        {&lt;br /&gt;
            if (str == str_to_check)&lt;br /&gt;
            {&lt;br /&gt;
                // All good&lt;br /&gt;
                return 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // not for us&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it first starts up&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the closed state&lt;br /&gt;
&lt;br /&gt;
state closed {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(close_sound, volume); // Trigger the sound of the door closing&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state open;                        // Move to the open state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (coll_detect != 0)&lt;br /&gt;
        {&lt;br /&gt;
            linkSend (LINK_MSG_STR_OPEN);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
            state open;                        // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_OPEN))&lt;br /&gt;
        {&lt;br /&gt;
            state open;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);              // Set the timer to 0.0 to turn it off&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Processing for the script when it is in the open state&lt;br /&gt;
&lt;br /&gt;
state open {&lt;br /&gt;
    // What we do when we first enter this state&lt;br /&gt;
&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llTriggerSound(open_sound, volume);// Trigger the sound of the door opening&lt;br /&gt;
        llSetLocalRot(llEuler2Rot(&amp;lt;0, 0, -direction * angle * DEG_TO_RAD&amp;gt;) * llGetLocalRot());&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(delay);            // Set the timer to automatically close it&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What do do when pulling the door from Inventory if it was saved while open&lt;br /&gt;
&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        state closed;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What we do when the door is clicked (”touched”) with the mouse&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        linkSend (LINK_MSG_STR_CLOSE);  // KP: Tell everyone else we are now in the open state&lt;br /&gt;
        state closed;                      // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when something hits the door &lt;br /&gt;
&lt;br /&gt;
    collision_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Do nothing, the door is already open&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // KP: Handle link messages&lt;br /&gt;
    &lt;br /&gt;
    link_message (integer sender_num, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        if (linkRecv (sender_num, num, str, id, LINK_MSG_STR_CLOSE))&lt;br /&gt;
        {&lt;br /&gt;
            state closed;                    // Move to the open state&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // What to do when the timer goes off&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.0);             // Set the timer to 0.0 to turn it off&lt;br /&gt;
        state closed;                     // Move to the closed state&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Child Prim Rotations ==&lt;br /&gt;
&lt;br /&gt;
This is a test script to pull together all the advice about rotations about a centre of rotation, in local coordinates with the appropriate work arounds for setting rotations, etc.  Not really meant for use on its own but just to highlight the logic for applying the rotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Testing child prim rotations.&lt;br /&gt;
// This is a script that could be used with a non-path-cut linked door or windows&lt;br /&gt;
// and so on, with the correct rotation offsets and calculations to function.&lt;br /&gt;
//&lt;br /&gt;
// When the script is run for the first time, prim should be in the closed position.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, August 2010&lt;br /&gt;
&lt;br /&gt;
// Specify the rotation to apply, as a Euler vector in degrees&lt;br /&gt;
vector gNewRotation_e = &amp;lt;0.0, 0.0, 150.0&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// Specify the details of the Centre of Rotation to use.&lt;br /&gt;
// Can either work it out from the prim parameters or put a hardcoded one in here&lt;br /&gt;
integer gCorAxis = 1;	// 1=x, 2=y, 3=z, -1=-x, -2=-y, -3=-z, 0=gCor&lt;br /&gt;
vector gCor = &amp;lt;0.0,0.0,0.0&amp;gt;;	// Relative to root prim, if gCorAxis = 0&lt;br /&gt;
&lt;br /&gt;
// This test script will automatically return the prim to its start&lt;br /&gt;
// parameters after this time if gAutoClose is set to TRUE.&lt;br /&gt;
float RESET_TIME = 5.0;&lt;br /&gt;
integer gAutoClose = FALSE;&lt;br /&gt;
 &lt;br /&gt;
vector gInitialPosition;&lt;br /&gt;
rotation gInitialRotation;&lt;br /&gt;
integer CLOSED=0;&lt;br /&gt;
integer OPEN=1;&lt;br /&gt;
integer gState;&lt;br /&gt;
 &lt;br /&gt;
store_child ()&lt;br /&gt;
{&lt;br /&gt;
//    llOwnerSay (&amp;quot;-----------------&amp;quot;);&lt;br /&gt;
    gInitialPosition = llGetLocalPos();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Position: &amp;quot; + (string)gInitialPosition);&lt;br /&gt;
    gInitialRotation = llGetLocalRot();&lt;br /&gt;
//    llOwnerSay (&amp;quot;Initial Rotation: &amp;quot; + (string)r2v(gInitialRotation));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
restore_child()&lt;br /&gt;
{&lt;br /&gt;
    // Note: Use the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, gInitialPosition,&lt;br /&gt;
                                    PRIM_ROTATION, gInitialRotation / llGetRootRotation()]);&lt;br /&gt;
    //llSetPos (gInitialPosition);&lt;br /&gt;
    //llSetLocalRot (gInitialRotation);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector calcCorAxis ()&lt;br /&gt;
{&lt;br /&gt;
    // Note: If the prim is rotated, then we need to apply the&lt;br /&gt;
    // same rotation to the size values to pick up the correct axis&lt;br /&gt;
    vector prim_size = llGetScale() * llGetLocalRot();&lt;br /&gt;
    if (gCorAxis == 1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == 3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -1)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;(-prim_size.x/2.0), 0.0, 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -2)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, (-prim_size.y/2.0), 0.0&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (gCorAxis == -3)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;lt;0.0, 0.0, (-prim_size.z/2.0)&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        return gCor;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
vector r2v (rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return (RAD_TO_DEG * llRot2Euler (r));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// rot is a rotation to be applied to the prim&lt;br /&gt;
// cor is a relative position (to the root) for the centre of rotation&lt;br /&gt;
rotate_child (rotation rot, vector cor)&lt;br /&gt;
{&lt;br /&gt;
    // Work in local coordinates&lt;br /&gt;
    vector current_position = llGetLocalPos();&lt;br /&gt;
    rotation current_orientation = llGetLocalRot();&lt;br /&gt;
    //llOwnerSay (&amp;quot;Current position/rotation: &amp;quot; + (string)current_position + &amp;quot; / &amp;quot; + (string)r2v(current_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the offset from the centre of the object&lt;br /&gt;
    // to the centre of rotation.  This effectively moves&lt;br /&gt;
    // the object so that the cor can be thought off as the&lt;br /&gt;
    // origin.  Once we&#039;ve done the calculations, we&#039;ll move it back.&lt;br /&gt;
    vector normalised_position = current_position - cor;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Normalised position/COR: &amp;quot; + (string)normalised_position + &amp;quot; / &amp;quot; + (string)cor);&lt;br /&gt;
 &lt;br /&gt;
    // Calculate the new position by applying the required&lt;br /&gt;
    // rotation to the current position (i.e. rotate the&lt;br /&gt;
    // vector origin-position to produce origin-newposition)&lt;br /&gt;
    vector new_normalised_position = normalised_position * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;Rotated Normalised Position: &amp;quot; + (string)new_normalised_position);&lt;br /&gt;
    vector new_position = cor + new_normalised_position;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Actual Position: &amp;quot; + (string)new_position);&lt;br /&gt;
 &lt;br /&gt;
    rotation new_orientation = current_orientation * rot;&lt;br /&gt;
    //llOwnerSay (&amp;quot;New Orientation: &amp;quot; + (string)r2v(new_orientation));&lt;br /&gt;
 &lt;br /&gt;
    // Set local position and rotation&lt;br /&gt;
    // Note: There is no llSetLocalPos - llSetPos will do local coords for a child&lt;br /&gt;
    //llSetPos (new_position);&lt;br /&gt;
    //llSetLocalRot (new_orientation);&lt;br /&gt;
 &lt;br /&gt;
    // However, use llSetPrimitiveParams to set both at same time, without&lt;br /&gt;
    // incurring two 0.2s delays ... although note, have to use&lt;br /&gt;
    // the PRIM_ROTATION workaround, as described in SVC-93&lt;br /&gt;
    llSetPrimitiveParams ([    PRIM_POSITION, new_position,&lt;br /&gt;
                                    PRIM_ROTATION, new_orientation / llGetRootRotation()]);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        // As positions will be stored on entry,&lt;br /&gt;
        // don&#039;t want to auto reset on rez, as it might&lt;br /&gt;
        // be rezed in the closed position, which would screw&lt;br /&gt;
        // things up!&lt;br /&gt;
//        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    state_entry ()&lt;br /&gt;
    {&lt;br /&gt;
        // store initial position/etc&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        store_child ();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start (integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        if (gState == CLOSED)&lt;br /&gt;
        {&lt;br /&gt;
            // Need to convert CoR to local coordinates relative to&lt;br /&gt;
            // the root prim (not just relative to this prim).&lt;br /&gt;
            vector cor = llGetLocalPos() + calcCorAxis();&lt;br /&gt;
            rotate_child (llEuler2Rot (gNewRotation_e * DEG_TO_RAD), cor);&lt;br /&gt;
            if (gAutoClose)&lt;br /&gt;
            {&lt;br /&gt;
                llSetTimerEvent (RESET_TIME);&lt;br /&gt;
            }&lt;br /&gt;
            gState = OPEN;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            restore_child ();&lt;br /&gt;
            gState = CLOSED;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        gState = CLOSED;&lt;br /&gt;
        restore_child ();&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prim Reducing Script ==&lt;br /&gt;
&lt;br /&gt;
This will reduce a prim&#039;s size by scaling it by the specified number of steps and applying that scaling the specified number of times using a timer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Reducing Script&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Stewart Bosatsu, Sept 2010&lt;br /&gt;
&lt;br /&gt;
integer TIMER_STEPS = 18;&lt;br /&gt;
float   REDUCING_STEPS = 20;        // If this &amp;gt;= TIMER_STEPS then prim will disappear&lt;br /&gt;
float   TIMER_INTERVAL = 2.0;       // In seconds&lt;br /&gt;
integer gCount;&lt;br /&gt;
vector  gReducingFactor;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        gCount = 0;&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        float scaling = 1.0 / REDUCING_STEPS;&lt;br /&gt;
        gReducingFactor = size * scaling;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent (TIMER_INTERVAL);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        // Reduce the size by 1/TIMER_STEPS % each time&lt;br /&gt;
        gCount ++;&lt;br /&gt;
        if (gCount &amp;gt; TIMER_STEPS)&lt;br /&gt;
        {&lt;br /&gt;
            // disable and quit&lt;br /&gt;
            llSetTimerEvent (0.0);&lt;br /&gt;
            llDie();&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Reduce prim&lt;br /&gt;
        vector size = llGetScale();&lt;br /&gt;
        &lt;br /&gt;
        size = size - gReducingFactor;&lt;br /&gt;
        llSetScale (size);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Simple Path Script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Path Setting Script&lt;br /&gt;
//&lt;br /&gt;
// In &#039;edit&#039; mode, user moves the object and &#039;saves&#039; various positions&lt;br /&gt;
// over time, then the positions can be replayed.  This either uses the physical&lt;br /&gt;
// move functions to create smooth movement or non-physical movements&lt;br /&gt;
// for a slightly more jerky movement!&lt;br /&gt;
//&lt;br /&gt;
// NOTE: Positions and rotations are relative to the region, so if you&lt;br /&gt;
// move the prim, then the positions won&#039;t move with it - you&#039;d have to&lt;br /&gt;
// reset the script (using the &#039;reset&#039; button) and store a new path.&lt;br /&gt;
//&lt;br /&gt;
// Depending on the settings, the system can either loop forever&lt;br /&gt;
// or play just once.&lt;br /&gt;
//&lt;br /&gt;
// It also has the option of resetting if you change owners, which&lt;br /&gt;
// might be useful if you want new owners to be able to store their&lt;br /&gt;
// own paths.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Oct 2010&lt;br /&gt;
&lt;br /&gt;
integer gDebug = FALSE;&lt;br /&gt;
integer gPhysics = FALSE;		// Set to use physical movements&lt;br /&gt;
integer gLoop = TRUE;				// Set to continually loop through the movements&lt;br /&gt;
integer gResetOnOwnerChange = TRUE;	// Set if want script to auto reset when changing owners&lt;br /&gt;
&lt;br /&gt;
list gPositionData;			// Always assume that there are the same numbers&lt;br /&gt;
list gRotationData;			// of position and rotation data points&lt;br /&gt;
integer gCurrentIdx;&lt;br /&gt;
float gTimePeriod = 2.0;&lt;br /&gt;
float gTau = 5.0;&lt;br /&gt;
key gOwnerId; &lt;br /&gt;
integer gListen; &lt;br /&gt;
integer gTimeHandle; &lt;br /&gt;
integer gTauHandle; &lt;br /&gt;
string gHelpMsg = &amp;quot;Use EDIT mode to move your object, selecting &#039;Save&#039; to save each position.  Select &#039;Done&#039; once complete.  Don&#039;t forget to save your first position too!&amp;quot;; &lt;br /&gt;
string gErrorMsg = &amp;quot;Something unexpected went wrong, suggest you reset the script!&amp;quot;;&lt;br /&gt;
string SAVE_BTN = &amp;quot;Save&amp;quot;;&lt;br /&gt;
string DONE_BTN = &amp;quot;Done&amp;quot;;&lt;br /&gt;
string TIME_BTN = &amp;quot;Time Adjust&amp;quot;;&lt;br /&gt;
string TAU_BTN = &amp;quot;Tau Adjust&amp;quot;;&lt;br /&gt;
string RESET_BTN = &amp;quot;Reset&amp;quot;;&lt;br /&gt;
string START_BTN = &amp;quot;Start&amp;quot;;&lt;br /&gt;
string STOP_BTN = &amp;quot;Stop&amp;quot;;&lt;br /&gt;
string START_MSG = &amp;quot;start&amp;quot;;		// What a passer by can type in via chat&lt;br /&gt;
integer LISTEN_CH = 600;&lt;br /&gt;
integer TIME_CH = 900;&lt;br /&gt;
integer TAU_CH = 901;&lt;br /&gt;
&lt;br /&gt;
doDebug (string msg)&lt;br /&gt;
{&lt;br /&gt;
	if (gDebug)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay (msg);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
doMove()&lt;br /&gt;
{ &lt;br /&gt;
    integer num_points = llGetListLength(gPositionData); &lt;br /&gt;
	if (num_points != llGetListLength (gRotationData))&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay (gErrorMsg);&lt;br /&gt;
		disableMove();&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	if (gCurrentIdx &amp;gt;= num_points)&lt;br /&gt;
	{&lt;br /&gt;
		if (gLoop)&lt;br /&gt;
		{&lt;br /&gt;
			// Loop around for another go&lt;br /&gt;
			gCurrentIdx = 0;&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			// All complete&lt;br /&gt;
			disableMove();&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	doDebug (&amp;quot;Moving to position &amp;quot; + (string)gCurrentIdx);&lt;br /&gt;
	&lt;br /&gt;
    vector next_pos = llList2Vector (gPositionData, gCurrentIdx);&lt;br /&gt;
	rotation next_rot = llList2Rot (gRotationData, gCurrentIdx);&lt;br /&gt;
    &lt;br /&gt;
    if (next_pos == ZERO_VECTOR &amp;amp;&amp;amp; next_rot == ZERO_ROTATION)&lt;br /&gt;
    {&lt;br /&gt;
        // ignore&lt;br /&gt;
    }&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		if (gPhysics)&lt;br /&gt;
		{&lt;br /&gt;
			llMoveToTarget(next_pos, gTau);&lt;br /&gt;
			llLookAt(next_pos,1,1);&lt;br /&gt;
			llRotLookAt(next_rot,1,1);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
//			doDebug (&amp;quot;moving to: &amp;quot; + (string)next_pos);&lt;br /&gt;
			llSetRot (next_rot);&lt;br /&gt;
			llSetPos (next_pos);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Move on to the next point&lt;br /&gt;
	gCurrentIdx ++;&lt;br /&gt;
} &lt;br /&gt;
  &lt;br /&gt;
dialog ()&lt;br /&gt;
{&lt;br /&gt;
	list buttons;&lt;br /&gt;
	if (gPhysics)&lt;br /&gt;
	{&lt;br /&gt;
		buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN, TAU_BTN];&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		buttons = [SAVE_BTN, DONE_BTN, RESET_BTN, START_BTN, STOP_BTN, TIME_BTN];&lt;br /&gt;
	}&lt;br /&gt;
    llDialog (gOwnerId, gHelpMsg, buttons, LISTEN_CH);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enableMove ()&lt;br /&gt;
{&lt;br /&gt;
	if (gPhysics)&lt;br /&gt;
	{&lt;br /&gt;
		doDebug (&amp;quot;Enabling physical move&amp;quot;);&lt;br /&gt;
		llSetStatus (PRIM_PHYSICS, TRUE);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		doDebug (&amp;quot;Enabling non-physical move&amp;quot;);&lt;br /&gt;
		llSetStatus(PRIM_PHYSICS, FALSE); &lt;br /&gt;
	}&lt;br /&gt;
	llSetTimerEvent (gTimePeriod);&lt;br /&gt;
	gCurrentIdx = 0;&lt;br /&gt;
	doMove ();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
disableMove ()&lt;br /&gt;
{&lt;br /&gt;
	doDebug (&amp;quot;Disabling move&amp;quot;);&lt;br /&gt;
	llSetStatus (PRIM_PHYSICS, FALSE);&lt;br /&gt;
	llSetTimerEvent (0.0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		// if we reset on rez, then a user can&#039;t take an object into&lt;br /&gt;
		// inventory have rerez it with the same path stored.&lt;br /&gt;
		//&lt;br /&gt;
		// Means that if they do want to clear the path, say because&lt;br /&gt;
		// the position in the Sim has changed, then they have to use&lt;br /&gt;
		// the &#039;reset&#039; option.&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry() &lt;br /&gt;
	{   &lt;br /&gt;
		llOwnerSay (&amp;quot;Ready to start saving positions.  Touch for menu, then go to SL Edit mode to move the object and use &#039;save&#039; on the menu to save each position.&amp;quot;);&lt;br /&gt;
		gOwnerId = llGetOwner();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
	touch_start(integer who)&lt;br /&gt;
	{&lt;br /&gt;
		gListen = llListen (LISTEN_CH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
		if (llDetectedKey(0) == gOwnerId)&lt;br /&gt;
		{&lt;br /&gt;
			dialog();&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			if (!gLoop)&lt;br /&gt;
			{&lt;br /&gt;
				// Let nearby users start the moving&lt;br /&gt;
				llWhisper  (0, &amp;quot;To start the movement, please type the following into local chat:  /&amp;quot; + (string)LISTEN_CH + &amp;quot; &amp;quot; + START_MSG);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
	listen (integer channel, string name, key id, string msg)&lt;br /&gt;
	{&lt;br /&gt;
		vector pos = llGetPos();&lt;br /&gt;
		rotation rot = llGetRot();&lt;br /&gt;
		&lt;br /&gt;
		if (channel == LISTEN_CH)&lt;br /&gt;
		{&lt;br /&gt;
			if (msg == START_BTN || msg == START_MSG)&lt;br /&gt;
			{&lt;br /&gt;
				enableMove();&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			// non-owners can&#039;t do anything else&lt;br /&gt;
			if (id != gOwnerId)&lt;br /&gt;
			{&lt;br /&gt;
				return;&lt;br /&gt;
			}&lt;br /&gt;
				&lt;br /&gt;
			if (msg == SAVE_BTN)&lt;br /&gt;
			{&lt;br /&gt;
				gPositionData += pos;&lt;br /&gt;
				gRotationData += rot;&lt;br /&gt;
				dialog ();&lt;br /&gt;
			} &lt;br /&gt;
			else if (msg == STOP_BTN)&lt;br /&gt;
			{&lt;br /&gt;
				disableMove();&lt;br /&gt;
			}&lt;br /&gt;
			else if (msg == RESET_BTN)&lt;br /&gt;
			{&lt;br /&gt;
				llResetScript();&lt;br /&gt;
			}&lt;br /&gt;
			else if (msg == TIME_BTN)&lt;br /&gt;
			{&lt;br /&gt;
				gTimeHandle = llListen (TIME_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
				llOwnerSay (&amp;quot;Adjust time using: /&amp;quot; + (string)TIME_CH + &amp;quot; &amp;lt;float seconds&amp;gt;&amp;quot;);&lt;br /&gt;
			} &lt;br /&gt;
			else if (msg == TAU_BTN)&lt;br /&gt;
			{&lt;br /&gt;
				gTauHandle = llListen(TAU_CH, &amp;quot;&amp;quot;, gOwnerId, &amp;quot;&amp;quot;);&lt;br /&gt;
				llOwnerSay (&amp;quot;Adjust Tau using: /&amp;quot; + (string)TAU_CH + &amp;quot; &amp;lt;float value&amp;gt;&amp;quot;);&lt;br /&gt;
			} &lt;br /&gt;
			else if (msg == DONE_BTN)&lt;br /&gt;
			{&lt;br /&gt;
				llOwnerSay(&amp;quot;To reset use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; reset&amp;quot;);&lt;br /&gt;
				llOwnerSay(&amp;quot;To start use: /&amp;quot; + (string)LISTEN_CH + &amp;quot; start&amp;quot;);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		if (channel == TIME_CH)&lt;br /&gt;
		{&lt;br /&gt;
			gTimePeriod = (float)msg;&lt;br /&gt;
			llListenRemove (gTimeHandle);&lt;br /&gt;
			llOwnerSay (&amp;quot;Time period set to &amp;quot; + msg);&lt;br /&gt;
		} &lt;br /&gt;
&lt;br /&gt;
		if (channel == TAU_CH)&lt;br /&gt;
		{&lt;br /&gt;
			gTau = (float)msg;&lt;br /&gt;
			llListenRemove (gTauHandle);&lt;br /&gt;
			llOwnerSay (&amp;quot;Tau set to &amp;quot; + msg);&lt;br /&gt;
		} &lt;br /&gt;
	}&lt;br /&gt;
     &lt;br /&gt;
	changed(integer ch)&lt;br /&gt;
	{&lt;br /&gt;
		if(ch &amp;amp; CHANGED_OWNER)&lt;br /&gt;
		{&lt;br /&gt;
			if (gResetOnOwnerChange)&lt;br /&gt;
			{&lt;br /&gt;
				// This will clear out all stored positions of course!&lt;br /&gt;
				llResetScript();&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	timer()&lt;br /&gt;
	{&lt;br /&gt;
		doMove();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visitor Counter and LM Giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple visitor counter and lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it to non-owners on touch.&lt;br /&gt;
//&lt;br /&gt;
// For owners, if the prim is touched, presents a simple&lt;br /&gt;
// dialog to either list visitors or reset the visitors counts.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Oct 2010&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
integer gLogDates = TRUE;        // Include timestamps in the log&lt;br /&gt;
integer gJustDates = FALSE;	 // But only dates (not timestamps)&lt;br /&gt;
integer gKeepFirst = FALSE;      // Keep the first visit of someone, not the last&lt;br /&gt;
string  gFloatingText = &amp;quot;&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
float   gSensorRange = 15.0;&lt;br /&gt;
&lt;br /&gt;
integer MAX_VISITORS = 30;&lt;br /&gt;
list gVisitors;&lt;br /&gt;
list gVisitorTimes;&lt;br /&gt;
integer gVisitorCount;&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gListenHandle;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel()&lt;br /&gt;
{&lt;br /&gt;
    // Some magic I got of the SL wiki somewhere ...&lt;br /&gt;
    return -llRound(llFrand( llFabs(llSin(llGetGMTclock())) * 1000000 )) - 11;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
listVisitors ()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;----------------&amp;quot;);&lt;br /&gt;
    llOwnerSay(&amp;quot;Total number of visits: &amp;quot; + (string)gVisitorCount);&lt;br /&gt;
    if (gVisitorCount &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Most recent visitors:&amp;quot;);&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer len = llGetListLength(gVisitors);&lt;br /&gt;
        for (i=0; i &amp;lt; len; i++)&lt;br /&gt;
        {&lt;br /&gt;
            if (gLogDates)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;[&amp;quot; + llList2String (gVisitorTimes, i) + &amp;quot;] &amp;quot; +llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(llList2String(gVisitors,i));&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
resetVisitors()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay (&amp;quot;Resetting visitor count&amp;quot;);&lt;br /&gt;
    gVisitors = [];&lt;br /&gt;
    gVisitorTimes = [];&lt;br /&gt;
    gVisitorCount = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addVisitor(string name)&lt;br /&gt;
{&lt;br /&gt;
    // see if we&#039;ve already seen this one&lt;br /&gt;
    integer idx = llListFindList(gVisitors, (list)name);&lt;br /&gt;
    if (idx != -1 )&lt;br /&gt;
    {&lt;br /&gt;
        // Already in the list, so:&lt;br /&gt;
        // If storing dates, then need to decide if we are keeping&lt;br /&gt;
        // the first visit or the last&lt;br /&gt;
        //&lt;br /&gt;
        // If we are not keeping dates, just don&#039;t bother logging again&lt;br /&gt;
        if (!gLogDates)&lt;br /&gt;
        {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (gKeepFirst)&lt;br /&gt;
        {&lt;br /&gt;
            // Already have the entry we wish to keep ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // ok, we are keeping the last visits, so remove&lt;br /&gt;
        // the name from the list and let the rest of the function&lt;br /&gt;
        // add it in again!&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, idx, idx);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, idx, idx);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        // Note:  Will count people who visited before but have&lt;br /&gt;
        // now dropped off the end of the &#039;last visitors&#039; list, but&lt;br /&gt;
        // thats all.&lt;br /&gt;
        gVisitorCount ++;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //llOwnerSay (&amp;quot;Adding &amp;quot; + name);&lt;br /&gt;
    gVisitors += name;&lt;br /&gt;
    if (gJustDates)&lt;br /&gt;
    {&lt;br /&gt;
	gVisitorTimes += llGetDate();&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        list timestamp = llParseString2List(llGetTimestamp(),[&amp;quot;T&amp;quot;,&amp;quot;.&amp;quot;],[&amp;quot;&amp;quot;]);&lt;br /&gt;
	string time = llList2String(timestamp, 0) + &amp;quot; &amp;quot; + llList2String(timestamp, 1);&lt;br /&gt;
	gVisitorTimes += time;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // See if we are at the end of the list&lt;br /&gt;
    // this helps to keep memory limits down&lt;br /&gt;
    // and also creates a rolling list of most&lt;br /&gt;
    // recently seen avs&lt;br /&gt;
    if (llGetListLength(gVisitors) &amp;gt; MAX_VISITORS)&lt;br /&gt;
    {&lt;br /&gt;
        // Remove first entry in the list&lt;br /&gt;
        gVisitors = llDeleteSubList (gVisitors, 0, 0);&lt;br /&gt;
        gVisitorTimes = llDeleteSubList (gVisitorTimes, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        resetVisitors();&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
        &lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha); &lt;br /&gt;
        &lt;br /&gt;
        // Range, angle, rate&lt;br /&gt;
        // So 5m range, 180 deg, every 5 secs&lt;br /&gt;
        llSensorRepeat (&amp;quot;&amp;quot;, NULL_KEY, AGENT, gSensorRange, PI, 5.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer i;&lt;br /&gt;
        //llSay (0, &amp;quot;Found &amp;quot; + (string)total_number);&lt;br /&gt;
        for (i=0 ; i&amp;lt;total_number ; i++)&lt;br /&gt;
        {&lt;br /&gt;
            key avid = llDetectedKey(i);&lt;br /&gt;
            string av = llKey2Name (avid);&lt;br /&gt;
            //llSay (0, &amp;quot;Detected &amp;quot; + av);&lt;br /&gt;
        &lt;br /&gt;
            if (avid == llGetOwner ())&lt;br /&gt;
            {&lt;br /&gt;
                // Don&#039;t count owner&lt;br /&gt;
                //llSay (0, &amp;quot;Ignoring owner&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                //llSay (0, &amp;quot;Adding visitor&amp;quot;);&lt;br /&gt;
                addVisitor (av);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // Two things to do on touch&lt;br /&gt;
        // If its the owner, dump list of visitors&lt;br /&gt;
        // If its not, then give a lm if one exists&lt;br /&gt;
        string visitor = llDetectedKey (0);&lt;br /&gt;
        if (visitor == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llListenRemove (gListenHandle); // in case things didn&#039;t complete last time&lt;br /&gt;
            llSetTimerEvent (600.0);  // In 10 minutes, all times out&lt;br /&gt;
            gListenHandle = llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
            llDialog (visitor, &amp;quot;Kimm&#039;s Visitor Tracker&amp;quot;, [&amp;quot;List&amp;quot;, &amp;quot;Reset&amp;quot;], gChannel);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // get the name of the first landmark in the inventory&lt;br /&gt;
            string lm = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
            if (lm != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llGiveInventory(visitor, lm); &lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (channel != gChannel)&lt;br /&gt;
        {&lt;br /&gt;
            // not for us ...&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (msg == &amp;quot;List&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            listVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        else if (msg == &amp;quot;Reset&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            resetVisitors();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer ()&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove (gListenHandle);&lt;br /&gt;
        gListenHandle = 0;&lt;br /&gt;
        llSetTimerEvent (0.0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LM, Notecard, Group, URL giver ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Simple lm giver script&lt;br /&gt;
//&lt;br /&gt;
// Just finds the first landmark stored in the prim and&lt;br /&gt;
// gives it on touch.&lt;br /&gt;
//&lt;br /&gt;
// Also, if configured, will give out a URL or a link to a group.&lt;br /&gt;
//&lt;br /&gt;
// If a notecard is present in the inventory, it can give that too.&lt;br /&gt;
//&lt;br /&gt;
// If any of these things are not present, then they will not be&lt;br /&gt;
// presented as an option.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for Landmark&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
string gLm1;&lt;br /&gt;
string gLm2;&lt;br /&gt;
string gNC;&lt;br /&gt;
string gUrl=&amp;quot;https://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts&amp;quot;;					// HTTP URL to give out&lt;br /&gt;
string gGroup=&amp;quot;OBJECT&amp;quot;;		// UUID only for the group or OBJECT if it is to take the prims group&lt;br /&gt;
integer gChannel;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
	// Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
	// Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
	// Always leaves sign bit unset (so is always positive)&lt;br /&gt;
	integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_landmark (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm1); &lt;br /&gt;
    }&lt;br /&gt;
    if (gLm2 != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gLm2);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key av)&lt;br /&gt;
{&lt;br /&gt;
    if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        llGiveInventory(av, gNC); &lt;br /&gt;
    }	&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_link (key av)&lt;br /&gt;
{&lt;br /&gt;
	if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llLoadURL (av, &amp;quot;Giving Link&amp;quot;, gUrl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_group (key av)&lt;br /&gt;
{&lt;br /&gt;
	if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llWhisper (0, &amp;quot;Click on the following link to join the group\nsecondlife://app/group/&amp;quot; + gGroup + &amp;quot;/about&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez (integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
		if (gGroup == &amp;quot;OBJECT&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			// Use the group from the prim&lt;br /&gt;
			gGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// See if there are landmarks to give out&lt;br /&gt;
		gLm1 = llGetInventoryName(INVENTORY_LANDMARK, 0);&lt;br /&gt;
		gLm2 = llGetInventoryName(INVENTORY_LANDMARK, 1);&lt;br /&gt;
		gNC = llGetInventoryName (INVENTORY_NOTECARD, 0);&lt;br /&gt;
		&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
&lt;br /&gt;
		gChannel = getRandomChannel();&lt;br /&gt;
		&lt;br /&gt;
		llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
		list buttons=[];&lt;br /&gt;
		if (gLm1 != &amp;quot;&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			buttons += [&amp;quot;Landmark&amp;quot;];&lt;br /&gt;
		}&lt;br /&gt;
		if (gUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			buttons += [&amp;quot;Link&amp;quot;];&lt;br /&gt;
		}&lt;br /&gt;
		if (gGroup != &amp;quot;&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			buttons += [&amp;quot;Group&amp;quot;];&lt;br /&gt;
		}&lt;br /&gt;
		if (gNC != &amp;quot;&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			buttons += [&amp;quot;Notecard&amp;quot;];&lt;br /&gt;
		}&lt;br /&gt;
		integer i;&lt;br /&gt;
		for (i=0; i&amp;lt;total_number; i++)&lt;br /&gt;
		{&lt;br /&gt;
			llDialog (llDetectedKey(i), &amp;quot;Please select&amp;quot;, buttons, gChannel);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	listen (integer channel, string name, key id, string message)&lt;br /&gt;
	{&lt;br /&gt;
		if (channel != gChannel)&lt;br /&gt;
		{&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		if (message == &amp;quot;Landmark&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			give_landmark(id);&lt;br /&gt;
		}&lt;br /&gt;
		else if (message == &amp;quot;Link&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			give_link(id);&lt;br /&gt;
		}&lt;br /&gt;
		else if (message == &amp;quot;Group&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			give_group(id);&lt;br /&gt;
		}&lt;br /&gt;
		else if (message == &amp;quot;Notecard&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			give_notecard(id);&lt;br /&gt;
		}&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;
        {&lt;br /&gt;
			llResetScript();&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;
== HTML Page from a notecard on a prim ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Example to show how a basic HTML page can be read&lt;br /&gt;
// from a notecard and then displayed on the face of a prim.&lt;br /&gt;
//&lt;br /&gt;
// Will also request a tinyurl to give to users on touch&lt;br /&gt;
// - useful for non-viewer 2.0 clients - they can still&lt;br /&gt;
// see the data/page but in an external browser instead.&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino, Jan 2011&lt;br /&gt;
&lt;br /&gt;
// Note that the HTML can only be 1024 characters long - no more!&lt;br /&gt;
integer HTML_FACE_DISPLAY = 2;	// See http://wiki.secondlife.com/wiki/Face&lt;br /&gt;
string   HTML_DEFAULT = &amp;quot;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body {background-color:#808000;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTML on a Prim Example&amp;lt;/h1&amp;gt;&amp;lt;p align=\&amp;quot;centre\&amp;quot;&amp;gt;Kimm Paulino, Jan 2011&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Used when processing notecard-based questions only&lt;br /&gt;
string   HTML_NOTECARD_NAME=&amp;quot;htmlpage&amp;quot;;&lt;br /&gt;
key      gNCQueryId;&lt;br /&gt;
integer gNCLine;&lt;br /&gt;
string   gHtmlPage=&amp;quot;&amp;quot;;&lt;br /&gt;
string   gTinyUrl = &amp;quot;&amp;quot;;&lt;br /&gt;
key      gUrlReqId;&lt;br /&gt;
&lt;br /&gt;
check_notecards()&lt;br /&gt;
{&lt;br /&gt;
	integer nccount = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
	integer i;&lt;br /&gt;
	string  htmlnote;&lt;br /&gt;
	gHtmlPage = &amp;quot;&amp;quot;;&lt;br /&gt;
	&lt;br /&gt;
	for (i=0 ; i&amp;lt;nccount ; i++)&lt;br /&gt;
	{&lt;br /&gt;
		htmlnote = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
		if (htmlnote == HTML_NOTECARD_NAME)&lt;br /&gt;
		{&lt;br /&gt;
			gNCLine = 0;&lt;br /&gt;
			gNCQueryId = llGetNotecardLine (HTML_NOTECARD_NAME, gNCLine);&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
	// if got here then there is no notecard with HTML info in it,&lt;br /&gt;
	// so show the current page and return&lt;br /&gt;
	show_html_page();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show_html_page ()&lt;br /&gt;
{&lt;br /&gt;
    string html = &amp;quot;data:text/html,&amp;quot;;&lt;br /&gt;
	if (gHtmlPage != &amp;quot;&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		html += llEscapeURL (gHtmlPage);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		html += llEscapeURL (HTML_DEFAULT);&lt;br /&gt;
	}&lt;br /&gt;
	// note that this is limited to 1024 characters&lt;br /&gt;
	// See: http://wiki.secondlife.com/wiki/User:Kelly_Linden/lsl_hacks&lt;br /&gt;
	llOwnerSay (&amp;quot;HTML Page Size: &amp;quot; + (string)llStringLength (html));&lt;br /&gt;
    llSetPrimMediaParams(HTML_FACE_DISPLAY,	// Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,		// Show this page immediately&lt;br /&gt;
            PRIM_MEDIA_CURRENT_URL,html,		// The url currently showing&lt;br /&gt;
            PRIM_MEDIA_HOME_URL,html,			// The url if they hit &#039;home&#039;&lt;br /&gt;
            PRIM_MEDIA_HEIGHT_PIXELS,512,		// Height/width of media texture will be&lt;br /&gt;
            PRIM_MEDIA_WIDTH_PIXELS,512,		//   rounded up to nearest power of 2.&lt;br /&gt;
			 PRIM_MEDIA_AUTO_SCALE, FALSE,&lt;br /&gt;
			PRIM_MEDIA_CONTROLS, PRIM_MEDIA_CONTROLS_MINI&lt;br /&gt;
			]);&lt;br /&gt;
&lt;br /&gt;
	// Request a new Tiny URL for this data&lt;br /&gt;
	gUrlReqId = llHTTPRequest(&amp;quot;http://tinyurl.com/api-create.php?url=&amp;quot; + html, [], &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry ()&lt;br /&gt;
	{&lt;br /&gt;
		check_notecards();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	touch_start (integer num_detected)&lt;br /&gt;
	{&lt;br /&gt;
		if (gTinyUrl != &amp;quot;&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			llLoadURL (llDetectedKey(0), &amp;quot;Media on a Prim URL&amp;quot;, gTinyUrl);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
    dataserver (key query_id, string data)&lt;br /&gt;
	{&lt;br /&gt;
		if (query_id != gNCQueryId)&lt;br /&gt;
		{&lt;br /&gt;
			// Not for us&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
		if (data == EOF)&lt;br /&gt;
		{&lt;br /&gt;
			// All done&lt;br /&gt;
			show_html_page();&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// Otherwise add the data from the notecard to the CSS string&lt;br /&gt;
		gHtmlPage += data;&lt;br /&gt;
		&lt;br /&gt;
		// and read the next line&lt;br /&gt;
        gNCLine++;&lt;br /&gt;
        gNCQueryId = llGetNotecardLine(HTML_NOTECARD_NAME, gNCLine);&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;
		{&lt;br /&gt;
			check_notecards();&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;
		if (request_id == gUrlReqId)&lt;br /&gt;
		{&lt;br /&gt;
			if (status == 200)&lt;br /&gt;
			{&lt;br /&gt;
				gTinyUrl = body;&lt;br /&gt;
				llOwnerSay (&amp;quot;Tinyurl obtained: &amp;quot; + gTinyUrl);&lt;br /&gt;
				gUrlReqId = &amp;quot;&amp;quot;;&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				llOwnerSay (&amp;quot;http_response: Status=&amp;quot; + (string)status + &amp;quot; Body=&amp;quot; + body);&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;
== Multiple Notecard Giver ==&lt;br /&gt;
&lt;br /&gt;
This populates a dialog based on the number of notecards in the inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// Script to present a dialog populated with a list of notecards&lt;br /&gt;
// from the prims inventory&lt;br /&gt;
//&lt;br /&gt;
// Note that only the first 24 characters of the notecard names&lt;br /&gt;
// are actually used - as only 24 chars can be placed in a dialog&lt;br /&gt;
// button.  This means that if two notecards have the first 24 chars&lt;br /&gt;
// the same, the second will be ignored ...&lt;br /&gt;
//&lt;br /&gt;
// Note however that usually, buttons don&#039;t display more than, say,&lt;br /&gt;
// around 10 or so characters anyway!!&lt;br /&gt;
//&lt;br /&gt;
// Kimm Paulino&lt;br /&gt;
// Written for Vikki Hastings, June 2011&lt;br /&gt;
&lt;br /&gt;
// Configure the behaviour we want&lt;br /&gt;
string  gFloatingText = &amp;quot;Click for notecards&amp;quot;;  // Set to &amp;quot;&amp;quot; to disable&lt;br /&gt;
vector  gFloatingTextColour = &amp;lt;1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
float   gFloatingTextAlpha = 1.0;&lt;br /&gt;
&lt;br /&gt;
integer gChannel;&lt;br /&gt;
integer gMenuPage;&lt;br /&gt;
integer gNumNotecards;&lt;br /&gt;
list gNotecards;&lt;br /&gt;
&lt;br /&gt;
string MENU_NEXT=&amp;quot;Next&amp;gt;&amp;quot;;&lt;br /&gt;
string MENU_TOP=&amp;quot;Top&amp;quot;;&lt;br /&gt;
string MENU_BACK=&amp;quot;&amp;lt;Back&amp;quot;;&lt;br /&gt;
string MENU_SPACE=&amp;quot; &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer getRandomChannel ()&lt;br /&gt;
{&lt;br /&gt;
	// Based on http://tali.appspot.com/html/scripting/snippets.html&lt;br /&gt;
	// Always leaves 17th bit set (so never a number less than 65535)&lt;br /&gt;
	// Always leaves sign bit unset (so is always positive)&lt;br /&gt;
	integer pos_int = (((integer)llFrand(16384)) &amp;lt;&amp;lt; 17) | 65536 | ((integer)llFrand(65535));&lt;br /&gt;
    return -pos_int;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
read_notecards ()&lt;br /&gt;
{&lt;br /&gt;
    gNumNotecards = llGetInventoryNumber (INVENTORY_NOTECARD);&lt;br /&gt;
    gNotecards = [];&lt;br /&gt;
	&lt;br /&gt;
	if (gNumNotecards == 0)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay (&amp;quot;Note: There are no notecards in this prim to give to people ...&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0; i&amp;lt;gNumNotecards; i++)&lt;br /&gt;
	{&lt;br /&gt;
		string nc = llGetInventoryName (INVENTORY_NOTECARD, i);&lt;br /&gt;
		// Only store the first 24 characters of the name as this is all we can&lt;br /&gt;
		// show in a dialog anyway&lt;br /&gt;
		gNotecards += [llGetSubString (nc, 0, 23)];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
give_notecard (key id, string nc)&lt;br /&gt;
{&lt;br /&gt;
	integer idx = llListFindList (gNotecards, [nc]);&lt;br /&gt;
	if (idx == -1)&lt;br /&gt;
	{&lt;br /&gt;
		// Didn&#039;t find it in the list - might not be a notecard&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Now need to find the notecard that matches from the inventory&lt;br /&gt;
	// and give it out&lt;br /&gt;
	integer i;&lt;br /&gt;
	for (i=0; i&amp;lt;gNumNotecards ; i++)&lt;br /&gt;
	{&lt;br /&gt;
		string nc_full = llGetInventoryName(INVENTORY_NOTECARD, i);&lt;br /&gt;
		if (llGetSubString (nc_full, 0, 23) == nc)&lt;br /&gt;
		{&lt;br /&gt;
			// This is the one&lt;br /&gt;
			llGiveInventory (id, nc_full);&lt;br /&gt;
			return;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// if get here, then didn&#039;t get a match ... hmm&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
show_dialog (key id)&lt;br /&gt;
{&lt;br /&gt;
    list buttons = [];&lt;br /&gt;
	&lt;br /&gt;
	if (gNumNotecards == 0)&lt;br /&gt;
	{&lt;br /&gt;
		llDialog (id, &amp;quot;There are no notecards to give at present.\nThe Owner doesn&#039;t appear to have put any in yet.&amp;quot;, [], gChannel);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	// If several people are using the giver, then it is possible&lt;br /&gt;
	// for gMenuPage to go negative or too high&lt;br /&gt;
	if (gMenuPage &amp;lt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		// Reset ...&lt;br /&gt;
		gMenuPage = 0;&lt;br /&gt;
	}&lt;br /&gt;
	integer num_pages = ((gNumNotecards+8)/9);&lt;br /&gt;
	if (gMenuPage &amp;gt;= num_pages)&lt;br /&gt;
	{&lt;br /&gt;
		// gMenuPage is an index starting at 0...&lt;br /&gt;
		// max is a 1...&lt;br /&gt;
		gMenuPage = num_pages-1;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	// Note: This yields notecards counting as follows:&lt;br /&gt;
	// 0 to 8 = first page,&lt;br /&gt;
	// 9 to 17 = next page, etc&lt;br /&gt;
	integer first_nc = gMenuPage * 9;&lt;br /&gt;
	integer last_nc = first_nc + 9 - 1;&lt;br /&gt;
	if (last_nc &amp;gt;= gNumNotecards)&lt;br /&gt;
	{&lt;br /&gt;
		// recall last_nc indexed from 0, but&lt;br /&gt;
		// gNumNotecards is indexed from 1&lt;br /&gt;
		last_nc = gNumNotecards-1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//	llOwnerSay (&amp;quot;Menu Page: &amp;quot; + (string)gMenuPage);&lt;br /&gt;
//	llOwnerSay (&amp;quot;First NC: &amp;quot; + (string)first_nc);&lt;br /&gt;
//	llOwnerSay (&amp;quot;Last NC: &amp;quot; + (string)last_nc);&lt;br /&gt;
&lt;br /&gt;
    if (gMenuPage &amp;gt; 0)&lt;br /&gt;
	{&lt;br /&gt;
        buttons += [MENU_BACK];&lt;br /&gt;
	}&lt;br /&gt;
    else&lt;br /&gt;
	{&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if (gMenuPage == 0)&lt;br /&gt;
	{&lt;br /&gt;
		buttons += [MENU_SPACE];&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		&lt;br /&gt;
		buttons += [MENU_TOP];&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// If not on the last page, and there are more pages to come ...&lt;br /&gt;
    if (gNumNotecards &amp;gt; 9 &amp;amp;&amp;amp; gMenuPage &amp;lt; (num_pages-1))&lt;br /&gt;
	{&lt;br /&gt;
        buttons += [MENU_NEXT];&lt;br /&gt;
	}&lt;br /&gt;
    else&lt;br /&gt;
	{&lt;br /&gt;
        buttons += [MENU_SPACE];&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=first_nc; (i &amp;lt;= last_nc) &amp;amp;&amp;amp; (i &amp;lt; gNumNotecards); i++)&lt;br /&gt;
	{&lt;br /&gt;
        buttons += [llList2String (gNotecards, i)];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    llDialog (id, &amp;quot;\n\n(click \&amp;quot;Ignore\&amp;quot; when done)&amp;quot;, buttons, gChannel);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	on_rez (integer start_param)&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
	{&lt;br /&gt;
        llSetText (gFloatingText, gFloatingTextColour, gFloatingTextAlpha);&lt;br /&gt;
        read_notecards();&lt;br /&gt;
		gMenuPage = 0;&lt;br /&gt;
        gChannel = getRandomChannel();&lt;br /&gt;
		&lt;br /&gt;
		// Would be less laggy to close listen when not in use&lt;br /&gt;
		// but then if two people attempted to use the giver,&lt;br /&gt;
		// it wouldn&#039;t be able to cope.  This way, they can both&lt;br /&gt;
		// use it at the same time ...&lt;br /&gt;
		llListen (gChannel, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
	{&lt;br /&gt;
		// Start menu system again. Note that I don&#039;t do anything special&lt;br /&gt;
		// with several people trying to touch it at the same time - it will&lt;br /&gt;
		// always overlap the processing of gMenuPage, but all that will&lt;br /&gt;
		// happen is that peoples next/back might be a bit quirky for a while.&lt;br /&gt;
		// Eventually, they will sort themselves out!&lt;br /&gt;
		gMenuPage = 0;&lt;br /&gt;
        show_dialog (llDetectedKey(0));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen (integer channel, string name, key id, string msg)&lt;br /&gt;
	{&lt;br /&gt;
        if (channel == gChannel)&lt;br /&gt;
		{&lt;br /&gt;
            if (msg == MENU_BACK)&lt;br /&gt;
			{&lt;br /&gt;
                gMenuPage--;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_TOP)&lt;br /&gt;
			{&lt;br /&gt;
				gMenuPage = 0;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg == MENU_NEXT)&lt;br /&gt;
			{&lt;br /&gt;
                gMenuPage++;&lt;br /&gt;
                show_dialog (id);&lt;br /&gt;
            }            &lt;br /&gt;
            else&lt;br /&gt;
			{&lt;br /&gt;
				// should be something in the inventory to give out&lt;br /&gt;
				give_notecard (id, msg);&lt;br /&gt;
			}&lt;br /&gt;
        }&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;
		{&lt;br /&gt;
			llResetScript();&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>Kimm Paulino</name></author>
	</entry>
</feed>