<?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=Susicat+Oh</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=Susicat+Oh"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/wiki/Special:Contributions/Susicat_Oh"/>
	<updated>2026-07-28T20:27:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1178197</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1178197"/>
		<updated>2013-05-04T10:55:42Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* llMessageLinked */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
Some sections may appear poorly worded, may have typos and or poor grammar. This should be considered  &amp;quot;work in progress&amp;quot; if on the other hand you feel  an over riding need to correct my work  please do.  Thank you.    &lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything (except scripts) to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
Please be aware if you use &amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; when the prim owner does not have enough money to pay the transaction will fail the script continues to execute without error but no money is paid. &lt;br /&gt;
&lt;br /&gt;
Always use &amp;lt;code&amp;gt;[[llTransferLindenDollars]]&amp;lt;/code&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Side note for give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x).&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llSetPayPrice(integer,list) is worth a closer look&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You would reasonably expect &amp;lt;code&amp;gt;[[llSetPayPrice]]([[llList2Integer]](price,0),price);&amp;lt;/code&amp;gt; To work would&#039;nt you?&lt;br /&gt;
&lt;br /&gt;
Yep its type casting again!!    &lt;br /&gt;
The problem is the list MUST contain integers. If pay button amounts are read from a notecard .. (as &lt;br /&gt;
&lt;br /&gt;
is my habbit)  they will load up as strings and  need to be converted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = 0;&lt;br /&gt;
while (a &amp;lt; llGetListLength(price))&lt;br /&gt;
{&lt;br /&gt;
    price = llListReplaceList(price,[llList2Integer(price,a)],a,a);&lt;br /&gt;
    a++;&lt;br /&gt;
}&lt;br /&gt;
llSetPayPrice(llList2Integer(price,0),price);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
Will work just fine.&lt;br /&gt;
&lt;br /&gt;
Note:  Using 0 as a price value umm well try it and see ...  it doesn&#039;t break the script nor cause an error but the L$0 button wont appear in the pay dialog box and there are other issues.  Essentially all pay buttons should be L$1 or greater.         &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HOT TIP!!&#039;&#039;&#039;  If your button value list contains a -1  LSL will interpret it as a &amp;lt;code&amp;gt;[[PAY_HIDE]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;br /&gt;
&lt;br /&gt;
== Reading a notecard ==&lt;br /&gt;
&lt;br /&gt;
Most of us have seen or indeed created scripts that read notecards. Did you realise there is no need to have the notecard saved in the prim?&lt;br /&gt;
Its a little quirky with a boatload of caveats but does work.&lt;br /&gt;
&lt;br /&gt;
It works like this...  instead of naming your notecard as in &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;config&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
use  &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;asset UUID of the notecard&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caveats&#039;&#039;&#039;&lt;br /&gt;
* Editing the notecard changes the UUID even while in inventory editing will reassign a new UUID.&lt;br /&gt;
** while this will not directly break the reading script the reading script will read the old/unedited card.&lt;br /&gt;
* The notecard does not have to be in world (in a prim), it can be read from your inventory. &lt;br /&gt;
* Copying the notecard will not change the UUID.&lt;br /&gt;
* Renaming does not change the UUID.&lt;br /&gt;
* Multiple copies of the same notecard is ok, the reading script will only read it once.&lt;br /&gt;
* Once created the UUID is good even if you delete it.&lt;br /&gt;
* Works grid wide.&lt;br /&gt;
&lt;br /&gt;
There is an argument that if the Notecard can never be edited why not just use constants in the script? Which I have to agree with.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
This one really will have you beating you head on the keyboard till you figure out what is happening.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly we have [[llGetUnixTime]]() which returns an integer number of elapsed seconds since midnight 1st January 1970. Yes, it really does return billions as ten digit integers. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you intend converting Unix to human time please see [[User:Void Singer|Void Singer]] page [[Unix2StampLst|uUnix2StampLst]] for how to do this, please  note the time and date are returned as GMT so that&#039;s London UK winter time, [[llGetUnixTime]]() will ignore daylight saving during summer months.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next up [[llGetGMTclock]]() returns the integer seconds past midnight GMT London time again summer time is ignored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And the clincher &lt;br /&gt;
[[llGetWallclock]]() returns seconds past midnight for California (SLT) BUT... and here&#039;s the catch!! [[llGetWallclock]]() &#039;&#039;&#039;&#039;&#039;will correct for daylight saving summer time.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
Textures and texturing prims in script.&lt;br /&gt;
[[llSetTexture]]( [[llSetPrimitiveParams]]([[PRIM_TEXTURE]] work as expected.&lt;br /&gt;
&lt;br /&gt;
However, [[llGetTexture]]( [[llGetLinkPrimitiveParams]]([[PRIM_TEXTURE]]  are fraught with permissions issues. As such  scripts will work fine for you as creator but will fail when you give your creations to others as the permissions system disallows getting texture details from anything which is not full perm.&lt;br /&gt;
&lt;br /&gt;
One final point if you transmit a texture key prim to prim using chat [[llSay]](  the texture MUST be full permission.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1178196</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1178196"/>
		<updated>2013-05-04T10:54:47Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* Lists */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
Some sections may appear poorly worded, may have typos and or poor grammar. This should be considered  &amp;quot;work in progress&amp;quot; if on the other hand you feel  an over riding need to correct my work  please do.  Thank you.    &lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything (except scripts) to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
Please be aware if you use &amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; when the prim owner does not have enough money to pay the transaction will fail the script continues to execute without error but no money is paid. &lt;br /&gt;
&lt;br /&gt;
Always use &amp;lt;code&amp;gt;[[llTransferLindenDollars]]&amp;lt;/code&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Side note for give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llSetPayPrice(integer,list) is worth a closer look&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You would reasonably expect &amp;lt;code&amp;gt;[[llSetPayPrice]]([[llList2Integer]](price,0),price);&amp;lt;/code&amp;gt; To work would&#039;nt you?&lt;br /&gt;
&lt;br /&gt;
Yep its type casting again!!    &lt;br /&gt;
The problem is the list MUST contain integers. If pay button amounts are read from a notecard .. (as &lt;br /&gt;
&lt;br /&gt;
is my habbit)  they will load up as strings and  need to be converted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = 0;&lt;br /&gt;
while (a &amp;lt; llGetListLength(price))&lt;br /&gt;
{&lt;br /&gt;
    price = llListReplaceList(price,[llList2Integer(price,a)],a,a);&lt;br /&gt;
    a++;&lt;br /&gt;
}&lt;br /&gt;
llSetPayPrice(llList2Integer(price,0),price);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
Will work just fine.&lt;br /&gt;
&lt;br /&gt;
Note:  Using 0 as a price value umm well try it and see ...  it doesn&#039;t break the script nor cause an error but the L$0 button wont appear in the pay dialog box and there are other issues.  Essentially all pay buttons should be L$1 or greater.         &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HOT TIP!!&#039;&#039;&#039;  If your button value list contains a -1  LSL will interpret it as a &amp;lt;code&amp;gt;[[PAY_HIDE]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;br /&gt;
&lt;br /&gt;
== Reading a notecard ==&lt;br /&gt;
&lt;br /&gt;
Most of us have seen or indeed created scripts that read notecards. Did you realise there is no need to have the notecard saved in the prim?&lt;br /&gt;
Its a little quirky with a boatload of caveats but does work.&lt;br /&gt;
&lt;br /&gt;
It works like this...  instead of naming your notecard as in &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;config&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
use  &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;asset UUID of the notecard&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caveats&#039;&#039;&#039;&lt;br /&gt;
* Editing the notecard changes the UUID even while in inventory editing will reassign a new UUID.&lt;br /&gt;
** while this will not directly break the reading script the reading script will read the old/unedited card.&lt;br /&gt;
* The notecard does not have to be in world (in a prim), it can be read from your inventory. &lt;br /&gt;
* Copying the notecard will not change the UUID.&lt;br /&gt;
* Renaming does not change the UUID.&lt;br /&gt;
* Multiple copies of the same notecard is ok, the reading script will only read it once.&lt;br /&gt;
* Once created the UUID is good even if you delete it.&lt;br /&gt;
* Works grid wide.&lt;br /&gt;
&lt;br /&gt;
There is an argument that if the Notecard can never be edited why not just use constants in the script? Which I have to agree with.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
This one really will have you beating you head on the keyboard till you figure out what is happening.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly we have [[llGetUnixTime]]() which returns an integer number of elapsed seconds since midnight 1st January 1970. Yes, it really does return billions as ten digit integers. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you intend converting Unix to human time please see [[User:Void Singer|Void Singer]] page [[Unix2StampLst|uUnix2StampLst]] for how to do this, please  note the time and date are returned as GMT so that&#039;s London UK winter time, [[llGetUnixTime]]() will ignore daylight saving during summer months.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next up [[llGetGMTclock]]() returns the integer seconds past midnight GMT London time again summer time is ignored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And the clincher &lt;br /&gt;
[[llGetWallclock]]() returns seconds past midnight for California (SLT) BUT... and here&#039;s the catch!! [[llGetWallclock]]() &#039;&#039;&#039;&#039;&#039;will correct for daylight saving summer time.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
Textures and texturing prims in script.&lt;br /&gt;
[[llSetTexture]]( [[llSetPrimitiveParams]]([[PRIM_TEXTURE]] work as expected.&lt;br /&gt;
&lt;br /&gt;
However, [[llGetTexture]]( [[llGetLinkPrimitiveParams]]([[PRIM_TEXTURE]]  are fraught with permissions issues. As such  scripts will work fine for you as creator but will fail when you give your creations to others as the permissions system disallows getting texture details from anything which is not full perm.&lt;br /&gt;
&lt;br /&gt;
One final point if you transmit a texture key prim to prim using chat [[llSay]](  the texture MUST be full permission.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1178195</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1178195"/>
		<updated>2013-05-04T10:53:47Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* llGiveMoney */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
Some sections may appear poorly worded, may have typos and or poor grammar. This should be considered  &amp;quot;work in progress&amp;quot; if on the other hand you feel  an over riding need to correct my work  please do.  Thank you.    &lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything (except scripts) to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
Please be aware if you use &amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; when the prim owner does not have enough money to pay the transaction will fail the script continues to execute without error but no money is paid. &lt;br /&gt;
&lt;br /&gt;
Always use &amp;lt;code&amp;gt;[[llTransferLindenDollars]]&amp;lt;/code&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Side note for give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled lists can be added together&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
For those of you trying to read notecard lines into lists be aware of the line length limit for a script reading a notecard line is 255 characters.&lt;br /&gt;
see [[llGetNotecardLine]]&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llSetPayPrice(integer,list) is worth a closer look&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You would reasonably expect &amp;lt;code&amp;gt;[[llSetPayPrice]]([[llList2Integer]](price,0),price);&amp;lt;/code&amp;gt; To work would&#039;nt you?&lt;br /&gt;
&lt;br /&gt;
Yep its type casting again!!    &lt;br /&gt;
The problem is the list MUST contain integers. If pay button amounts are read from a notecard .. (as &lt;br /&gt;
&lt;br /&gt;
is my habbit)  they will load up as strings and  need to be converted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = 0;&lt;br /&gt;
while (a &amp;lt; llGetListLength(price))&lt;br /&gt;
{&lt;br /&gt;
    price = llListReplaceList(price,[llList2Integer(price,a)],a,a);&lt;br /&gt;
    a++;&lt;br /&gt;
}&lt;br /&gt;
llSetPayPrice(llList2Integer(price,0),price);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
Will work just fine.&lt;br /&gt;
&lt;br /&gt;
Note:  Using 0 as a price value umm well try it and see ...  it doesn&#039;t break the script nor cause an error but the L$0 button wont appear in the pay dialog box and there are other issues.  Essentially all pay buttons should be L$1 or greater.         &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HOT TIP!!&#039;&#039;&#039;  If your button value list contains a -1  LSL will interpret it as a &amp;lt;code&amp;gt;[[PAY_HIDE]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;br /&gt;
&lt;br /&gt;
== Reading a notecard ==&lt;br /&gt;
&lt;br /&gt;
Most of us have seen or indeed created scripts that read notecards. Did you realise there is no need to have the notecard saved in the prim?&lt;br /&gt;
Its a little quirky with a boatload of caveats but does work.&lt;br /&gt;
&lt;br /&gt;
It works like this...  instead of naming your notecard as in &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;config&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
use  &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;asset UUID of the notecard&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caveats&#039;&#039;&#039;&lt;br /&gt;
* Editing the notecard changes the UUID even while in inventory editing will reassign a new UUID.&lt;br /&gt;
** while this will not directly break the reading script the reading script will read the old/unedited card.&lt;br /&gt;
* The notecard does not have to be in world (in a prim), it can be read from your inventory. &lt;br /&gt;
* Copying the notecard will not change the UUID.&lt;br /&gt;
* Renaming does not change the UUID.&lt;br /&gt;
* Multiple copies of the same notecard is ok, the reading script will only read it once.&lt;br /&gt;
* Once created the UUID is good even if you delete it.&lt;br /&gt;
* Works grid wide.&lt;br /&gt;
&lt;br /&gt;
There is an argument that if the Notecard can never be edited why not just use constants in the script? Which I have to agree with.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
This one really will have you beating you head on the keyboard till you figure out what is happening.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly we have [[llGetUnixTime]]() which returns an integer number of elapsed seconds since midnight 1st January 1970. Yes, it really does return billions as ten digit integers. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you intend converting Unix to human time please see [[User:Void Singer|Void Singer]] page [[Unix2StampLst|uUnix2StampLst]] for how to do this, please  note the time and date are returned as GMT so that&#039;s London UK winter time, [[llGetUnixTime]]() will ignore daylight saving during summer months.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next up [[llGetGMTclock]]() returns the integer seconds past midnight GMT London time again summer time is ignored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And the clincher &lt;br /&gt;
[[llGetWallclock]]() returns seconds past midnight for California (SLT) BUT... and here&#039;s the catch!! [[llGetWallclock]]() &#039;&#039;&#039;&#039;&#039;will correct for daylight saving summer time.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
Textures and texturing prims in script.&lt;br /&gt;
[[llSetTexture]]( [[llSetPrimitiveParams]]([[PRIM_TEXTURE]] work as expected.&lt;br /&gt;
&lt;br /&gt;
However, [[llGetTexture]]( [[llGetLinkPrimitiveParams]]([[PRIM_TEXTURE]]  are fraught with permissions issues. As such  scripts will work fine for you as creator but will fail when you give your creations to others as the permissions system disallows getting texture details from anything which is not full perm.&lt;br /&gt;
&lt;br /&gt;
One final point if you transmit a texture key prim to prim using chat [[llSay]](  the texture MUST be full permission.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1178194</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1178194"/>
		<updated>2013-05-04T10:44:55Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* Key2Name */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
Some sections may appear poorly worded, may have typos and or poor grammar. This should be considered  &amp;quot;work in progress&amp;quot; if on the other hand you feel  an over riding need to correct my work  please do.  Thank you.    &lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything (except scripts) to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled lists can be added together&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
For those of you trying to read notecard lines into lists be aware of the line length limit for a script reading a notecard line is 255 characters.&lt;br /&gt;
see [[llGetNotecardLine]]&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llSetPayPrice(integer,list) is worth a closer look&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You would reasonably expect &amp;lt;code&amp;gt;[[llSetPayPrice]]([[llList2Integer]](price,0),price);&amp;lt;/code&amp;gt; To work would&#039;nt you?&lt;br /&gt;
&lt;br /&gt;
Yep its type casting again!!    &lt;br /&gt;
The problem is the list MUST contain integers. If pay button amounts are read from a notecard .. (as &lt;br /&gt;
&lt;br /&gt;
is my habbit)  they will load up as strings and  need to be converted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = 0;&lt;br /&gt;
while (a &amp;lt; llGetListLength(price))&lt;br /&gt;
{&lt;br /&gt;
    price = llListReplaceList(price,[llList2Integer(price,a)],a,a);&lt;br /&gt;
    a++;&lt;br /&gt;
}&lt;br /&gt;
llSetPayPrice(llList2Integer(price,0),price);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
Will work just fine.&lt;br /&gt;
&lt;br /&gt;
Note:  Using 0 as a price value umm well try it and see ...  it doesn&#039;t break the script nor cause an error but the L$0 button wont appear in the pay dialog box and there are other issues.  Essentially all pay buttons should be L$1 or greater.         &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HOT TIP!!&#039;&#039;&#039;  If your button value list contains a -1  LSL will interpret it as a &amp;lt;code&amp;gt;[[PAY_HIDE]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;br /&gt;
&lt;br /&gt;
== Reading a notecard ==&lt;br /&gt;
&lt;br /&gt;
Most of us have seen or indeed created scripts that read notecards. Did you realise there is no need to have the notecard saved in the prim?&lt;br /&gt;
Its a little quirky with a boatload of caveats but does work.&lt;br /&gt;
&lt;br /&gt;
It works like this...  instead of naming your notecard as in &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;config&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
use  &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;asset UUID of the notecard&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caveats&#039;&#039;&#039;&lt;br /&gt;
* Editing the notecard changes the UUID even while in inventory editing will reassign a new UUID.&lt;br /&gt;
** while this will not directly break the reading script the reading script will read the old/unedited card.&lt;br /&gt;
* The notecard does not have to be in world (in a prim), it can be read from your inventory. &lt;br /&gt;
* Copying the notecard will not change the UUID.&lt;br /&gt;
* Renaming does not change the UUID.&lt;br /&gt;
* Multiple copies of the same notecard is ok, the reading script will only read it once.&lt;br /&gt;
* Once created the UUID is good even if you delete it.&lt;br /&gt;
* Works grid wide.&lt;br /&gt;
&lt;br /&gt;
There is an argument that if the Notecard can never be edited why not just use constants in the script? Which I have to agree with.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
This one really will have you beating you head on the keyboard till you figure out what is happening.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly we have [[llGetUnixTime]]() which returns an integer number of elapsed seconds since midnight 1st January 1970. Yes, it really does return billions as ten digit integers. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you intend converting Unix to human time please see [[User:Void Singer|Void Singer]] page [[Unix2StampLst|uUnix2StampLst]] for how to do this, please  note the time and date are returned as GMT so that&#039;s London UK winter time, [[llGetUnixTime]]() will ignore daylight saving during summer months.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next up [[llGetGMTclock]]() returns the integer seconds past midnight GMT London time again summer time is ignored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And the clincher &lt;br /&gt;
[[llGetWallclock]]() returns seconds past midnight for California (SLT) BUT... and here&#039;s the catch!! [[llGetWallclock]]() &#039;&#039;&#039;&#039;&#039;will correct for daylight saving summer time.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
Textures and texturing prims in script.&lt;br /&gt;
[[llSetTexture]]( [[llSetPrimitiveParams]]([[PRIM_TEXTURE]] work as expected.&lt;br /&gt;
&lt;br /&gt;
However, [[llGetTexture]]( [[llGetLinkPrimitiveParams]]([[PRIM_TEXTURE]]  are fraught with permissions issues. As such  scripts will work fine for you as creator but will fail when you give your creations to others as the permissions system disallows getting texture details from anything which is not full perm.&lt;br /&gt;
&lt;br /&gt;
One final point if you transmit a texture key prim to prim using chat [[llSay]](  the texture MUST be full permission.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1178069</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1178069"/>
		<updated>2013-04-30T11:46:15Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* Money */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
Some sections may appear poorly worded, may have typos and or poor grammar. This should be considered  &amp;quot;work in progress&amp;quot; if on the other hand you feel  an over riding need to correct my work  please do.  Thank you.    &lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything (except scripts) to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled lists can be added together&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
For those of you trying to read notecard lines into lists be aware of the line length limit for a script reading a notecard line is 255 characters.&lt;br /&gt;
see [[llGetNotecardLine]]&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llSetPayPrice(integer,list) is worth a closer look&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You would reasonably expect &amp;lt;code&amp;gt;[[llSetPayPrice]]([[llList2Integer]](price,0),price);&amp;lt;/code&amp;gt; To work would&#039;nt you?&lt;br /&gt;
&lt;br /&gt;
Yep its type casting again!!    &lt;br /&gt;
The problem is the list MUST contain integers. If pay button amounts are read from a notecard .. (as &lt;br /&gt;
&lt;br /&gt;
is my habbit)  they will load up as strings and  need to be converted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = 0;&lt;br /&gt;
while (a &amp;lt; llGetListLength(price))&lt;br /&gt;
{&lt;br /&gt;
    price = llListReplaceList(price,[llList2Integer(price,a)],a,a);&lt;br /&gt;
    a++;&lt;br /&gt;
}&lt;br /&gt;
llSetPayPrice(llList2Integer(price,0),price);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
Will work just fine.&lt;br /&gt;
&lt;br /&gt;
Note:  Using 0 as a price value umm well try it and see ...  it doesn&#039;t break the script nor cause an error but the L$0 button wont appear in the pay dialog box and there are other issues.  Essentially all pay buttons should be L$1 or greater.         &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HOT TIP!!&#039;&#039;&#039;  If your button value list contains a -1  LSL will interpret it as a &amp;lt;code&amp;gt;[[PAY_HIDE]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;br /&gt;
&lt;br /&gt;
== Reading a notecard ==&lt;br /&gt;
&lt;br /&gt;
Most of us have seen or indeed created scripts that read notecards. Did you realise there is no need to have the notecard saved in the prim?&lt;br /&gt;
Its a little quirky with a boatload of caveats but does work.&lt;br /&gt;
&lt;br /&gt;
It works like this...  instead of naming your notecard as in &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;config&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
use  &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;asset UUID of the notecard&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caveats&#039;&#039;&#039;&lt;br /&gt;
* Editing the notecard changes the UUID even while in inventory editing will reassign a new UUID.&lt;br /&gt;
** while this will not directly break the reading script the reading script will read the old/unedited card.&lt;br /&gt;
* The notecard does not have to be in world (in a prim), it can be read from your inventory. &lt;br /&gt;
* Copying the notecard will not change the UUID.&lt;br /&gt;
* Renaming does not change the UUID.&lt;br /&gt;
* Multiple copies of the same notecard is ok, the reading script will only read it once.&lt;br /&gt;
* Once created the UUID is good even if you delete it.&lt;br /&gt;
* Works grid wide.&lt;br /&gt;
&lt;br /&gt;
There is an argument that if the Notecard can never be edited why not just use constants in the script? Which I have to agree with.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
This one really will have you beating you head on the keyboard till you figure out what is happening.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly we have [[llGetUnixTime]]() which returns an integer number of elapsed seconds since midnight 1st January 1970. Yes, it really does return billions as ten digit integers. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you intend converting Unix to human time please see [[User:Void Singer|Void Singer]] page [[Unix2StampLst|uUnix2StampLst]] for how to do this, please  note the time and date are returned as GMT so that&#039;s London UK winter time, [[llGetUnixTime]]() will ignore daylight saving during summer months.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next up [[llGetGMTclock]]() returns the integer seconds past midnight GMT London time again summer time is ignored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And the clincher &lt;br /&gt;
[[llGetWallclock]]() returns seconds past midnight for California (SLT) BUT... and here&#039;s the catch!! [[llGetWallclock]]() &#039;&#039;&#039;&#039;&#039;will correct for daylight saving summer time.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
Textures and texturing prims in script.&lt;br /&gt;
[[llSetTexture]]( [[llSetPrimitiveParams]]([[PRIM_TEXTURE]] work as expected.&lt;br /&gt;
&lt;br /&gt;
However, [[llGetTexture]]( [[llGetLinkPrimitiveParams]]([[PRIM_TEXTURE]]  are fraught with permissions issues. As such  scripts will work fine for you as creator but will fail when you give your creations to others as the permissions system disallows getting texture details from anything which is not full perm.&lt;br /&gt;
&lt;br /&gt;
One final point if you transmit a texture key prim to prim using chat [[llSay]](  the texture MUST be full permission.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Sounds&amp;diff=1172331</id>
		<title>Sounds</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Sounds&amp;diff=1172331"/>
		<updated>2012-08-30T16:07:42Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* Functional Spec */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{OSWikiFeatureNav}}&lt;br /&gt;
=== Feature Design Document ===&lt;br /&gt;
The Sounds folder contains audio clips. (give specs for audio clips, max length, freq, codec, file extension)&lt;br /&gt;
&lt;br /&gt;
=== Functional Spec ===&lt;br /&gt;
Sounds must be in .WAV file in standard PCM format, 16-bit/44.1kHz/mono or stereo (converted to mono), and less than ten seconds in length.  Thus, 9.99 seconds is fine, but 10.0 will fail to upload.&lt;br /&gt;
(source: LL Knowledge base.)&lt;br /&gt;
&lt;br /&gt;
=== Test scripts ===&lt;br /&gt;
[http://secondlife.com/knowledgebase/article.php?id=246 Audio test]&lt;br /&gt;
&lt;br /&gt;
=== Discussion for future improvements ===&lt;br /&gt;
Sound Synthesis&lt;br /&gt;
[pardon the ramble... if it is inappropriate here please contact me]&lt;br /&gt;
&lt;br /&gt;
IMHO a much ignored aspect of game sound design is Sound Synthesis. Presently the pervasive model is &#039;event driven file playback&#039; which, although often workable (e.g. gunshots, explosions, physical interactions), also limits the sound designer&#039;s ability to craft more dynamic, deeply interactive sonic events.&lt;br /&gt;
A simple example of this would be: &lt;br /&gt;
Imagine a &#039;machine&#039;, emitting a low rumble, with a switch on the side which when touched, changed the sound (say to a higher pitch).&lt;br /&gt;
In contrast, imagine the same machine with a lever on it, which allowed the user to arbitrarily change the sound (again say pitch) as they interacted with it.&lt;br /&gt;
&lt;br /&gt;
Whereas the former can be created with well crafted looping file playback and an interactive trigger to another looping file.... &lt;br /&gt;
the latter (arbitrary interaction on the users part) would be almost impossible to create using only &#039;file playback&#039;. &lt;br /&gt;
Instead, this type of dynamic interaction can only be created using standard sound design synthesis tools (oscillators, filters, etc.). &lt;br /&gt;
And a quick look at the API of sound engine for SL (FMOD) reveals that it is fully capable of this.&lt;br /&gt;
&lt;br /&gt;
So it is my suggestion that these features be revealed to the designer.&lt;br /&gt;
&lt;br /&gt;
Wether this is functionally possible I do not know... but if so: It would allow sound designers to craft much more dynamic and  interactive sonic content.&lt;br /&gt;
- Robb&lt;br /&gt;
&lt;br /&gt;
=== Relationship to other features ===&lt;br /&gt;
&amp;lt;b&amp;gt; List of features that need to be tested when this feature changes, and why. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
=== User Guides ===&lt;br /&gt;
(none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Assets]]&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1171202</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1171202"/>
		<updated>2012-07-29T11:22:25Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
Some sections may appear poorly worded, may have typos and or poor grammar. This should be considered  &amp;quot;work in progress&amp;quot; if on the other hand you feel  an over riding need to correct my work  please do.  Thank you.    &lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything (except scripts) to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled lists can be added together&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
For those of you trying to read notecard lines into lists be aware of the line length limit for a script reading a notecard line is 255 characters.&lt;br /&gt;
see [[llGetNotecardLine]]&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llSetPayPrice(integer,list) is worth a closer look&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You would reasonably expect &amp;lt;code&amp;gt;[[llSetPayPrice]]([[llList2Integer]](price,0),price);&amp;lt;/code&amp;gt; To work would&#039;nt you?&lt;br /&gt;
&lt;br /&gt;
Yep its type casting again!!    &lt;br /&gt;
The problem is the list MUST contain integers. If pay button amounts are read from a notecard .. (as &lt;br /&gt;
&lt;br /&gt;
is my habbit)  they will load up as strings and  need to be converted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = 0;&lt;br /&gt;
while (a &amp;lt; llGetListLength(price))&lt;br /&gt;
{&lt;br /&gt;
    price = llListReplaceList(price,[llList2Integer(price,a)],a,a);&lt;br /&gt;
    a++;&lt;br /&gt;
}&lt;br /&gt;
llSetPayPrice(llList2Integer(price,0),price);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
Will work just fine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HOT TIP!!&#039;&#039;&#039;  If your button value list contains a -1  LSL will interpret it as a &amp;lt;code&amp;gt;[[PAY_HIDE]]&amp;lt;/code&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;br /&gt;
&lt;br /&gt;
== Reading a notecard ==&lt;br /&gt;
&lt;br /&gt;
Most of us have seen or indeed created scripts that read notecards. Did you realise there is no need to have the notecard saved in the prim?&lt;br /&gt;
Its a little quirky with a boatload of caveats but does work.&lt;br /&gt;
&lt;br /&gt;
It works like this...  instead of naming your notecard as in &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;config&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
use  &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;asset UUID of the notecard&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caveats&#039;&#039;&#039;&lt;br /&gt;
* Editing the notecard changes the UUID even while in inventory editing will reassign a new UUID.&lt;br /&gt;
** while this will not directly break the reading script the reading script will read the old/unedited card.&lt;br /&gt;
* The notecard does not have to be in world (in a prim), it can be read from your inventory. &lt;br /&gt;
* Copying the notecard will not change the UUID.&lt;br /&gt;
* Renaming does not change the UUID.&lt;br /&gt;
* Multiple copies of the same notecard is ok, the reading script will only read it once.&lt;br /&gt;
* Once created the UUID is good even if you delete it.&lt;br /&gt;
* Works grid wide.&lt;br /&gt;
&lt;br /&gt;
There is an argument that if the Notecard can never be edited why not just use constants in the script? Which I have to agree with.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
This one really will have you beating you head on the keyboard till you figure out what is happening.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly we have [[llGetUnixTime]]() which returns an integer number of elapsed seconds since midnight 1st January 1970. Yes, it really does return billions as ten digit integers. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you intend converting Unix to human time please see [[User:Void Singer|Void Singer]] page [[Unix2StampLst|uUnix2StampLst]] for how to do this, please  note the time and date are returned as GMT so that&#039;s London UK winter time, [[llGetUnixTime]]() will ignore daylight saving during summer months.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next up [[llGetGMTclock]]() returns the integer seconds past midnight GMT London time again summer time is ignored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And the clincher &lt;br /&gt;
[[llGetWallclock]]() returns seconds past midnight for California (SLT) BUT... and here&#039;s the catch!! [[llGetWallclock]]() &#039;&#039;&#039;&#039;&#039;will correct for daylight saving summer time.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
Textures and texturing prims in script.&lt;br /&gt;
[[llSetTexture]]( [[llSetPrimitiveParams]]([[PRIM_TEXTURE]] work as expected.&lt;br /&gt;
&lt;br /&gt;
However, [[llGetTexture]]( [[llGetLinkPrimitiveParams]]([[PRIM_TEXTURE]]  are fraught with permissions issues. As such  scripts will work fine for you as creator but will fail when you give your creations to others as the permissions system disallows getting texture details from anything which is not full perm.&lt;br /&gt;
&lt;br /&gt;
One final point if you transmit a texture key prim to prim using chat [[llSay]](  the texture MUST be full permission.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1170196</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1170196"/>
		<updated>2012-07-05T21:44:07Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
Some sections may appear poorly worded, may have typos and or poor grammar. This should be considered  &amp;quot;work in progress&amp;quot; if on the other hand you feel  an over riding need to correct my work  please do.  Thank you.    &lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything (except scripts) to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled lists can be added together&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
For those of you trying to read notecard lines into lists be aware of the line length limit for a script reading a notecard line is 255 characters.&lt;br /&gt;
see [[llGetNotecardLine]]&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llSetPayPrice(integer,list) is worth a closer look&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You would reasonably expect &amp;lt;code&amp;gt;[[llSetPayPrice]]([[llList2Integer]](price,0),price);&amp;lt;/code&amp;gt; To work would&#039;nt you?&lt;br /&gt;
&lt;br /&gt;
Yep its type casting again!!    &lt;br /&gt;
The problem is the list MUST contain integers. If pay button amounts are read from a notecard .. (as &lt;br /&gt;
&lt;br /&gt;
is my habbit)  they will load up as strings and  need to be converted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = 0;&lt;br /&gt;
while (a &amp;lt; llGetListLength(price))&lt;br /&gt;
{&lt;br /&gt;
    price = llListReplaceList(price,[llList2Integer(price,a)],a,a);&lt;br /&gt;
    a++;&lt;br /&gt;
}&lt;br /&gt;
llSetPayPrice(llList2Integer(price,0),price);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
Will work just fine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HOT TIP!!&#039;&#039;&#039;  If your button value list contains a -1  LSL will interpret it as a &amp;lt;code&amp;gt;[[PAY_HIDE]]&amp;lt;/code&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;br /&gt;
&lt;br /&gt;
== Reading a notecard ==&lt;br /&gt;
&lt;br /&gt;
Most of us have seen or indeed created scripts that read notecards. Did you realise there is no need to have the notecard saved in the prim?&lt;br /&gt;
Its a little quirky with a boatload of caveats but does work.&lt;br /&gt;
&lt;br /&gt;
It works like this...  instead of naming your notecard as in &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;config&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
use  &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;asset UUID of the notecard&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caveats&#039;&#039;&#039;&lt;br /&gt;
* Editing the notecard changes the UUID even while in inventory editing will reassign a new UUID.&lt;br /&gt;
** while this will not directly break the reading script the reading script will read the old/unedited card.&lt;br /&gt;
* The notecard does not have to be in world (in a prim), it can be read from your inventory. &lt;br /&gt;
* Copying the notecard will not change the UUID.&lt;br /&gt;
* Renaming does not change the UUID.&lt;br /&gt;
* Multiple copies of the same notecard is ok, the reading script will only read it once.&lt;br /&gt;
* Once created the UUID is good even if you delete it.&lt;br /&gt;
* Works grid wide.&lt;br /&gt;
&lt;br /&gt;
There is an argument that if the Notecard can never be edited why not just use constants in the script? Which I have to agree with.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
This one really will have you beating you head on the keyboard till you figure out what is happening.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly we have [[llGetUnixTime]]() which returns an integer number of elapsed seconds since midnight 1st January 1970. Yes, it really does return billions as ten digit integers. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you intend converting Unix to human time please see [[User:Void Singer|Void Singer]] page [[Unix2StampLst|uUnix2StampLst]] for how to do this, please  note the time and date are returned as GMT so that&#039;s London UK winter time, [[llGetUnixTime]]() will ignore daylight saving during summer months.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next up [[llGetGMTclock]]() returns the integer seconds past midnight GMT London time again summer time is ignored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And the clincher &lt;br /&gt;
[[llGetWallclock]]() returns seconds past midnight for California (SLT) BUT... and here&#039;s the catch!! [[llGetWallclock]]() &#039;&#039;&#039;&#039;&#039;will correct for daylight saving summer time.&#039;&#039;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1169517</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1169517"/>
		<updated>2012-06-20T15:54:13Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
Some sections may appear poorly worded, may have typos and or poor grammar. This should be considered  &amp;quot;work in progress&amp;quot; if on the other hand you feel  an over riding need to correct my work  please do.  Thank you.    &lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything (except scripts) to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled lists can be added together&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
For those of you trying to read notecard lines into lists be aware of the line length limit for a script reading a notecard line is 255 characters.&lt;br /&gt;
see [[llGetNotecardLine]]&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llSetPayPrice(integer,list) is worth a closer look&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You would reasonably expect &amp;lt;code&amp;gt;[[llSetPayPrice]]([[llList2Integer]](price,0),price);&amp;lt;/code&amp;gt; To work would&#039;nt you?&lt;br /&gt;
&lt;br /&gt;
Yep its type casting again!!    &lt;br /&gt;
The problem is the list MUST contain integers. If pay button amounts are read from a notecard .. (as &lt;br /&gt;
&lt;br /&gt;
is my habbit)  they will load up as strings and  need to be converted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = 0;&lt;br /&gt;
while (a &amp;lt; llGetListLength(price))&lt;br /&gt;
{&lt;br /&gt;
    price = llListReplaceList(price,[llList2Integer(price,a)],a,a);&lt;br /&gt;
    a++;&lt;br /&gt;
}&lt;br /&gt;
llSetPayPrice(llList2Integer(price,0),price);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
Will work just fine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HOT TIP!!&#039;&#039;&#039;  If your button value list contains a -1  LSL will interpret it as a &amp;lt;code&amp;gt;[[PAY_HIDE]]&amp;lt;/code&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;br /&gt;
&lt;br /&gt;
== Reading a notecard ==&lt;br /&gt;
&lt;br /&gt;
Most of us have seen or indeed created scripts that read notecards. Did you realise there is no need to have the notecard saved in the prim?&lt;br /&gt;
Its a little quirky with a boatload of caveats but does work.&lt;br /&gt;
&lt;br /&gt;
It works like this...  instead of naming your notecard as in &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;config&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
use  &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;asset UUID of the notecard&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caveats&#039;&#039;&#039;&lt;br /&gt;
* Editing the notecard changes the UUID even while in inventory editing will reassign a new UUID.&lt;br /&gt;
** while this will not directly break the reading script the reading script will read the old/unedited card.&lt;br /&gt;
* The notecard does not have to be in world (in a prim), it can be read from your inventory. &lt;br /&gt;
* Copying the notecard will not change the UUID.&lt;br /&gt;
* Renaming does not change the UUID.&lt;br /&gt;
* Multiple copies of the same notecard is ok, the reading script will only read it once.&lt;br /&gt;
* Once created the UUID is good even if you delete it.&lt;br /&gt;
* Works grid wide.&lt;br /&gt;
&lt;br /&gt;
And yes I do have a product that reads a notecard of settings that will never be changed.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167713</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167713"/>
		<updated>2012-05-25T20:37:08Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
Some sections may appear poorly worded, may have typos and or poor grammar. This should be considered  &amp;quot;work in progress&amp;quot; if on the other hand you feel  an over riding need to correct my work  please do.  Thank you.    &lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything (except scripts) to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled lists can be added together&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
For those of you trying to read notecard lines into lists be aware of the line length limit for a script reading a notecard line is 255 characters.&lt;br /&gt;
see [[llGetNotecardLine]]&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;br /&gt;
&lt;br /&gt;
== Reading a notecard ==&lt;br /&gt;
&lt;br /&gt;
Most of us have seen or indeed created scripts that read notecards. Did you realise there is no need to have the notecard saved in the prim?&lt;br /&gt;
Its a little quirky with a boatload of caveats but does work.&lt;br /&gt;
&lt;br /&gt;
It works like this...  instead of naming your notecard as in &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;config&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
use  &amp;lt;code&amp;gt;[[llGetNotecardLine]](&amp;quot;asset UUID of the notecard&amp;quot;, lineval);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caveats&#039;&#039;&#039;&lt;br /&gt;
* Editing the notecard changes the UUID even while in inventory editing will reassign a new UUID.&lt;br /&gt;
** while this will not directly break the reading script the reading script will read the old/unedited card.&lt;br /&gt;
* The notecard does not have to be in world (in a prim), it can be read from your inventory. &lt;br /&gt;
* Copying the notecard will not change the UUID.&lt;br /&gt;
* Renaming does not change the UUID.&lt;br /&gt;
* Multiple copies of the same notecard is ok, the reading script will only read it once.&lt;br /&gt;
* Once created the UUID is good even if you delete it.&lt;br /&gt;
* Works grid wide.&lt;br /&gt;
&lt;br /&gt;
And yes I do have a product that reads a notecard of settings that will never be changed.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167710</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167710"/>
		<updated>2012-05-25T19:55:31Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
Some sections may appear poorly worded, may have typos and or poor grammar. This should be considered  &amp;quot;work in progress&amp;quot; if on the other hand you feel  an over riding need to correct my work  please do.  Thank you.    &lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled lists can be added together&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
For those of you trying to read notecard lines into lists be aware of the line length limit for a script reading a notecard line is 255 characters.&lt;br /&gt;
see [[llGetNotecardLine]]&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167699</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167699"/>
		<updated>2012-05-25T17:28:25Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* Lists */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled lists can be added together&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
For those of you trying to read notecard lines into lists be aware of the line length limit for a script reading a notecard line is 255 characters.&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167698</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167698"/>
		<updated>2012-05-25T17:17:37Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* llDie() */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie]]==&lt;br /&gt;
Be aware  be warned [[llDie]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory]]&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167697</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167697"/>
		<updated>2012-05-25T17:11:14Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[llDie()]]==&lt;br /&gt;
Be aware  be warned [[llDie()]]  will remove the prim and its contents from the grid!&lt;br /&gt;
 &lt;br /&gt;
It does not go to trash.&lt;br /&gt;
&lt;br /&gt;
It does not go to lost and found&lt;br /&gt;
&lt;br /&gt;
It does not return to inventory&lt;br /&gt;
&lt;br /&gt;
it has ceased to be&lt;br /&gt;
&lt;br /&gt;
it has curled up its toes and shuffled off this mortal coil&lt;br /&gt;
&lt;br /&gt;
it is an ex-prim!&lt;br /&gt;
&lt;br /&gt;
Not even Linden can get it back for you. Its gone!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now all that said, and the reason for this section... [[llDie()]]  will silently fail in a worn attachment. All you can do in a script to permanently disable a worn scripted prim is use [[llRemoveInventory(llGetScriptName())]]&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167264</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167264"/>
		<updated>2012-05-15T07:09:55Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* PRIM_SLICE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters.  Please be aware its a stand alone function. It is still in the [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167263</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1167263"/>
		<updated>2012-05-15T07:05:15Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[PRIM_SLICE]] ==&lt;br /&gt;
May 2012 the long overdue [[PRIM_SLICE]] parameter was introduced. I was hoping to have it incorporated into the the [[PRIM_TYPE]] list of parameters  but  please be aware its a stand alone function. Its  still  in the  [[llGetPrimitiveParams]] [[llSetPrimitiveParams]] category  but is not part of [[PRIM_TYPE]] parameter list.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166886</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166886"/>
		<updated>2012-05-04T19:50:25Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* change &amp;amp; CHANGED_INVENTORY */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[changed]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166885</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166885"/>
		<updated>2012-05-04T19:49:54Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* change &amp;amp; CHANGED_INVENTORY */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
[[change]] &amp;amp; [[CHANGED_INVENTORY]]  does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented elsewhere on wiki&lt;br /&gt;
&lt;br /&gt;
[[CHANGED_INVENTORY]] will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead which will trigger when inventory is added via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows any one to add anything to the prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166884</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166884"/>
		<updated>2012-05-04T19:44:00Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* Creators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== change &amp;amp; CHANGED_INVENTORY ==&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166883</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166883"/>
		<updated>2012-05-04T19:41:16Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* Creators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166882</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166882"/>
		<updated>2012-05-04T19:35:27Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* Semicolon */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;change &amp;amp; [[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented else where on wiki&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead  which will trigger when inventory is added  via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows  any one to add anything to the  prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
&lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166880</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166880"/>
		<updated>2012-05-04T19:31:09Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* llDialog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;change &amp;amp; [[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented else where on wiki&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead  which will trigger when inventory is added  via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows  any one to add anything to the  prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours. This is because the semi colon satisfies the condition&#039;s following statement requirement, so any following statements are treated as if they are not associated with the conditional.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
  &lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings.&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted).&lt;br /&gt;
&lt;br /&gt;
Cannot exceed 24 characters.&lt;br /&gt;
&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166876</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166876"/>
		<updated>2012-05-04T19:26:32Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* llDialog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;change &amp;amp; [[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented else where on wiki&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead  which will trigger when inventory is added  via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows  any one to add anything to the  prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours. This is because the semi colon satisfies the condition&#039;s following statement requirement, so any following statements are treated as if they are not associated with the conditional.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
  &lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Button labels MUST be strings&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted)&lt;br /&gt;
cannot exceed 24 characters&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference.&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166875</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166875"/>
		<updated>2012-05-04T19:23:28Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* On Rez  reset fails when taken from inventory  for the first time */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;change &amp;amp; [[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented else where on wiki&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead  which will trigger when inventory is added  via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows  any one to add anything to the  prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours. This is because the semi colon satisfies the condition&#039;s following statement requirement, so any following statements are treated as if they are not associated with the conditional.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
  &lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
Labels MUST be strings&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted)&lt;br /&gt;
cannot exceed 24 characters&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_OWNER]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166874</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166874"/>
		<updated>2012-05-04T19:20:48Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* CHANGED_INVENTORY and script permissions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;change &amp;amp; [[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented else where on wiki&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead  which will trigger when inventory is added  via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows  any one to add anything to the  prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours. This is because the semi colon satisfies the condition&#039;s following statement requirement, so any following statements are treated as if they are not associated with the conditional.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
  &lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
Labels MUST be strings&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted)&lt;br /&gt;
cannot exceed 24 characters&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== On Rez  reset fails when taken from inventory  for the first time ==  &lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
Current thinking is that you use [[CHANGED_INVENTORY]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_OWNER]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166873</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166873"/>
		<updated>2012-05-04T19:16:52Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* on_rez */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;change &amp;amp; [[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented else where on wiki&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead  which will trigger when inventory is added  via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows  any one to add anything to the  prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours. This is because the semi colon satisfies the condition&#039;s following statement requirement, so any following statements are treated as if they are not associated with the conditional.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
  &lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
Labels MUST be strings&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted)&lt;br /&gt;
cannot exceed 24 characters&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CHANGED_INVENTORY and script permissions==&lt;br /&gt;
Current thinking is that you use [[CHANGED_INVENTORY]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166872</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166872"/>
		<updated>2012-05-04T19:15:01Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: /* Integer rounding */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightToc}}&lt;br /&gt;
Background:&lt;br /&gt;
&lt;br /&gt;
Name: {{User|Susicat Oh}}&lt;br /&gt;
&lt;br /&gt;
Born: June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idiosyncrasies  and foibles.&lt;br /&gt;
&lt;br /&gt;
==NULL_KEY==&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as variables are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to [[NULL_KEY]] as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PRIM_POSITION==&lt;br /&gt;
&amp;lt;lsl&amp;gt;llSetPrimitiveParams([PRIM_POSITION, dest]);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
==Sensors==&lt;br /&gt;
[[sensor]] returns at most the 16 closest detected &amp;quot;items&amp;quot; in order of closest to farthest, &amp;lt;code&amp;gt;sensor( integer num)&amp;lt;/code&amp;gt; num is 1 to 16. this function will NEVER return a zero!! if you need to test for zero use [[no_sensor]] as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note [[llSensorRemove]]() not only  shuts down the active sensor set up with [[llSensorRepeat]] BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&amp;lt;lsl&amp;gt;sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	//code  functions  what ever your  trying to do   etc.&lt;br /&gt;
	//....&lt;br /&gt;
	//...&lt;br /&gt;
	//followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at [[llSensor]]. Using [[llSensorRepeat]]() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
==Lists, Vectors and Rotations==&lt;br /&gt;
[[llList2Vector]] and [[llList2Rot]] do work as documented (or have been fixed) the problem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  receiving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transferring data types and remember to typecast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llSetPos==&lt;br /&gt;
[[llSetPos]] does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
==Key2Name==&lt;br /&gt;
[[llKey2Name]] avatar MUST be online AND in the sim or a child avatar of the sim, or a [[NULL_KEY]] is returned.&lt;br /&gt;
use [[llRequestAgentData]] and [[dataserver]] to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is defined as avatar on a neighboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
[[llKey2Name]] is now only legacy (as of  Dec 2010).  Use &amp;lt;code&amp;gt;[[llGetUsername]]( key id )&amp;lt;/code&amp;gt; instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of &amp;lt;code&amp;gt;[[llGetDisplayName]]( key id );&amp;lt;/code&amp;gt; you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use &amp;lt;code&amp;gt;[[llGetUsername]](id)&amp;lt;/code&amp;gt; or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using &amp;lt;code&amp;gt;[[llRequestDisplayName]](id)&amp;lt;/code&amp;gt; it will raise a [[dataserver]] event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL will have the second name &amp;quot;Resident&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Creators==&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;key llGetCreator();  //returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); //returns the creator of inventory item ie script author or texture creator etc.. &amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;change &amp;amp; [[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; does not trigger for [[llAllowInventoryDrop]] or [[llRemoveInventory]] documented else where on wiki&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[[CHANGED_INVENTORY]]&amp;lt;/code&amp;gt; will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use [[CHANGED_ALLOWED_DROP]] instead  which will trigger when inventory is added  via [[llAllowInventoryDrop]]&lt;br /&gt;
&lt;br /&gt;
the [[llRemoveInventory]] issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of [[llAllowInventoryDrop]] it allows  any one to add anything to the  prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DATA_ONLINE==&lt;br /&gt;
[[DATA_ONLINE]] returns binary integer TRUE/FALSE  BUT!!  the [[dataserver]] event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attempting to use dataserver(key queryid, integer data)  will force a syntax error when you try to compile. &lt;br /&gt;
&lt;br /&gt;
==Semicolon==&lt;br /&gt;
Adding a semi colon to &amp;lt;code&amp;gt;[[if]]&amp;lt;/code&amp;gt; statements as &amp;lt;code&amp;gt;[[if]]( a == B);&amp;lt;/code&amp;gt; will cause the test to return [[TRUE]] every time  handy for debugging but may have you scratching your head for hours. This is because the semi colon satisfies the condition&#039;s following statement requirement, so any following statements are treated as if they are not associated with the conditional.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;while (a &amp;lt; b);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
  &lt;br /&gt;
==llGiveMoney==&lt;br /&gt;
&amp;lt;code&amp;gt;[[llGiveMoney]](key,amount);&amp;lt;/code&amp;gt; key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause [[llGiveMoney]] to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
&amp;lt;lsl&amp;gt;float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/(float)b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
[[List]] length limit at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llDialog]]==&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
Labels MUST be strings&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted)&lt;br /&gt;
cannot exceed 24 characters&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display avoid &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation will show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[llMessageLinked]]==&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the receiving script.&lt;br /&gt;
slow things down with [[llSleep]](x) in practice 0.1 is normally enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==llParticleSystem==   &lt;br /&gt;
[[llParticleSystem]] the list option &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, [[NULL_KEY]]&amp;lt;/code&amp;gt; will compile but crashes the script..  Use &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as a work round. Or &amp;lt;code&amp;gt;PSYS_SRC_TARGET_KEY, (key)[[NULL_KEY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;Didn&#039;t they fix this in {{Jira|SVC-185}}?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Money==&lt;br /&gt;
[[money]] event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  [[llSetPayPrice]](integer,[list]);  for  the pay dialog box  MUST be in the root prim. If [[llSetPayPrice]] is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events== &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the queue is state_entry&lt;br /&gt;
&lt;br /&gt;
The event queue is 64 events after that events are discarded until there is free space in the queue.&lt;br /&gt;
That&#039;s why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
==UUIDs==&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list tmp = llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2Key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2Key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Integer rounding==&lt;br /&gt;
&lt;br /&gt;
When rounding the results of [[llFrand]].&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer a = llRound(llFrand(4));   //returns  values in the range 0 - 4 inc. &lt;br /&gt;
integer a = llFloor(llFrand(4));   //0 - 3 inc. &lt;br /&gt;
integer a = llCeil(llFrand(4));    //1 - 4 inc.&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==on_rez==&lt;br /&gt;
[[on_rez]] reset fails when taken from inventory  for the first time.&lt;br /&gt;
&lt;br /&gt;
Never got to the bottom of this as resetting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
&lt;br /&gt;
==CHANGED_INVENTORY and script permissions==&lt;br /&gt;
Current thinking is that you use [[CHANGED_INVENTORY]] reset and may be a permission request like permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your [[CHANGED_INVENTORY]] reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permission once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
# Always remember to set it up correctly before taking to inventory.&lt;br /&gt;
# Test rez the item to be sure it  does initialize correctly.&lt;br /&gt;
# Slap your self  for being  stupid.&lt;br /&gt;
# All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166494</id>
		<title>User:Susicat Oh</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Susicat_Oh&amp;diff=1166494"/>
		<updated>2012-04-29T16:23:05Z</updated>

		<summary type="html">&lt;p&gt;Susicat Oh: Simple plain English explanations of LSL commands and functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Background:&lt;br /&gt;
&lt;br /&gt;
Name Susicat Oh&lt;br /&gt;
&lt;br /&gt;
Born June 07&lt;br /&gt;
&lt;br /&gt;
Time in SL  5 years in 2012&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Aim of this page is to provide simple plain English explanations of LSL commands and functions with examples where I can.&lt;br /&gt;
&lt;br /&gt;
Trip ups, idocyncracies  and folbles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An undefined key may not be held as 00000000.. undefined keys as varialbes are held as empty NOT 000000...  as such if you need to test for NULL_KEY be sure to set the variable to NULL_KEY as required.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llSetPrimitiveParams([PRIM_POSITION,dest]);&lt;br /&gt;
&lt;br /&gt;
This needs to be in the root prim or will fail.&lt;br /&gt;
In a child prim not only does it fail it can throw &amp;quot;stack heap collision&amp;quot;   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sensor returns the 16 closest detedcted &amp;quot;items&amp;quot; in order of closest to farthest they are &lt;br /&gt;
numbered &amp;quot;sensor( integer num)&amp;quot;  as 1 to 16. this function will NEVER return a zero!!  of you &lt;br /&gt;
need to test for zero use no_sensor as a zero scan will not trigger a sensor event..&lt;br /&gt;
&lt;br /&gt;
Also note llSensorRemove() not only  shuts down the active sensor set up with llSensorRepeat BUT will ALSO kill the sensor found data. &lt;br /&gt;
&lt;br /&gt;
as such&lt;br /&gt;
&lt;br /&gt;
sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
is futile as  the senor data will get wiped.&lt;br /&gt;
&lt;br /&gt;
sensor(integer num_detected)&lt;br /&gt;
{&lt;br /&gt;
	code  funtions  what ever your  trying to do   etc.&lt;br /&gt;
	....&lt;br /&gt;
	...&lt;br /&gt;
	followed by&lt;br /&gt;
	llSensorRemove();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
will work fine.&lt;br /&gt;
&lt;br /&gt;
Also note  if your using a single sweep one-off type scan look at llSensor. Using llSensorReapeat() then shutting it off immediately is a waste of byte code.     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llList2Vector and llList2Rotation do work as documented (or have been fixed) the poblem with them stems from the fact that&lt;br /&gt;
sometimes numerical data passed  between scripts is usually passed as strings the  recieving script accepts the string,  &lt;br /&gt;
you then add it to a list. The data then sits in the list as a STRING!!  not a numeric value. if you  llDumpList2string&lt;br /&gt;
you will see  something  with looks like a numerical value, feels like a numerical value BUT its a string!! You need to be &lt;br /&gt;
on your toes all the time when transfering data types and remember to typcast correctly.       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llSetpos  does not work in attached prims Linden are aware of this and are fixing it &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llKey2Name  avatar MUST be on line AND in the sim or a child avatar of the sim, or a NULL_KEY is returned.&lt;br /&gt;
use  llRequestAgentData and dataserver to get round this.&lt;br /&gt;
&lt;br /&gt;
* child avatar is diffined as avatar on a neigboring sim which can be seen from the sim the script is in (less than 35M from sim boundary).&lt;br /&gt;
&lt;br /&gt;
llkey2name is now only legacy..  as of  Dec 2010.  Use llGetUsername( key id ) instead.. &lt;br /&gt;
&lt;br /&gt;
Also be aware of llGetDisplayName( key id ); you are reminded that displaynames are not unique and easily changed, using them in ANY security script is a really bad plan!! Use llGetusername(id) or do it with avatar keys!!&lt;br /&gt;
&lt;br /&gt;
I would suggest using  llRequestDisplayName(id) it will raise a dataserver event but gets round the issue of avatar not in sim.&lt;br /&gt;
&lt;br /&gt;
Newer people in SL  will have the second name &amp;quot;Resident&amp;quot;     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This one does actually work as documented BUT you need to be clear what it returns.&lt;br /&gt;
&lt;br /&gt;
key llGetCreator();  returns the creator of the prim! NOT the script!&lt;br /&gt;
key llGetInventoryCreator(string &amp;lt;inventory name&amp;gt;); returns the creator of inventory item ie script author or texture creator etc.. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
change &amp;amp; CHANGED_INVENTORY  does not trigger   for llAllowinventorydrop  or llRemoveinventory documented else where on wiki&lt;br /&gt;
&lt;br /&gt;
changed_Inventory will work when the prim owner edits the prim manually (adding a texture  editing a notecard)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
Use CHANGED_ALLOWED_DROP instead  which will trigger  when inventory is added  via  llallowinventorydrop&lt;br /&gt;
&lt;br /&gt;
the llRemoveinventory issue has been acknowledged by Linden who are &amp;quot;working on it&amp;quot; &lt;br /&gt;
&lt;br /&gt;
On the  subject of llAllowInventoryDrop it allows  any one to add anything to the  prim.&lt;br /&gt;
Its up to you  to figure out  the validity of  who dropped what.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DATA_ONLINE  returns binary integer TRUE/FALSE  BUT!!  the dataserver event can only accept strings&lt;br /&gt;
as such  dataserver(key queryid, string data)  data will be a &amp;quot;1&amp;quot; (online) or &amp;quot;0&amp;quot;(offline) as a string. attepting to use dataserver(key queryid, integer data)  will force a syntax error when you try to complie. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Adding a semi colon to  if  statements   as if( a ==B);   will cause the test to return TRUE everytime  handy for debugging but may have you scratching your head for hours.&lt;br /&gt;
&lt;br /&gt;
on the subject of  ; in the wrong place...&lt;br /&gt;
&lt;br /&gt;
while (a &amp;lt; b);&lt;br /&gt;
&lt;br /&gt;
with a semi-colon will stall the script. It will compile it will not error the script will just sulk!&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
llGiveMoney(key,amount); key MUST be an avatar and  amount MUST be an integer greater than zero  passing a float or a zero will error. &lt;br /&gt;
&lt;br /&gt;
side note for  give money profit split&lt;br /&gt;
&lt;br /&gt;
integer to float  and division &lt;br /&gt;
&lt;br /&gt;
integer a = whatever;&lt;br /&gt;
integer b = whatever;&lt;br /&gt;
float c = a/b;&lt;br /&gt;
&lt;br /&gt;
May yield c = zero  due to internal integer rounding in LSL which will  cause llGivemoney to throw invalid amount error.&lt;br /&gt;
&lt;br /&gt;
use&lt;br /&gt;
float a = money_amount;&lt;br /&gt;
float b = percent_split;&lt;br /&gt;
integer given = llRound((money_amount/100) * percent_split); &lt;br /&gt;
llGiveMoney(id,given);&lt;br /&gt;
&lt;br /&gt;
I have tripped up on this more than once!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List length limit  at compile is 72 elements BUT  once compiled   list can be added &lt;br /&gt;
list huge = list1 + list2;  will work fine &lt;br /&gt;
&lt;br /&gt;
The only real limit is script memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llDialog&lt;br /&gt;
The problem is that the client font is proportionally spaced not fixed with font soo this is best guess guide. &lt;br /&gt;
&lt;br /&gt;
Question text is circa 35 characters per line   &lt;br /&gt;
Its ok to use \n and \t  for new line and tab &lt;br /&gt;
At more than 8 lines you get a scroll bar.&lt;br /&gt;
Whatever you do question text MUST be greater than none and LESS than 512 characters.&lt;br /&gt;
&lt;br /&gt;
Buttons &lt;br /&gt;
Labels MUST be strings&lt;br /&gt;
Cannot be empty or NULL sting (spaces are permitted)&lt;br /&gt;
cannot exceed 24 characters&lt;br /&gt;
Long button labels will be truncated in the display to circa 12 characters (remember its proportional spacing) in practice aim for max 10 chrs. &lt;br /&gt;
Similar button labels which get truncated  will look the same in the display aviod &amp;quot;sitting here pose 1&amp;quot;,&amp;quot;sitting here pose 2&amp;quot;  as truncation whill show them as the same, the script knows they are different and will work correctly  but the human user will not see a difference. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
llMessageLinked&lt;br /&gt;
This will appear to stall or not work  if messages are sent to quickly you need to allow the processing time of the recieving script.&lt;br /&gt;
slow things down with llSleep(x) in practice 0.1 is normaly enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
llParticleSystem the list option PSYS_SRC_TARGET_KEY,NULL_KEY will compile but crashes the script..  Use PSYS_SRC_TARGET_KEY,(key)&amp;quot;&amp;quot; as a work round.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
money event  is  not capable of  telling if  a &amp;quot;correct amount&amp;quot; was paid  it will return amount and  the payers key but thats it.. its up to you  to test amount&lt;br /&gt;
&lt;br /&gt;
if(amount paid  == price)&lt;br /&gt;
{&lt;br /&gt;
	deliver item&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
The money event can be in any prim and will work as &amp;quot;pay this prim&amp;quot; just fine  BUT  llSetPayPrice(integer,[list]);  for  the pay dialog box  MUST be in the root prim. If llSetPayPrice is in a child prim it will fail silently. Its ok to have it in the root as all money events in the object will be updated automatically.&lt;br /&gt;
&lt;br /&gt;
it is NOT possible to pay a worn attachment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Events &lt;br /&gt;
&lt;br /&gt;
There is a 64 event limit on any  given state.&lt;br /&gt;
Events are processed on a strict first in first out order  (FIFO) &lt;br /&gt;
The only thing that can jump the que is state_entry&lt;br /&gt;
&lt;br /&gt;
The event que is 64 events after that events are discarded untill there is free space in the que.&lt;br /&gt;
Thats why if you are sending  batches of LinkMessage( some of them get lost or never arrive.&lt;br /&gt;
&lt;br /&gt;
Side note:  The word &amp;quot;event&amp;quot; is an LSL keyword and will syntax error if used.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
keys as 36 character UUIDs   can be  type cast to  string and back  fluidly  just be aware  of  type casting  when performing  key  functions.&lt;br /&gt;
&lt;br /&gt;
HOWEVER  having been given a key there is no way of testing if its an avatar, texture, group, sound,  animation or whatever.  Your expected to know!!&lt;br /&gt;
&lt;br /&gt;
list tmp =  llGetObjectDetails(id,[OBJECT_OWNER]);&lt;br /&gt;
&lt;br /&gt;
if(llList2key(tmp,0) == id)&lt;br /&gt;
{&lt;br /&gt;
	key is an avatar;&lt;br /&gt;
}&lt;br /&gt;
if(llList2key(tmp,0) == NULL_KEY)&lt;br /&gt;
{&lt;br /&gt;
	key is NOT an avatar;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
thats the best I have for now &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integer rounding. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
integer a = llRound(llFrand(4));   returns  values in the range  0 - 4 inc.&lt;br /&gt;
integer a = llFloor(llFrand(4));   0 - 3 inc&lt;br /&gt;
integer a = llCeil(llFrand(4));    1 - 4 inc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Rez  reset fails when taken from inventory  for the first time.&lt;br /&gt;
&lt;br /&gt;
Never got to the bottom of this as reseting scripts manually in world or shift drag copying clears the fault.&lt;br /&gt;
&lt;br /&gt;
Current thinking is that  you use CHANGED_INVENTORY reset and  may be a permission request  like   permission money.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What may be happening is you are setting up next owner permissions  which triggers your CHANGED_INVENORY reset  then in your  haste  you take back to inventory without  granting  the money permission.  As a result  the object sits in inventory without money permission being granted and  just hangs in limbo. It has asked for money permisson once and cannot ask again without a reset, the  section of code that does the resetting cannot be executed as permission has not been granted thus preventing the script advancing through to the code to get to the reset routines.&lt;br /&gt;
&lt;br /&gt;
Solutions&lt;br /&gt;
&lt;br /&gt;
1/  Add an on-rez  reset to the  same  state (usually  default) as the money request.&lt;br /&gt;
2/  Always remember to set it up correcly before taking to inventory.&lt;br /&gt;
3/  Test rez the item to be sure it  does initalise correctly.&lt;br /&gt;
4/  Slap your self  for being  stupid.&lt;br /&gt;
5/  All of the above.&lt;/div&gt;</summary>
		<author><name>Susicat Oh</name></author>
	</entry>
</feed>