Scripting Languages

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Removed 'Template:' prefix from template includings and/or changed external-link into internal-link)
m (Robot: Replacing 'OpenSim' to 'OpenSimulator', which is the precise name)
Line 5: Line 5:
 
= Scripting Languages =
 
= Scripting Languages =
  
OpenSim currently supports 5 scripting languages, and more are under way.<br />
+
OpenSimulator currently supports 5 scripting languages, and more are under way.<br />
Scripts are restored automatically when OpenSim starts.<br />
+
Scripts are restored automatically when OpenSimulator starts.<br />
  
 
== LSL ==
 
== LSL ==

Revision as of 23:58, 3 March 2012


Scripting Languages

OpenSimulator currently supports 5 scripting languages, and more are under way.
Scripts are restored automatically when OpenSimulator starts.

LSL

LSLv2 is the well known Second Life scripting language. It is basically a C#/Java-like language. Although many commands are still being developed, the majority of ll-functions has been implemented and it is possible to make usable scripts. If you want to ensure that the compiler treats your script as LSL you should have "//lsl" as the first 5 letters in script. Example code:

default
{
   state_entry()
   {
      llSay(0, "This is an incredibly useless program.");
   }
}

C#

C# is a .Net language.
Although it is C# the behaviour is much like LSL in the sense that you still use ll-functions like llSay(), and still use the same events as in LSL.
The first 4 characters in your script must be "//c#" for the compiler to treat it as C#.

Example code:

//c#
public void default_event_state_entry()
{
    llSay(0, "This is an incredibly useless program.");
}

VB.Net

Note! Mono does not have compiler for VB.Net, so VB.Net scripts may not work on Mono. :) VB.Net is a .Net language.
Although it is VB.Net the behaviour is much like LSL in the sense that you still use ll-functions like llSay(), and still use the same events as in LSL.
The first 4 characters in your script must be "//vb" for the compiler to treat it as VB.Net.

Example code:

//vb
Public Sub default_event_state_entry()
    llSay(0, "This is an incredibly useless program.")
End Sub

JScript.Net

The first 4 characters in your script must be "//js" for the compiler to treat it as JScript.Net.

Example code:

//js
function default_event_state_entry()
{
    llSay(0, "This is an incredibly useless program.");
}

Yield Prolog

The first 4 characters in your script must be "//yp" for the compiler to treat it as Yield Prolog.

Example code:

//yp
Personal tools
General
About This Wiki