nyuuzyou/wikis huggingface dataset:
LSL-Editor

LSL Editor may or may not have feature parity with LSL Editor Community Edition. This article may be outdated.
LSL Editor Community Edition
Source Forge: LSL Editor
There is an issue list at LSLEditorBugs.
LSL-Editor is a standalone Windows LSL script editor and run-time environment. 
* Code highlighting (including Brackets matching) 
* Code auto completion (Like Visual Studio) 
* Auto insert events 
* Argument information on functions (typing) 
* Tabbed or MDI interface 
* LSLWiki or SecondLife color scheme 
* The usual editing functions
* Block commenting/uncommenting
* Tooltip on keywords (LSL-Editor contains complete LSL guide!) 
* Auto-indent (using tabs or SecondLife indent scheme) 
* Help, on every keyword, uses www.LSLwiki.NET information 
* Compiling and execute outside SecondLife world
* Breakpoints and stepping coming in a future version
* llDialog input screen
* Printing 
* You don't have to install the program, just unzip and use it. (Requires .NET 2.x.)
* Updated on frequently, so check your update button
Windows XP , Windows 2000 , Windows 2003, probably Vista
== Feature Wishlist ==
* Inventory simulation: Would be nice if the inventory functions of LSL could be simulated by putting dummy objects into a dummy inventory. No further attributes (except maybe type) would have to be supported.
* Linked prim simulation: Would be nice if an object consisting of several linked prims could be simulated. No further attributes beyond link id would have to be supported. Flags like LINK_ALL_OTHERS or LINK_ALL_CHILDREN would be nice to have.
* Missing constants TEXTURE_BLANK and TEXTURE_TRANSPARENT
LSL-Plus

== LSL Plus ==
LSL Plus is an offline IDE for editing and debugging of LSL code. LSL Plus is Free/Libre Open Source Software (FLOSS), meaning source is included when you download the software, and you are free to update it and redistribute it.
LSL Plus has the following features:
* Source Level Debugging:
** set breakpoints
** single step through code
** examine variables all the way up the call stack, including global variables
* Typical IDE editor features:
** source code completions
** integrated information about types, names of built in function arguments
** documentation hover support
** auto indentation
** syntax highlighting
* A Extensive simulation framework for running multiple scripts and testing concurrency
** Build an environment with avatars, objects, prims, inventory, etc.
** Embed any number of scripts in any number of prims
** Add specialized event handlers to simulate avatar actions or external services (e.g. HTTP servers)
** Test link message, chat, inter-object email, sensors, touches
* A Unit Testing framework:
** specify the code entry point you want to test (a function, or a specific handler in a specific state).
** specify the expect return value, and/or the expected change to the state of global variables
** specify the external calls you expect the code to make
** framework executes the code, checks results, displays test results, and test log.
* Meta-language features: split your code up into reusable modules, test them separately. LSL Plus will create the combined, validated scripts for you for upload into Second Life.
* Optimization support: inlining, constant folding, pruning of unused elements.
* Integrated into Eclipse, giving you access to several integrated source code control systems (CVS, Subversion, etc.), Mylyn task management, etc.
* Future directions:
** Write LSL unit tests in LSL, instead of declaratively
** Visualization support
** Improved physics fidelity
** And bug fixes (it is in late beta)
** More scripting of Simulator events, for more interesting tests
** Refactoring support
LSL-PyOptimizer

LSL-PyOptimizer
A full-blown LSL optimizer, with lots of bells & whistles, courtesy of Sei Lisa, which can be accessed online at http://lsl.blacktulip-virtual.com/lsl-pyoptimizer/online.php or, alternatively, downloaded for offline use at https://github.com/Sei-Lisa/LSL-PyOptimizer.
Category:LSL
LSL3

== Purpose ==
The purpose of the LSL3 project is to design a new programing language that would replace LSL2 in Second Life.
== Design Ideals ==
*It should be designed to enable expression and not hinder expression with complex or over burdensome syntax requirements.
*C style syntax and order of operations
*Type safety
*Strongly Typed
== Goal ==
* Address the shortcomings of LSL2 and add new functionality while limiting the increase of language complexity.
* Design LSL3 with Hierarchical Linking in mind 
== Proposed Changes for LSL2 ==
Here are some proposed changes to LSL2. Please add new changes, if they cannot be summed up in a single sentence please create a subpage to this article and put a link in the appropriate section. 
=== Major changes ===
* Object model
* Get rid of get and set functions, use getters and setters instead where possible (syntax sugar).
* Persistent storage/memory
=== Syntax ===
* Fix quaternion ordering
* Provide quaternion-scalar multiplication
* Provide quaternion exponentiation q^a where a is a float. (Useful for interpolating rotations to achieve smoothness)
* Object model for base types
* Array indexer
* continue and break keywords.
* switch statement.
=== Types ===
* User defined class & structures
** Duck Typing (LinFu?)
** Anonymous classes?
* bool type
* pointers
* Remove restriction on lists containing lists
* const
=== Functions ===
* Organized into static classes?
* Or keep the namespace flat to keep the syntax simple.
=== States & Events ===
* State variables.
* User defined events that can be triggered by external scripts.
* Functions that are only available to specific states.
=== Libraries ===
* Script libraries that can be sold and passed around.
* Natural syntax which can be used instead of link_message
== Flaws with LSL2 ==
Here is a list of flaws with LSL2 that should be fixed.
=== Combining Quaternions ===
* See for a full description of this.
=== Evaluation order ===
* Given the code f(a) + g(a), currently g(a) gets executed before f(a).
** Changing this so f(a) gets executed first should improve performance on Mono.
===Comparisons of lists=== 
*Only length is compared.
*The result of a list equality is the difference of the lengths.
==='if else' syntax===
* if([1]) evaluates to false.
* if !(STRING) gives syntax error, forcing if (STRING == "") Applies to all types in which ! cannot be put directly in front.
=== llInsertString ===
* Does not support negative indexes.
=== Functions ===
* Do not support negative indexes.
== Resources ==
*
LSLForge

== LSLForge ==
LSLForge is an offline IDE for editing and debugging of LSL code. LSLForge is Free/Libre Open Source Software (FLOSS), meaning source is included when you download the software, and you are free to update it and redistribute it.
LSLForge is a derivative of LSL-Plus, forked in September 2011.
LSLForge has the following features:
* Source Level Debugging:
** set breakpoints
** single step through code
** examine variables all the way up the call stack, including global variables
* Typical IDE editor features:
** source code completions
** integrated information about types, names of built in function arguments
** documentation hover support
** auto indentation
** syntax highlighting
* A Extensive simulation framework for running multiple scripts and testing concurrency
** Build an environment with avatars, objects, prims, inventory, etc.
** Embed any number of scripts in any number of prims
** Add specialized event handlers to simulate avatar actions or external services (e.g. HTTP servers)
** Test link message, chat, inter-object email, sensors, touches
* A Unit Testing framework:
** specify the code entry point you want to test (a function, or a specific handler in a specific state).
** specify the expect return value, and/or the expected change to the state of global variables
** specify the external calls you expect the code to make
** framework executes the code, checks results, displays test results, and test log.
* Meta-language features: split your code up into reusable modules, test them separately. LSLForge will create the combined, validated scripts for you for upload into Second Life.
* Optimization support: inlining, constant folding, pruning of unused elements.
* Integrated into Eclipse, giving you access to several integrated source code control systems (CVS, Subversion, Git, etc.), Mylyn task management, etc.
== ChangeLog ==
Commit log
LSLTest Http.php

<?php
//pulls information from headers		
$ownername = $_SERVER['HTTP_X_SECONDLIFE_OWNER_NAME'];
$objectname = $_SERVER['HTTP_X_SECONDLIFE_OBJECT_NAME'];
$objectkey = $_SERVER['HTTP_X_SECONDLIFE_OBJECT_KEY'];
$ownerkey = $_SERVER['HTTP_X_SECONDLIFE_OWNER_KEY'];
$region = $_SERVER['HTTP_X_SECONDLIFE_REGION'];
$location = $_SERVER['HTTP_X_SECONDLIFE_LOCAL_POSITION'];
//gives the info back in a :: separated list. 
echo $ownername . "::" 
 . $objectname. "::" 
 . $objectkey. "::" 
 . $ownerkey. "::" 
 . $region. "::" 
 . $location;
?>
LSLTest HttpReport.php

<?php
//pulls information from headers		
$ownername = $_SERVER['HTTP_X_SECONDLIFE_OWNER_NAME'];
$objectname = $_SERVER['HTTP_X_SECONDLIFE_OBJECT_NAME'];
$objectkey = $_SERVER['HTTP_X_SECONDLIFE_OBJECT_KEY'];
$ownerkey = $_SERVER['HTTP_X_SECONDLIFE_OWNER_KEY'];
$region = $_SERVER['HTTP_X_SECONDLIFE_REGION'];
$location = $_SERVER['HTTP_X_SECONDLIFE_LOCAL_POSITION'];
echo "HTTP RESPONSE " . $_GET['report'];
		
?>
LSLTest Rpc.php

<?php
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//
// XML-RPC 
//
//
// script for XML-RPC test
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////
//
// Post To Host
//
// INPUT: $host, $path, $data_to_send
// OUTPUT:
// GLOBALS:
// LOCALS: $fp
///////////////////////////////////////////////////
 function postToHost($host, $path, $data_to_send) {
 $fp = fsockopen($host, 80);
 fputs($fp, "POST $path HTTP/1.1\r\n");
 fputs($fp, "Host: $host\r\n");
 fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
 fputs($fp, "Content-length: ". strlen($data_to_send) ."\r\n");
 fputs($fp, "Connection: close\r\n\r\n");
 fputs($fp, $data_to_send);
// while(!feof($fp)) {
// $res .= fgets($fp, 128);
// }
 fclose($fp);
// return substr($res, strpos($res, "\r\n\r\n"));;
 }
/////////////////////////////////////////////////
//
// Parse Response
//
// INPUT: $response
// OUTPUT:
// GLOBALS:
// LOCALS: $result
///////////////////////////////////////////////////
 function parseResponse($response) {
 $result = array();
 if (preg_match_all('#<name>(.+)</name><value><(string|int)>(.*)</\2></value>#U', $response, $regs, PREG_SET_ORDER)) {
 foreach($regs as $key=>$val) {
 $result[$val[1]] = $val[3];
 }
 }
 return $result;
 }
/////////////////////////////////////////////////
//
// Send request
//
// INPUT: $channel, $intValue, $stringValue
// OUTPUT: 
// GLOBALS:
// LOCALS: $int, $string, $data
///////////////////////////////////////////////////
 function sendRequest($channel, $intValue, $stringValue) {
 $channel = htmlspecialchars($channel);
 $int = (int)$intValue;
 $string = htmlspecialchars($stringValue);
 
 $data = '<?xml version="1.0"?>';
 $data .= '<methodCall>';
 $data .= '<methodName>llRemoteData</methodName>';
 $data .= '<params><param><value><struct>';
	$data .= '<member><name>Channel</name><value><string>'.$channel.'</string></value></member>';
 $data .= '<member><name>IntValue</name><value><int>'.$int.'</int></value></member>';
 $data .= '<member><name>StringValue</name><value><string>'.$string.'</string></value></member>';
 $data .= '</struct></value></param></params></methodCall>';
 postToHost("xmlrpc.secondlife.com","/cgi-bin/xmlrpc.cgi", $data);
 }
/////////////////////////////////////////////////////////////////////////////////////
//
// Main
//
//////////////////////////////////////////////////////////////////////////////////////
 $channel = $_GET["channel"];
 $stringMessage = $_GET["stringMessage"];
 $intMessage = $_GET["intMessage"];
 sendRequest($channel,$intMessage,$stringMessage);
 echo "channel:" . $channel . ", stringMessage: " . $stringMessage . ", intMessage: " . $intMessage ;
?>
LSL 101/Comments, White-space and Formatting

Category:LSL 101
Here's another valid LSL script.
// This is a valid, but horribly formatted, script 
default{state_entry(){}}
The first line is called a comment. Anything following // on a line is ignored by the computer. Comments are intended solely for the human reader of the script. Since a successful script will invariably be read by humans, it's just as important to make them understandable to humans as to the computer that is going to execute them. In general, the most useful comments are those that explain the script on a higher level than the individual LSL statements. An explanation of what a section of script is intended to do is much more helpful that a line-by-line translation of LSL commands into English.
Sometimes you might hear "really awesome scriptors" make some comment like "my code is my commentary," and when you get to the level that it reads like English to you I am sure that is so. For the rest of us, there are comments. Leave many and you will save redebugging your own code later when you've long since forgotten what you did. 
The second thing this script illustrates is that white space characters (blanks, tabs and separate lines) are, for the most part, entirely optional. They can be added or removed without changing how the computer executes the script. The major exceptions are 1) a new line always ends a comment and 2) you can't insert a space or tab in a name or number. For example, you can't write
 // These are NOT valid LSL fragments
 state entry // This would be interpreted as two separate names
 123 456 // ... and this as two separate numbers.
A generous use of comments and white space can make a script much easier to understand. When you first start writing scripts, you probably won't think that's very important. But the first time you go back and try to read your own script after being away from it for a week or two, you'll start to appreciate how important good comments and formatting are. And you don't save anything significant by being parsimonious. The form of the script that is actually executed (called the compiled version) has all the comments and white space removed, so they don't cause the script to execute any slower, or take up any extra memory.
Click on Event Handler Parameters to continue the tutorial.
LSL 101/Functions That Return a Value

Category:LSL 101
 
The built-in functions we've seen so far, llSay and llOwnerSay, act as commands, causing something to happen in SL. But other built-in functions are used to retrieve information from SL and make it available to the script. In this case, we say that the function returns the information.
The built-in function llGetRegionName is an example of this. When executed, it returns the name of whatever sim the script is executing in. If the script is running in Ganymede, for example, executing llGetRegionName would return the string "Ganymede".
Here's how that would work in a script.
default
{
 state_entry()
 {
 // Announce the name of the current region
 llOwnerSay( llGetRegionName() );
 }
}
Notice that llGetRegionName does not take any parameters, but it still has to be followed by a pair of parentheses. It is not followed by a semicolon, because it is not, by itself, a statement.
When the SL sim server executes the line
 llOwnerSay( llGetRegionName() );
it first executes the llGetRegionName function and (in essence) replaces llGetRegionName() with the string that is returned. This results in something like
 llOwnerSay( "Ganymede" );
which chats the string "Ganymede" to the object's owner.
Now let's make the output a little more meaningful by introducing string concatenation.
To continue this tutorial go forward to Creating a Script or review the page before, to Functions.
LSL 101/Integers

Category:LSL 101
Integers are another data type found in LSL along with Strings. LSL can handle whole numbers from −2,147,483,648 to +2,147,483,647. Integers can either be represented literally in a script or placed within a variable at run-time. Integers can use the following mathematical operations.
* + add
* - subtract
* * multiply
* / divide
* % modulus
To be able to print these numbers however, you'll need to typecast them into a string. 
default
{
 state_entry()
 {
 llSay(0, (string)5 );
 }
 
}
Why do we preface the number 5 with (string)? llSay is only expecting a string and will not be able to print a number without you typecasting it first. We can do the following.
default
{
 state_entry()
 {
 llSay(0, "5" );
 }
 
}
In the example above, 5 is represented as a string so no typecasting is needed. However in this form it's not really the integer 5. If it's not an integer, you won't be able to perform math on the number. Here's an example where math is performed before printing.
default
{
 state_entry()
 {
 llSay(0, (string)(2+3) );
 }
 
}
With some string concatenation you can combine two strings (including typecast numbers) to help label the output.
default
{
 state_entry()
 {
 llSay(0, "two plus three equals " + (string)(2 + 3) );
 llSay(0, "100 minus 1 equals " + (string)(100 - 1) );
 llSay(0, "5 times 5 equals " + (string)(5 * 5) );
 llSay(0, "six divides into twelve " + (string)(12 / 6) + " times." );
 llSay(0, "20 divided by 7 equals " + (string)(20 / 7) + " with a remainder of " + (string)(20 % 7));
 }
 
}
==Beyond Base 10==
You are used to using the decimal number system (called base 10), where numbers are counted using the digits 0 to 9, but you should also know there are other number systems that can be used with LSL, such as hexadecimal (base 16), which uses digits 0 to 9 and letters A to F. You don't need to know about the hexadecimal system to write scripts but you may well come across hexadecimal numbers if you are modifying scripts someone else has written and you may later find that there are some places where it makes sense to use hexadecimal numbers instead of decimals.
Hexadecimal numbers are written as in this example (which does exactly the same as the example above):
integer myNumber = 0x2a;
2a in hexidecimal = 42 [(2 * 16) + 10 is the same as (4 * 10) + 2]
A note to those who have used other programming languages before: LSL does not have a binary variable type. TRUE and FALSE are stored using integers with TRUE having a value of 1 and FALSE having a value of 0.
Continue the tutorial by going forward to Using Variables or go back to String Concatenation.
LSL 101/LSL in Focus: Types

__TOC__
=Summary of Types=
In a scripting language, types are a way of categorizing the values that the language can manipulate. In LSL, there are seven different types. Each of these types has its own representation and its own set of operations and/or built-in functions for manipulating values of that type. Here's a quick overview of each type and how it is used in LSL.
==Integers==
Integers are (a subset of) the basic "whole" numbers -- positive, negative and zero -- of mathematics. They are a very fundamental type in most computer languages. In LSL, they are used in four distinct ways.
* Signed Integers
* Truth Values (Booleans)
* Enumerations
* Bit Vectors
==Floats==
==Strings==
==Keys==
==Lists==
==Vectors==
==Rotations==
LSL 101/Simple Script Skeleton

Category:LSL 101
Here is an example of the simplest possible valid LSL script. It doesn't actually ask the computer to do anything but all scripts have, at minimum, this structure:
default 
{
 state_entry() 
 { // state_entry event handler goes here
 }
}
Looking at a script, the first thing you might notice is that the ratio of punctuation to words is quite high. This is a general characteristic of LSL. Along with parenthesis and curly braces, there will be lots of semicolons, quotation marks and square brackets, and it all has to be done just right. Fortunately, the rules for using punctuation are much simpler than for a natural language. So even though you are likely to struggle a lot with punctuation at the beginning, that phase won't last long.
In addition to the punctuation, there are two "names" in this example, "default" and "state_entry". In LSL, the underscore is not a punctuation mark, but one of the characters that can be used in names. It's most often used to combine what might be multiple words in English into a single name, because LSL requires every name to be a single word.
Based on this example script snippet, you might guess that there is a recurring pattern of the form
heading
{
 ...
}
in LSL, and you would be absolutely right. Each one of these is called a block, and a large part of an LSL script is made up of blocks within blocks (within blocks ...). Since getting the punctuation just right is mandatory, it is a good idea to vertically align opening and closing curly braces with their heading, and indent everything in between.
This is all grammar; what about the meaning of the two blocks? 
The outermost block, with the heading default denotes something referred to as the default state. States are a unique aspect of LSL, and we'll cover them later. But it will be easier to understand just how they work when you know more about other aspects of LSL. So for now, you can regard the outer block to be just a grammatical structure that is required in all scripts.
The inner block, headed by state_entry(), is an event handler block. Unlike states, understanding events and event handlers is crucial from the very start. In fact, if you happen to have had some prior experience with programming, it's especially important that you grok(understand) events, because unlike a traditional computer program, events occurring outside of your script determine when the various parts of your script get executed.
The state_entry event is a pretty simple one. It occurs when the script first starts running. Typically, this will be when you add a new script to a prim's inventory or save your changes after editing a script that is in a prim's inventory. When the sim server detects the state_entry event, it executes any commands (and only those commands) that occur between the { and } of the state_event handler block.
Click on Comments, White-space and Formatting to continue.
LSL 101/String Concatenation

Category:LSL 101
String concatenation allows us to combine two or more strings into a single string, as if they were simply pasted together. Here's an example where we use string concatenation to put the region name into a complete sentence.
 
default
{
 state_entry()
 {
 // Let the object's owner know the script is working
 llOwnerSay( "Congratulations! Your script has started to execute." );
 }
 
 touch_start( integer num_detected )
 {
 // Announce the region where the script is running
 llOwnerSay( "Welcome to " + llGetRegionName() + "." );
 }
}
The + sign, when used with strings, indicates concatenation. This is analogous to the use of + with integers to denote integer addition.
As in the previous example, the server executes llGetRegionName and reduces the line to the equivalent of
 llOwnerSay( "Welcome to " + "Ganymede" + "." );
It then concatenates the three strings, so it is equivalent to
 llOwnerSay( "Welcome to Ganymede." );
You might be thinking that an alternative to using string concatenation could be
 llOwnerSay( "Welcome to ", llGetRegionName(), "." );
But this won't work, because llOwnerSay expects only one string. Another alternative,
 llOwnerSay( "Welcome to ");
 llOwnerSay( llGetRegionName() );
 llOwnerSay( "." );
is legal, but it produces three separate lines of chat instead of one.
Even if everything you read here seems completely clear, your understanding will be much better if you actually write scripts as you go along. So here's a suggested exercise. The built-in function llGetDate returns a string representing today's date. Write and test a script that announces the date whenever it is clicked on.
Proceed onward to Integers or go back to Strings and Simple Output.
'''