<?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_Turret-Preview6.lsl</id>
		<title>User:Allen Kerensky/Myriad Lite/Myriad Lite Turret-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_Turret-Preview6.lsl"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite/Myriad_Lite_Turret-Preview6.lsl&amp;action=history"/>
		<updated>2026-06-13T20:09:05Z</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_Turret-Preview6.lsl&amp;diff=30398&amp;oldid=prev</id>
		<title>Allen Kerensky: patched version uploaded</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite/Myriad_Lite_Turret-Preview6.lsl&amp;diff=30398&amp;oldid=prev"/>
				<updated>2012-08-12T18:10:05Z</updated>
		
		<summary type="html">&lt;p&gt;patched version uploaded&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 18:10, 12 August 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;// MYRIAD COMBAT STATS&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;// MYRIAD COMBAT STATS&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer POWER = &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;3&lt;/del&gt;; // attack stat&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer POWER = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1&lt;/ins&gt;; // attack stat &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;- should stay 1 like an NPC Critter Goon&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer ATTSKILL = 1; // attack skill&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer ATTSKILL = 1; // attack skill &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1-10, 1-5 is human range, 6+ is supernatural&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer DAMAGEDICE = &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer DAMAGEDICE = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;3&lt;/ins&gt;; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;// 3 = automatic pistol damage class&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;// TURRENT CONFIGURATION&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;// TURRENT CONFIGURATION&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 48:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;float RATE = 0.5; // seconds between shots&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;float RATE = 0.5; // seconds between shots&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;float BULLET_VELOCITY = 30.0;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  // change this to change the speed of the bullet.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;float BULLET_VELOCITY = 30.0;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  // change this to change the speed of the bullet.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;string &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;gunsound &lt;/del&gt;= &amp;quot;pistol_shot.wav&amp;quot;;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; // string; name of sound in inventory&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;string &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;GUNSOUND &lt;/ins&gt;= &amp;quot;pistol_shot.wav&amp;quot;;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; // string; name of sound in inventory&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;string &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ammo &lt;/del&gt;=&amp;#160; &amp;quot;Myriad Lite &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Bullet &lt;/del&gt;Turret Preview 6&amp;quot;; //name of desired object to be shot out. Must be in the inventory of the &amp;quot;gun&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;string &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;AMMO &lt;/ins&gt;=&amp;#160; &amp;quot;Myriad Lite Turret &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Bullet &lt;/ins&gt;Preview 6&amp;quot;; //name of desired object to be shot out. Must be in the inventory of the &amp;quot;gun&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer ANTIDELAY = TRUE; // use antidelay nodes for rapid fire?&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer ANTIDELAY = TRUE; // use antidelay nodes for rapid fire?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 56:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 57:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer CHANOBJECT;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer CHANOBJECT;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer HANDLE;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;integer HANDLE;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;vector &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;OFFSET &lt;/del&gt;= &amp;lt;0,0, 2.1&amp;gt;;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; // rez offset for bullet&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;vector &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;REZ_OFFSET &lt;/ins&gt;= &amp;lt;0,0, 2.1&amp;gt;;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; // rez offset for bullet&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;vector &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pos&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;vector &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;POS&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;rotation &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;rot&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;rotation &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ROT&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;vector &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;offset&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;vector &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;OFFSET&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;string DIV = &amp;quot;|&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;string DIV = &amp;quot;|&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 119:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 120:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; if(llVecDist(llGetPos(),llDetectedPos(0)+llRot2Fwd(llDetectedRot(0))*dist) &amp;lt; 1.5) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; if(llVecDist(llGetPos(),llDetectedPos(0)+llRot2Fwd(llDetectedRot(0))*dist) &amp;lt; 1.5) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; // Fire 1 bullet,,&amp;#160; the heart of the firearm script.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; // Fire 1 bullet,,&amp;#160; the heart of the firearm script.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pos &lt;/del&gt;= llGetPos(); // get our current position&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;POS &lt;/ins&gt;= llGetPos(); // get our current position&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;rot &lt;/del&gt;= llGetRot(); // get our current rotation&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ROT &lt;/ins&gt;= llGetRot(); // get our current rotation&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;offset &lt;/del&gt;= &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;OFFSET&lt;/del&gt;; // start with the base offset for the gun held in the right hand&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;OFFSET &lt;/ins&gt;= &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;REZ_OFFSET&lt;/ins&gt;; // start with the base offset for the gun held in the right hand&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;offset &lt;/del&gt;*= &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;rot&lt;/del&gt;; // now, rotate the offset to match the avatar rotation&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;OFFSET &lt;/ins&gt;*= &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ROT&lt;/ins&gt;; // now, rotate the offset to match the avatar rotation&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pos &lt;/del&gt;+= &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;offset&lt;/del&gt;; // now combine the rotated offset with avatar position &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;POS &lt;/ins&gt;+= &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;OFFSET&lt;/ins&gt;; // now combine the rotated offset with avatar position &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; vector fwd = llRot2Up(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;rot&lt;/del&gt;); // calculate the direction that is &amp;quot;avatar's facing&amp;quot; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; vector fwd = llRot2Up(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ROT&lt;/ins&gt;); // calculate the direction that is &amp;quot;avatar's facing&amp;quot; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; fwd *= BULLET_VELOCITY; // now multiply that by bullet speed to tell bullet to push in that direction, that fast&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; fwd *= BULLET_VELOCITY; // now multiply that by bullet speed to tell bullet to push in that direction, that fast&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; //rot *= llEuler2Rot(&amp;lt;0, PI_BY_TWO, 0&amp;gt;); // now, straighten rotation for object we're about to rez&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; //rot *= llEuler2Rot(&amp;lt;0, PI_BY_TWO, 0&amp;gt;); // now, straighten rotation for object we're about to rez&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; llPlaySound(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;gunsound&lt;/del&gt;,1.0); // here &amp;quot;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;gunsound&lt;/del&gt;&amp;quot;is a variable defined above.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; llPlaySound(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;GUNSOUND&lt;/ins&gt;,1.0); // here &amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;GUNSOUND&lt;/ins&gt;&amp;quot;is a variable defined above.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; // DAMAGEDICE is passed to rez-param of bullet. Myriad Bullets read this as damage dice to do if they hit&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; // DAMAGEDICE is passed to rez-param of bullet. Myriad Bullets read this as damage dice to do if they hit&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; if ( ANTIDELAY == FALSE ) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; if ( ANTIDELAY == FALSE ) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; llRezObject(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ammo&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pos&lt;/del&gt;, fwd, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;rot&lt;/del&gt;, DAMAGEDICE); // does the actual work rezzes the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ammo &lt;/del&gt;in the specified variables.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; llRezObject(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;AMMO&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;POS&lt;/ins&gt;, fwd, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ROT&lt;/ins&gt;, DAMAGEDICE); // does the actual work rezzes the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;AMMO &lt;/ins&gt;in the specified variables.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; } else {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; } else {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; llMessageLinked(LINK_THIS,-123,&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ammo&lt;/del&gt;+&amp;quot;~~~&amp;quot;+(string)&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pos&lt;/del&gt;+&amp;quot;~~~&amp;quot;+(string)fwd+&amp;quot;~~~&amp;quot;+(string)&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;rot&lt;/del&gt;+&amp;quot;~~~&amp;quot;+(string)DAMAGEDICE,&amp;quot;rezobject&amp;quot;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; llMessageLinked(LINK_THIS,-123,&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;AMMO&lt;/ins&gt;+&amp;quot;~~~&amp;quot;+(string)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;POS&lt;/ins&gt;+&amp;quot;~~~&amp;quot;+(string)fwd+&amp;quot;~~~&amp;quot;+(string)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ROT&lt;/ins&gt;+&amp;quot;~~~&amp;quot;+(string)DAMAGEDICE,&amp;quot;rezobject&amp;quot;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; //llSleep(RATE); // force a pause between shots&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; //llSleep(RATE); // force a pause between shots&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Allen Kerensky</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite/Myriad_Lite_Turret-Preview6.lsl&amp;diff=30395&amp;oldid=prev</id>
		<title>Allen Kerensky: Myriad_Lite_Turret-Preview6.lsl</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite/Myriad_Lite_Turret-Preview6.lsl&amp;diff=30395&amp;oldid=prev"/>
				<updated>2012-08-12T17:56:08Z</updated>
		
		<summary type="html">&lt;p&gt;Myriad_Lite_Turret-Preview6.lsl&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Myriad_Lite_Turret-Preview6.lsl =&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
// Myriad_Lite_Turret-v0.0.1-20120807.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;
string  VERSION = &amp;quot;0.0.1&amp;quot;; // version number&lt;br /&gt;
string  VERDATE = &amp;quot;20120807&amp;quot;; // version date&lt;br /&gt;
&lt;br /&gt;
// MYRIAD COMBAT STATS&lt;br /&gt;
integer POWER = 3; // attack stat&lt;br /&gt;
integer ATTSKILL = 1; // attack skill&lt;br /&gt;
integer DAMAGEDICE = 1;&lt;br /&gt;
&lt;br /&gt;
// TURRENT CONFIGURATION&lt;br /&gt;
float RANGE = 30.0; // detection range to start shooting&lt;br /&gt;
float RATE = 0.5; // seconds between shots&lt;br /&gt;
float BULLET_VELOCITY = 30.0;                       // change this to change the speed of the bullet.&lt;br /&gt;
string gunsound = &amp;quot;pistol_shot.wav&amp;quot;;                            // string; name of sound in inventory&lt;br /&gt;
string ammo =  &amp;quot;Myriad Lite Bullet Turret Preview 6&amp;quot;; //name of desired object to be shot out. Must be in the inventory of the &amp;quot;gun&amp;quot;.&lt;br /&gt;
integer ANTIDELAY = TRUE; // use antidelay nodes for rapid fire?&lt;br /&gt;
&lt;br /&gt;
// RUNTIME&lt;br /&gt;
integer FLAG_DEBUG;&lt;br /&gt;
integer ISACTIVE = FALSE;&lt;br /&gt;
integer CHANOBJECT;&lt;br /&gt;
integer HANDLE;&lt;br /&gt;
vector OFFSET = &amp;lt;0,0, 2.1&amp;gt;;                // rez offset for bullet&lt;br /&gt;
vector pos;&lt;br /&gt;
rotation rot;&lt;br /&gt;
vector offset;&lt;br /&gt;
string DIV = &amp;quot;|&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// DEBUG&lt;br /&gt;
DEBUG(string debugmsg) {&lt;br /&gt;
    if ( FLAG_DEBUG == TRUE ) llOwnerSay(&amp;quot;TURRET: &amp;quot;+(string)debugmsg);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// SETUP&lt;br /&gt;
SETUP() {&lt;br /&gt;
    FLAG_DEBUG = FALSE;&lt;br /&gt;
    ANTIDELAY = FALSE;&lt;br /&gt;
    CHANOBJECT = (integer)(&amp;quot;0x&amp;quot;+llGetSubString(llGetKey(),0,6)); // calculate turret's dynamic channel&lt;br /&gt;
    if ( HANDLE != 0 ) llListenRemove(HANDLE);&lt;br /&gt;
    HANDLE = llListen(CHANOBJECT,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    // LISTEN EVENT - whispers, says, shouts, regionsays&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    listen(integer channel,string speakername,key speakerid,string message) {&lt;br /&gt;
        DEBUG(&amp;quot;listen: &amp;quot;+message);&lt;br /&gt;
        channel = 0; //LSLINT&lt;br /&gt;
        speakername = &amp;quot;&amp;quot;; //LSLINT&lt;br /&gt;
        speakerid = NULL_KEY; //LSLINT&lt;br /&gt;
        list fields = llParseString2List(message,[DIV],[]); // break line of text into = delimited fields&lt;br /&gt;
        string command = llToLower(llStringTrim(llList2String(fields,0),STRING_TRIM)); // field zero is the &amp;quot;command&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        // If Your Bullet has hit, fire a hitcheck regionwide at targetplayer's channel&lt;br /&gt;
        if ( command == &amp;quot;rangedcombat&amp;quot; ) {&lt;br /&gt;
            integer attdice = llList2Integer(fields,1); // get attack dice of weapon used&lt;br /&gt;
            string hitwho = llList2String(fields,2); // get UUID of who we hit&lt;br /&gt;
            string bywho = llList2String(fields,3); // should be our own UUID&lt;br /&gt;
            string bywhat = llList2String(fields,4); // name of item we hit with (good for bullets/missiles)&lt;br /&gt;
&lt;br /&gt;
            integer victimchan = (integer)(&amp;quot;0x&amp;quot;+llGetSubString(hitwho,0,6)); // calculate victim's dynamic channel&lt;br /&gt;
            llRegionSay(victimchan,&amp;quot;RANGEDHIT&amp;quot;+DIV+(string)POWER+DIV+(string)ATTSKILL+DIV+(string)attdice+DIV+(string)bywho+DIV+bywhat); // attack!&lt;br /&gt;
            DEBUG((string)victimchan+&amp;quot; RANGEDHIT&amp;quot;+DIV+(string)POWER+DIV+(string)ATTSKILL+DIV+(string)attdice+DIV+(string)bywho+DIV+bywhat);&lt;br /&gt;
            return;&lt;br /&gt;
        } // end if RANGEDCOMBAT/TOHIT&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    no_sensor() {&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // OBJECT_REZ&lt;br /&gt;
    object_rez(key child) { // tell child turret bullet our key for combat resolution&lt;br /&gt;
        integer childchan = (integer)(&amp;quot;0x&amp;quot;+llGetSubString((string)child,0,6)); // get turret bullet's dynamic channel&lt;br /&gt;
        llRegionSay(childchan,(string)llGetKey()); // tell turret bullet who shot them&lt;br /&gt;
    }    &lt;br /&gt;
    &lt;br /&gt;
    sensor(integer num_detected) {&lt;br /&gt;
        num_detected = 0; //LSLINT&lt;br /&gt;
        // use sensor detected index 0 to only shoot at closest &lt;br /&gt;
        vector targetpos = llDetectedPos(0);&lt;br /&gt;
        llLookAt(targetpos,1,1);&lt;br /&gt;
        float dist = llVecDist(llGetPos(),llDetectedPos(0));&lt;br /&gt;
        if(llVecDist(llGetPos(),llDetectedPos(0)+llRot2Fwd(llDetectedRot(0))*dist) &amp;lt; 1.5) {&lt;br /&gt;
            // Fire 1 bullet,,  the heart of the firearm script.&lt;br /&gt;
            pos = llGetPos(); // get our current position&lt;br /&gt;
            rot = llGetRot(); // get our current rotation&lt;br /&gt;
            offset = OFFSET; // start with the base offset for the gun held in the right hand&lt;br /&gt;
            offset *= rot; // now, rotate the offset to match the avatar rotation&lt;br /&gt;
            pos += offset; // now combine the rotated offset with avatar position &lt;br /&gt;
            vector fwd = llRot2Up(rot); // calculate the direction that is &amp;quot;avatar's facing&amp;quot; &lt;br /&gt;
            fwd *= BULLET_VELOCITY; // now multiply that by bullet speed to tell bullet to push in that direction, that fast&lt;br /&gt;
            //rot *= llEuler2Rot(&amp;lt;0, PI_BY_TWO, 0&amp;gt;); // now, straighten rotation for object we're about to rez&lt;br /&gt;
            llPlaySound(gunsound,1.0); // here &amp;quot;gunsound&amp;quot;is a variable defined above.&lt;br /&gt;
            // DAMAGEDICE is passed to rez-param of bullet. Myriad Bullets read this as damage dice to do if they hit&lt;br /&gt;
            if ( ANTIDELAY == FALSE ) {&lt;br /&gt;
                llRezObject(ammo, pos, fwd, rot, DAMAGEDICE); // does the actual work rezzes the ammo in the specified variables.&lt;br /&gt;
            } else {&lt;br /&gt;
                llMessageLinked(LINK_THIS,-123,ammo+&amp;quot;~~~&amp;quot;+(string)pos+&amp;quot;~~~&amp;quot;+(string)fwd+&amp;quot;~~~&amp;quot;+(string)rot+&amp;quot;~~~&amp;quot;+(string)DAMAGEDICE,&amp;quot;rezobject&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            //llSleep(RATE); // force a pause between shots            &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() {&lt;br /&gt;
        SETUP();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer num_detected) {&lt;br /&gt;
        num_detected = 0; // LSLINT&lt;br /&gt;
        if ( ISACTIVE == FALSE ) {&lt;br /&gt;
            ISACTIVE = TRUE;&lt;br /&gt;
            CHANOBJECT = (integer)(&amp;quot;0x&amp;quot;+llGetSubString(llGetKey(),0,6));&lt;br /&gt;
            HANDLE = llListen(CHANOBJECT,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
            llSensorRepeat(&amp;quot;&amp;quot;,NULL_KEY,AGENT,RANGE,PI,RATE);&lt;br /&gt;
            llSay(PUBLIC_CHANNEL,&amp;quot;Turret active&amp;quot;);&lt;br /&gt;
        } else {&lt;br /&gt;
            ISACTIVE = FALSE;&lt;br /&gt;
            llSensorRemove();&lt;br /&gt;
            llListenRemove(HANDLE);&lt;br /&gt;
            llSay(PUBLIC_CHANNEL,&amp;quot;Turret no longer active&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Allen Kerensky</name></author>	</entry>

	</feed>