<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://opensimulator.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://opensimulator.org/index.php?action=history&amp;feed=atom&amp;title=User%3AAllen_Kerensky%2FMyriad_Lite%2FMyriad_Lite_Holster-Preview6.lsl</id>
		<title>User:Allen Kerensky/Myriad Lite/Myriad Lite Holster-Preview6.lsl - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://opensimulator.org/index.php?action=history&amp;feed=atom&amp;title=User%3AAllen_Kerensky%2FMyriad_Lite%2FMyriad_Lite_Holster-Preview6.lsl"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite/Myriad_Lite_Holster-Preview6.lsl&amp;action=history"/>
		<updated>2026-06-13T21:22:36Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.9</generator>

	<entry>
		<id>http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite/Myriad_Lite_Holster-Preview6.lsl&amp;diff=30303&amp;oldid=prev</id>
		<title>Allen Kerensky: Myriad_Lite_Holster-Preview6.lsl</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite/Myriad_Lite_Holster-Preview6.lsl&amp;diff=30303&amp;oldid=prev"/>
				<updated>2012-08-11T23:30:15Z</updated>
		
		<summary type="html">&lt;p&gt;Myriad_Lite_Holster-Preview6.lsl&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Myriad_Lite_Holster-Preview6.lsl =&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
//============================================================================&lt;br /&gt;
// Myriad_Lite_Holster-Preview6.lsl&lt;br /&gt;
// Copyright (c) 2012 by Allen Kerensky (OSG/SL) All Rights Reserved.&lt;br /&gt;
// This work is dual-licensed under&lt;br /&gt;
// Creative Commons Attribution (CC BY) 3.0 Unported&lt;br /&gt;
// http://creativecommons.org/licenses/by/3.0/&lt;br /&gt;
// - or -&lt;br /&gt;
// Modified BSD License (3-clause)&lt;br /&gt;
// Redistribution and use in source and binary forms, with or without&lt;br /&gt;
// modification, are permitted provided that the following conditions are met:&lt;br /&gt;
// * Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
//   this list of conditions and the following disclaimer.&lt;br /&gt;
// * Redistributions in binary form must reproduce the above copyright notice,&lt;br /&gt;
//   this list of conditions and the following disclaimer in the documentation&lt;br /&gt;
//   and/or other materials provided with the distribution.&lt;br /&gt;
// * Neither the name of Myriad Lite nor the names of its contributors may be&lt;br /&gt;
//   used to endorse or promote products derived from this software without&lt;br /&gt;
//   specific prior written permission.&lt;br /&gt;
//&lt;br /&gt;
// THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR&lt;br /&gt;
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES&lt;br /&gt;
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN&lt;br /&gt;
// NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,&lt;br /&gt;
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT&lt;br /&gt;
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,&lt;br /&gt;
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY&lt;br /&gt;
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT&lt;br /&gt;
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF&lt;br /&gt;
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
//&lt;br /&gt;
// The Myriad RPG System was designed, written, and illustrated by Ashok Desai&lt;br /&gt;
// Myriad RPG System licensed under:&lt;br /&gt;
// Creative Commons Attribution (CC BY) 2.0 UK: England and Wales&lt;br /&gt;
// http://creativecommons.org/licenses/by/2.0/uk/&lt;br /&gt;
//============================================================================&lt;br /&gt;
&lt;br /&gt;
//===========================================================================&lt;br /&gt;
// MESSAGE FORMAT REFERENCE&lt;br /&gt;
//===========================================================================&lt;br /&gt;
// CHANATTACH IN - DRAWLEFT,DRAWRIGHT,DRAWBOTH&lt;br /&gt;
// CHANATTACH IN - HOLSTERLEFT,HOLSTERRIGHT,HOLSTERBOTH&lt;br /&gt;
// CHANATTACH IN - SHEATHELEFT,SHEATHERIGHT,SHEATHEBOTH&lt;br /&gt;
&lt;br /&gt;
string  VERSION = &amp;quot;0.0.1&amp;quot;; // version number&lt;br /&gt;
string  VERDATE = &amp;quot;20120201&amp;quot;; // version date&lt;br /&gt;
&lt;br /&gt;
list LEFTATTACHED = [3,7,20,21,25,26,27,29]; // left side holster attachment slots&lt;br /&gt;
list RIGHTATTACHED = [4,8,18,19,22,23,24,30]; // right side holster attachment slots&lt;br /&gt;
&lt;br /&gt;
//===========================================================================&lt;br /&gt;
// GLOBAL RUNTIMES - runtime variables we change as we go&lt;br /&gt;
// Don't alter anything below if your not  familiar with it.&lt;br /&gt;
//===========================================================================&lt;br /&gt;
integer CHANATTACH = 0; // dynamic channel for attachment messages&lt;br /&gt;
integer HANDATTACH = 0; // chat channel handle for attachment dynamic channel&lt;br /&gt;
&lt;br /&gt;
//===========================================================================&lt;br /&gt;
// GLOBAL SETUP&lt;br /&gt;
//===========================================================================&lt;br /&gt;
SETUP() {&lt;br /&gt;
    CHANATTACH = (integer)(&amp;quot;0x&amp;quot;+llGetSubString((string)llGetOwner(),1,7)); // calculate the dynamic attachment channel&lt;br /&gt;
    if ( HANDATTACH != 0 ) llListenRemove(HANDATTACH); // clean up a previous listener&lt;br /&gt;
    HANDATTACH = llListen(CHANATTACH,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;); // start a listener on the attachment channel&lt;br /&gt;
    llSetLinkAlpha(LINK_SET,1.0,ALL_SIDES); // make holster/sheathe visible&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// DRAW THE WEAPON&lt;br /&gt;
DRAW(string hand) {&lt;br /&gt;
    // draw code goes here&lt;br /&gt;
    if ( llListFindList(LEFTATTACHED,[llGetAttached()]) != -1 &amp;amp;&amp;amp; ( hand == &amp;quot;left&amp;quot; || hand == &amp;quot;both&amp;quot; ) ) {&lt;br /&gt;
        llSetLinkAlpha(LINK_SET,0.0,ALL_SIDES); // go invisible when weapon drawn&lt;br /&gt;
    }&lt;br /&gt;
    if ( llListFindList(RIGHTATTACHED,[llGetAttached()]) != -1 &amp;amp;&amp;amp; ( hand == &amp;quot;right&amp;quot; || hand == &amp;quot;both&amp;quot; ) ) {&lt;br /&gt;
        llSetLinkAlpha(LINK_SET,0.0,ALL_SIDES); // go invisible when weapon drawn&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// HOLSTER THE WEAPON&lt;br /&gt;
HOLSTER(string hand) {&lt;br /&gt;
    // holster code goes here&lt;br /&gt;
    if ( llListFindList(LEFTATTACHED,[llGetAttached()]) != -1 &amp;amp;&amp;amp; ( hand == &amp;quot;left&amp;quot; || hand == &amp;quot;both&amp;quot; ) ) {&lt;br /&gt;
        llSetLinkAlpha(LINK_SET,1.0,ALL_SIDES); // go visible when weapon holstered/sheathed&lt;br /&gt;
    }&lt;br /&gt;
    if ( llListFindList(RIGHTATTACHED,[llGetAttached()]) != -1 &amp;amp;&amp;amp; ( hand == &amp;quot;right&amp;quot; || hand == &amp;quot;both&amp;quot; ) ) {&lt;br /&gt;
        llSetLinkAlpha(LINK_SET,1.0,ALL_SIDES); // go visible when weapon holstered/sheathed&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//===========================================================================&lt;br /&gt;
// STATE DEFAULT - the main state is the default state.&lt;br /&gt;
// When a script is compiled, reset or loaded, this is the state it enters by default.&lt;br /&gt;
//===========================================================================&lt;br /&gt;
default {&lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    // STATE_ENTRY EVENT - Triggered on any state transition and start up&lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        SETUP(); // call global setup&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    // ON_REZ EVENT - Triggered when object attached or rezzed on the ground&lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    on_rez(integer rezparams) {&lt;br /&gt;
        rezparams = 0; // LSLINT&lt;br /&gt;
        SETUP();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    // ATTACH EVENT - when the object is attached or detached&lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    attach(key id) {&lt;br /&gt;
        if ( id != NULL_KEY ) { // attached from ground or inventory&lt;br /&gt;
            SETUP();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    // LISTEN EVENT - listen for whisper, say, shout, regionsay messages&lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    listen(integer channel, string name, key uuid, string message) {&lt;br /&gt;
        name = &amp;quot;&amp;quot;; // LSLINT&lt;br /&gt;
        uuid = NULL_KEY; // LSLINT&lt;br /&gt;
        if ( channel == CHANATTACH ) { // did message come in on attachment channel?&lt;br /&gt;
            if ( message == &amp;quot;DRAWLEFT&amp;quot; ) { DRAW(&amp;quot;left&amp;quot;); return;} // draw weapons if in left hand&lt;br /&gt;
            if ( message == &amp;quot;DRAWRIGHT&amp;quot; ) { DRAW(&amp;quot;right&amp;quot;); return;} // draw weapons in right hand&lt;br /&gt;
            if ( message == &amp;quot;DRAWBOTH&amp;quot; ) { DRAW(&amp;quot;both&amp;quot;); return; } // draw weapons in both hands&lt;br /&gt;
            if ( message == &amp;quot;HOLSTERLEFT&amp;quot; ) { HOLSTER(&amp;quot;left&amp;quot;); return;} // holster left-hand weapons&lt;br /&gt;
            if ( message == &amp;quot;HOLSTERRIGHT&amp;quot; ) { HOLSTER(&amp;quot;right&amp;quot;); return;} // holster right-hand weapons&lt;br /&gt;
            if ( message == &amp;quot;HOLSTERBOTH&amp;quot; ) { HOLSTER(&amp;quot;both&amp;quot;); return; } // holster both weapons&lt;br /&gt;
            if ( message == &amp;quot;SHEATHELEFT&amp;quot; ) { HOLSTER(&amp;quot;left&amp;quot;); return;} // sheathe left-hand weapon&lt;br /&gt;
            if ( message == &amp;quot;SHEATHERIGHT&amp;quot; ) { HOLSTER(&amp;quot;right&amp;quot;); return;} // sheathe right-hand weapons&lt;br /&gt;
            if ( message == &amp;quot;SHEATHBOTH&amp;quot; ) { HOLSTER(&amp;quot;both&amp;quot;); return; } // sheatheholster both weapons&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
} // end of default&lt;br /&gt;
//============================================================================&lt;br /&gt;
// END&lt;br /&gt;
//============================================================================&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Allen Kerensky</name></author>	</entry>

	</feed>