<?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=Honey+Puddles</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=Honey+Puddles"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/wiki/Special:Contributions/Honey_Puddles"/>
	<updated>2026-06-28T10:36:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Honey_Puddles&amp;diff=1216047</id>
		<title>User:Honey Puddles</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Honey_Puddles&amp;diff=1216047"/>
		<updated>2024-01-06T00:30:24Z</updated>

		<summary type="html">&lt;p&gt;Honey Puddles: :)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== :) ==&lt;/div&gt;</summary>
		<author><name>Honey Puddles</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Honey_Puddles&amp;diff=1216046</id>
		<title>User:Honey Puddles</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Honey_Puddles&amp;diff=1216046"/>
		<updated>2024-01-06T00:28:59Z</updated>

		<summary type="html">&lt;p&gt;Honey Puddles: Created page with &amp;quot;:)&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:)&lt;/div&gt;</summary>
		<author><name>Honey Puddles</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_Operators&amp;diff=1216045</id>
		<title>LSL Operators</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_Operators&amp;diff=1216045"/>
		<updated>2024-01-04T23:51:35Z</updated>

		<summary type="html">&lt;p&gt;Honey Puddles: Moved &amp;quot;%&amp;quot; Modulus related notes to their own section, and provided a common usage example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header|ml=*}}&lt;br /&gt;
Operators are used to cause an operation (or mathematical action) to be performed on one (such as !) or two operands. The easy and common example is 1 + 2 where 1 and 2 are operands, and the &#039;&#039;&#039;+&#039;&#039;&#039; is the operator. This concept can be extended much further with LSL since operands can be variables with the special case of the assignment operators requiring that the left hand side be a variable.&lt;br /&gt;
&lt;br /&gt;
The following table lists the operators in descending order of evaluation, i.e. higher in the table means higher evaluation precedence. Multiple operators on the same line share evaluation precedence. Parenthesize an expression if you need to force an evaluation order.&lt;br /&gt;
&lt;br /&gt;
{| bgcolor=&amp;quot;#FFFFFF&amp;quot; border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;6&amp;quot;&lt;br /&gt;
|- bgColor=&amp;quot;#A7C1F2&amp;quot;&lt;br /&gt;
! Operator&lt;br /&gt;
! Description&lt;br /&gt;
! Usage Example&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;()&amp;lt;/code&amp;gt;&lt;br /&gt;
|| parentheses: grouping and evaluation precedence&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer val = a * (b + c);&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[]&amp;lt;/code&amp;gt;&lt;br /&gt;
|| brackets: list constructor&lt;br /&gt;
|| &amp;lt;code&amp;gt;list lst = [a, 2, &amp;quot;this&amp;quot;, 0.01];&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;(&#039;&#039;type&#039;&#039;)&amp;lt;/code&amp;gt;&lt;br /&gt;
|| typecasting&lt;br /&gt;
|| &amp;lt;code&amp;gt;string message = &amp;quot;The result is:&amp;quot; + (string)result;&amp;lt;/code&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;++&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt;&lt;br /&gt;
|| logical NOT, bitwise NOT, increment, decrement&lt;br /&gt;
|| &amp;lt;code&amp;gt;counter++;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt;&lt;br /&gt;
|| multiply/dot product, divide, modulus/cross product&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer rollover = (count + 1) % 5;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;&lt;br /&gt;
|| subtraction, negation&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer one = 3 - 2;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;integer neg_one = -1;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;&lt;br /&gt;
|| addition, string concatenation&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer two = 1 + 1;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;string text = &amp;quot;Hello&amp;quot; + &amp;quot; world&amp;quot;;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;&lt;br /&gt;
|| list concatenation&lt;br /&gt;
|| &amp;lt;code&amp;gt;list myList = [1, 2, 3] + [4, 5];&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;list newList = oldList + addList;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;&amp;amp;lt;&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| [https://en.wikipedia.org/wiki/Arithmetic_shift arithmetic] left shift, [https://en.wikipedia.org/wiki/Arithmetic_shift arithmetic] right shift&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer eight = 4 &amp;amp;lt;&amp;amp;lt; 1;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;integer neg_one = -2 &amp;amp;gt;&amp;amp;gt; 1;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;&amp;amp;lt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;&amp;amp;gt;=&amp;lt;/code&amp;gt;&lt;br /&gt;
|| less than, less than or equal to, greater than, greater than or equal to&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer isFalse = (6 &amp;amp;lt;= 4);&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;==&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;!=&amp;lt;/code&amp;gt;&lt;br /&gt;
|| comparison: equal, not equal&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer isFalse = (&amp;quot;this&amp;quot; == &amp;quot;that&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| bitwise AND&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer zero = 4 &amp;amp; 2;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;integer four = 4 &amp;amp; 4;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt;&lt;br /&gt;
|| bitwise XOR&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer zero = 4 ^ 4;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;integer six = 4 ^ 2;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| bitwise OR&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer four = 4 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 4;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;integer six = 4 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 2;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;amp;&amp;amp;&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| logical AND, logical OR&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer isFalse = (FALSE &amp;amp;&amp;amp; TRUE);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;integer isTrue = (FALSE &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; TRUE);&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;+=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;-=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;*=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;/=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;%=&amp;lt;/code&amp;gt;&lt;br /&gt;
|| assignment&lt;br /&gt;
|| &amp;lt;code&amp;gt;integer four = 4;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;integer eight = four; eight *= 2;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Unlike most other languages that use the C-style &amp;lt;code&amp;gt;&amp;amp;&amp;amp;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;||&amp;lt;/code&amp;gt; operators, &#039;&#039;&#039;both&#039;&#039;&#039; operands are &#039;&#039;&#039;always&#039;&#039;&#039; evaluated.  For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;if (TRUE || 1/0) llSay(PUBLIC_CHANNEL, &amp;quot;Aha!&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
: will cause a Math Error rather than say &amp;quot;Aha!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The &amp;lt;code&amp;gt;++&amp;lt;/code&amp;gt; (increment) and &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; (decrement) operators have two versions, pre- and post-. The &#039;&#039;pre&#039;&#039;-increment (or &#039;&#039;pre&#039;&#039;-decrement) operator increments (or decrements) its operand by 1; the value of the expression is the incremented (or decremented) value. The &#039;&#039;post&#039;&#039;-increment (or &#039;&#039;post&#039;&#039;-decrement) operator increases (or decreases) the value of its operand by 1, but the value of the expression is the operand&#039;s original value &#039;&#039;prior&#039;&#039; to the operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;integer count = 0;&lt;br /&gt;
if( ++count == 1 ) // &#039;count&#039; is incremented then evaluated.&lt;br /&gt;
    llSay(PUBLIC_CHANNEL, &amp;quot;Aha&amp;quot;); // message will be said.&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;integer count = 0;&lt;br /&gt;
if( count++ == 1 ) // &#039;count&#039; is evaluated then incremented.&lt;br /&gt;
    llSay(PUBLIC_CHANNEL, &amp;quot;Aha&amp;quot;); // message will not be said.&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; In most programming languages, and in the LSL bitwise operators, the AND operator has greater precedence than the OR operator. However, the LSL logical operators &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; and &amp;lt;nowiki&amp;gt;&amp;amp;&amp;amp;&amp;lt;/nowiki&amp;gt; have &#039;&#039;the same&#039;&#039; precedence. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;1 || 1 &amp;amp;&amp;amp; 0  // result: 0 because it&#039;s the same as (1 || 1) &amp;amp;&amp;amp; 0&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;1 | 1 &amp;amp; 0    // result: 1 because it&#039;s the same as 1 | (1 &amp;amp; 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The order of evaluation is from right to left.  If the value of x starts as 1 then the first two conditions below evaluate false and the second two evaluate true:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;(x &amp;amp;&amp;amp; (x = 0) == 0 &amp;amp;&amp;amp; x)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;(x &amp;amp;&amp;amp; (x = 0) == 0 &amp;amp;&amp;amp; x == 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;(x == 0 &amp;amp;&amp;amp; (x = 0) == 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;(x == 0 &amp;amp;&amp;amp; (x = 0) == 0 &amp;amp;&amp;amp; x)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both sides are evaluated regardless of the the truth of either side.&lt;br /&gt;
&lt;br /&gt;
==% Modulus==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Modulus (&amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt;), like division, cause a &#039;&#039;Script run-time error. Math Error&#039;&#039; when its second operand equals zero.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; operator only accepts integer (&amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; as modulus) and vector (&amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; as cross product) operands.&lt;br /&gt;
&lt;br /&gt;
The Modulus operator can be confusing, even to veteran scripters. The following example(s) may prove useful in understanding how modulus can be used.&lt;br /&gt;
&lt;br /&gt;
Determine if an integer &#039;&#039;&#039;&#039;&#039;input&#039;&#039;&#039;&#039;&#039; is even or odd:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
if (input % 2 == 0) // input is even&lt;br /&gt;
{&lt;br /&gt;
    // do even things&lt;br /&gt;
}&lt;br /&gt;
else // it&#039;s odd&lt;br /&gt;
{&lt;br /&gt;
    // do odd things&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==+ Operator==&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Equality test on lists does not compare contents, only the length.&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|+&lt;br /&gt;
&amp;lt;code&amp;gt;result = left + right&amp;lt;/code&amp;gt;&lt;br /&gt;
|-{{Hl2}}&lt;br /&gt;
!Left Type&lt;br /&gt;
!Right Type&lt;br /&gt;
!Result Type&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|integer&lt;br /&gt;
|integer&lt;br /&gt;
|integer&lt;br /&gt;
|Adds &#039;&#039;&#039;left&#039;&#039;&#039; and &#039;&#039;&#039;right&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|integer&lt;br /&gt;
|float&lt;br /&gt;
|float&lt;br /&gt;
|Adds &#039;&#039;&#039;left&#039;&#039;&#039; and &#039;&#039;&#039;right&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|float&lt;br /&gt;
|integer&lt;br /&gt;
|float&lt;br /&gt;
|Adds &#039;&#039;&#039;left&#039;&#039;&#039; and &#039;&#039;&#039;right&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|string&lt;br /&gt;
|string&lt;br /&gt;
|string&lt;br /&gt;
|Concatenates &#039;&#039;&#039;right&#039;&#039;&#039; onto the end of &#039;&#039;&#039;left&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|list&lt;br /&gt;
|*&lt;br /&gt;
|list&lt;br /&gt;
|Concatenates &#039;&#039;&#039;right&#039;&#039;&#039; onto the end of &#039;&#039;&#039;left&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|*&lt;br /&gt;
|list&lt;br /&gt;
|list&lt;br /&gt;
|Affixes &#039;&#039;&#039;left&#039;&#039;&#039; onto the start of &#039;&#039;&#039;right&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|vector&lt;br /&gt;
|vector&lt;br /&gt;
|vector&lt;br /&gt;
|Adds &#039;&#039;&#039;left&#039;&#039;&#039; and &#039;&#039;&#039;right&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|rotation&lt;br /&gt;
|rotation&lt;br /&gt;
|rotation&lt;br /&gt;
|Adds &#039;&#039;&#039;left&#039;&#039;&#039; and &#039;&#039;&#039;right&#039;&#039;&#039;&amp;lt;br/&amp;gt;Not useful for combining rotations, use [[#* Operator|*]] or [[#/ Operator|/]] instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Shorthand Operators==&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|+&lt;br /&gt;
Alternatives to the simple &#039;=&#039; operator...&lt;br /&gt;
|-{{Hl2}}&lt;br /&gt;
!Simple assignment operator&lt;br /&gt;
!Shorthand operator&lt;br /&gt;
|-&lt;br /&gt;
|a = a + 1&lt;br /&gt;
|a += 1&lt;br /&gt;
|-&lt;br /&gt;
|a = a – 1&lt;br /&gt;
|a -= 1&lt;br /&gt;
|-&lt;br /&gt;
|a = a * (n+1)&lt;br /&gt;
|a *= (n+1)&lt;br /&gt;
|-&lt;br /&gt;
|a = a / (n+1)&lt;br /&gt;
|a /= (n+1)&lt;br /&gt;
|-&lt;br /&gt;
|a = a % b&lt;br /&gt;
|a %= b&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=={{Wikipedia|De Morgan&#039;s laws|w=n}}==&lt;br /&gt;
{| {{Prettytable|style=margin-top:0; float:left;}}&lt;br /&gt;
|+ Bitwise Equivalencies&lt;br /&gt;
!AND&lt;br /&gt;
!OR&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;code&amp;gt;~(a &amp;amp; b)&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;~a &amp;amp;#124; ~b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;code&amp;gt;~a &amp;amp; ~b&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;~(a &amp;amp;#124; b)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;code&amp;gt;a &amp;amp; ~b&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;~(~a &amp;amp;#124; b)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;code&amp;gt;~(a &amp;amp; ~b)&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;~a &amp;amp;#124; b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
{| {{Prettytable|style=margin-top:0; float:left;}}&lt;br /&gt;
|+ Boolean Equivalencies&lt;br /&gt;
!AND&lt;br /&gt;
!OR&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;code&amp;gt;!(a &amp;amp;&amp;amp; b)&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;!a &amp;amp;#124;&amp;amp;#124; !b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;code&amp;gt;!a &amp;amp;&amp;amp; !b&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;!(a &amp;amp;#124;&amp;amp;#124; b)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;code&amp;gt;a &amp;amp;&amp;amp; !b&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;!(!a &amp;amp;#124;&amp;amp;#124; b)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;code&amp;gt;!(a &amp;amp;&amp;amp; !b)&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;!a &amp;amp;#124;&amp;amp;#124; b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
Due to {{Wikipedia|De Morgan&#039;s laws|w=n}}, by row, code in the &#039;&#039;&#039;AND&#039;&#039;&#039; column is logically equivalent to code in the &#039;&#039;&#039;OR&#039;&#039;&#039;. &#039;&#039;&#039;a&#039;&#039;&#039; and &#039;&#039;&#039;b&#039;&#039;&#039; need not be variables, they can be expressions. In certain circumstances these equivalencies can be used to simplify complex code. It is important not to confuse the two sets when using them. The first two rows depict De Morgan&#039;s laws as it is formulated, the second two build upon it.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Useful Snippets ==&lt;br /&gt;
&lt;br /&gt;
Typecasting can also be used if you have to concatenate many parts into a string:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// the following twp statements are equivalent:&lt;br /&gt;
string message1 = (string)[&amp;quot;I have &amp;quot;, 5, &amp;quot; children at the average age of &amp;quot;, 8.2, &amp;quot; years&amp;quot;];&lt;br /&gt;
string message2 = &amp;quot;I have 5 children at the average age of 8.200000 years&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{LSLC|}}{{LSLC|Syntax}}{{LSLC|Keywords}}&lt;br /&gt;
{{LSLC|FixMe}}&amp;lt;!-- This article is woefully incomplete, it needs more Operator tables --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Honey Puddles</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlGetWallclock&amp;diff=1214560</id>
		<title>LlGetWallclock</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlGetWallclock&amp;diff=1214560"/>
		<updated>2023-09-06T15:34:06Z</updated>

		<summary type="html">&lt;p&gt;Honey Puddles: Oops..  fixing extra &amp;#039;default&amp;#039; state that I pasted.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|func_id=81|func_sleep=0.0|func_energy=10.0&lt;br /&gt;
|func=llGetWallclock|return_type=float&lt;br /&gt;
|func_footnote=For GMT use [[llGetGMTclock]]&lt;br /&gt;
|func_desc&lt;br /&gt;
|return_text=that is the time in seconds since midnight Pacific time (PST/PDT), truncated to whole seconds. That is the same as the time of day in SLT expressed as seconds.&lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|constants&lt;br /&gt;
|examples=&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;// Real World Sun&lt;br /&gt;
integer Flag;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        Flag = -1;&lt;br /&gt;
        llSetTimerEvent(0.1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        float time = llGetWallclock();&lt;br /&gt;
        if (Flag == -1)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(60.0);&lt;br /&gt;
        }&lt;br /&gt;
        if (time &amp;lt; 21600)&lt;br /&gt;
        {&lt;br /&gt;
            if (Flag)&lt;br /&gt;
            {&lt;br /&gt;
                llSetText(&amp;quot;The Sun is coming! :)&amp;quot;, &amp;lt;1,1,0&amp;gt;, 1.0);&lt;br /&gt;
                Flag = 0;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else if (time &amp;lt; 64800)&lt;br /&gt;
        {&lt;br /&gt;
            if (Flag != 1)&lt;br /&gt;
            {&lt;br /&gt;
                llSetText(&amp;quot;Sun has risen. :(&amp;quot;, &amp;lt;1,0,0&amp;gt;, 1.0);&lt;br /&gt;
                Flag = 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else if (Flag != 2)&lt;br /&gt;
        {&lt;br /&gt;
            llSetText(&amp;quot;Goodbye Sun. :(&amp;quot;, &amp;lt;1,0,0&amp;gt;, 1.0);&lt;br /&gt;
            Flag = 2;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;// Convert to human-readable HH:MM:SS format&lt;br /&gt;
string ConvertWallclockToTime()&lt;br /&gt;
{&lt;br /&gt;
    integer now = (integer)llGetWallclock();&lt;br /&gt;
    integer seconds = now % 60;&lt;br /&gt;
    integer minutes = (now / 60) % 60;&lt;br /&gt;
    integer hours = now / 3600;&lt;br /&gt;
    return llGetSubString(&amp;quot;0&amp;quot; + (string)hours, -2, -1) + &amp;quot;:&amp;quot; &lt;br /&gt;
        + llGetSubString(&amp;quot;0&amp;quot; + (string)minutes, -2, -1) + &amp;quot;:&amp;quot; &lt;br /&gt;
        + llGetSubString(&amp;quot;0&amp;quot; + (string)seconds, -2, -1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, ConvertWallclockToTime());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;// Convert to human-readable 12-hour HH:MM:SS (AM/PM) format&lt;br /&gt;
string ConvertWallclockToTime()&lt;br /&gt;
{&lt;br /&gt;
    integer now = (integer)llGetWallclock();&lt;br /&gt;
    integer seconds = now % 60;&lt;br /&gt;
    integer minutes = (now / 60) % 60;&lt;br /&gt;
    integer hours = now / 3600;&lt;br /&gt;
&lt;br /&gt;
    return llGetSubString(&amp;quot;0&amp;quot; + (string)(hours % 12), -2, -1) + &amp;quot;:&amp;quot; &lt;br /&gt;
           + llGetSubString(&amp;quot;0&amp;quot; + (string)minutes, -2, -1) + &amp;quot;:&amp;quot;&lt;br /&gt;
           + llGetSubString(&amp;quot;0&amp;quot; + (string)seconds, -2, -1) + &amp;quot; &amp;quot;&lt;br /&gt;
           + llList2String([&amp;quot;AM&amp;quot;, &amp;quot;PM&amp;quot;], (hours &amp;gt; hours % 12));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, ConvertWallclockToTime());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|helpers&lt;br /&gt;
|also_functions=&lt;br /&gt;
{{LSL DefineRow||[[llGetGMTclock]]|Seconds since midnight GMT}}&lt;br /&gt;
|also_events&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_articles&lt;br /&gt;
|notes=To determine if the current time returned by this function is PST or PDT, you can look at the difference between llGetGMTclock() and llGetWallclock(). The difference will be either 8 hours or -16 hours for PST, and 7 hours or -17 hours for PDT, that is 28800 or -57600,  or 25200 or -61200 seconds.&lt;br /&gt;
|permission&lt;br /&gt;
|negative_index&lt;br /&gt;
|sort=GetWallclock&lt;br /&gt;
|cat1=Time&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Honey Puddles</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlGetWallclock&amp;diff=1214559</id>
		<title>LlGetWallclock</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlGetWallclock&amp;diff=1214559"/>
		<updated>2023-09-06T15:29:26Z</updated>

		<summary type="html">&lt;p&gt;Honey Puddles: Added example code for Human Readable AM/PM display&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|func_id=81|func_sleep=0.0|func_energy=10.0&lt;br /&gt;
|func=llGetWallclock|return_type=float&lt;br /&gt;
|func_footnote=For GMT use [[llGetGMTclock]]&lt;br /&gt;
|func_desc&lt;br /&gt;
|return_text=that is the time in seconds since midnight Pacific time (PST/PDT), truncated to whole seconds. That is the same as the time of day in SLT expressed as seconds.&lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|constants&lt;br /&gt;
|examples=&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;// Real World Sun&lt;br /&gt;
integer Flag;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        Flag = -1;&lt;br /&gt;
        llSetTimerEvent(0.1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        float time = llGetWallclock();&lt;br /&gt;
        if (Flag == -1)&lt;br /&gt;
        {&lt;br /&gt;
            llSetTimerEvent(60.0);&lt;br /&gt;
        }&lt;br /&gt;
        if (time &amp;lt; 21600)&lt;br /&gt;
        {&lt;br /&gt;
            if (Flag)&lt;br /&gt;
            {&lt;br /&gt;
                llSetText(&amp;quot;The Sun is coming! :)&amp;quot;, &amp;lt;1,1,0&amp;gt;, 1.0);&lt;br /&gt;
                Flag = 0;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else if (time &amp;lt; 64800)&lt;br /&gt;
        {&lt;br /&gt;
            if (Flag != 1)&lt;br /&gt;
            {&lt;br /&gt;
                llSetText(&amp;quot;Sun has risen. :(&amp;quot;, &amp;lt;1,0,0&amp;gt;, 1.0);&lt;br /&gt;
                Flag = 1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else if (Flag != 2)&lt;br /&gt;
        {&lt;br /&gt;
            llSetText(&amp;quot;Goodbye Sun. :(&amp;quot;, &amp;lt;1,0,0&amp;gt;, 1.0);&lt;br /&gt;
            Flag = 2;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;// Convert to human-readable HH:MM:SS format&lt;br /&gt;
string ConvertWallclockToTime()&lt;br /&gt;
{&lt;br /&gt;
    integer now = (integer)llGetWallclock();&lt;br /&gt;
    integer seconds = now % 60;&lt;br /&gt;
    integer minutes = (now / 60) % 60;&lt;br /&gt;
    integer hours = now / 3600;&lt;br /&gt;
    return llGetSubString(&amp;quot;0&amp;quot; + (string)hours, -2, -1) + &amp;quot;:&amp;quot; &lt;br /&gt;
        + llGetSubString(&amp;quot;0&amp;quot; + (string)minutes, -2, -1) + &amp;quot;:&amp;quot; &lt;br /&gt;
        + llGetSubString(&amp;quot;0&amp;quot; + (string)seconds, -2, -1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, ConvertWallclockToTime());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;// Convert to human-readable 12-hour HH:MM:SS (AM/PM) format&lt;br /&gt;
string ConvertWallclockToTime()&lt;br /&gt;
{&lt;br /&gt;
    integer now = (integer)llGetWallclock();&lt;br /&gt;
    integer seconds = now % 60;&lt;br /&gt;
    integer minutes = (now / 60) % 60;&lt;br /&gt;
    integer hours = now / 3600;&lt;br /&gt;
&lt;br /&gt;
    return llGetSubString(&amp;quot;0&amp;quot; + (string)(hours % 12), -2, -1) + &amp;quot;:&amp;quot; &lt;br /&gt;
           + llGetSubString(&amp;quot;0&amp;quot; + (string)minutes, -2, -1) + &amp;quot;:&amp;quot;&lt;br /&gt;
           + llGetSubString(&amp;quot;0&amp;quot; + (string)seconds, -2, -1) + &amp;quot; &amp;quot;&lt;br /&gt;
           + llList2String([&amp;quot;AM&amp;quot;, &amp;quot;PM&amp;quot;], (hours &amp;gt; hours % 12));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, ConvertWallclockToTime());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, ConvertWallclockToTime());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|helpers&lt;br /&gt;
|also_functions=&lt;br /&gt;
{{LSL DefineRow||[[llGetGMTclock]]|Seconds since midnight GMT}}&lt;br /&gt;
|also_events&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_articles&lt;br /&gt;
|notes=To determine if the current time returned by this function is PST or PDT, you can look at the difference between llGetGMTclock() and llGetWallclock(). The difference will be either 8 hours or -16 hours for PST, and 7 hours or -17 hours for PDT, that is 28800 or -57600,  or 25200 or -61200 seconds.&lt;br /&gt;
|permission&lt;br /&gt;
|negative_index&lt;br /&gt;
|sort=GetWallclock&lt;br /&gt;
|cat1=Time&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Honey Puddles</name></author>
	</entry>
</feed>