Basic Lua Orders Reference

The following Lua orders are regularly used in the Script module:

Lua Objects

Methods are activated with ":".

object:method(...);

Properties are accessed with ".".

object.property;

Variables

Values are assigned to variable by a simple "=".
Variable = Value
Variables are defined by such assignments. For many operations in the script module, you can choose any name as variable and assign elements of the 3S module to that name. For example:
cell=structure:findcell("cell1");

In this example, the cell with the name cell1 in the 3S Generator is from now on referred to as cell in the script. For some methods, you can add a the Boolean value true or false.

Relational Operators

Operator Description
== Equal
~= Not Equal
< Less Than
<= Less Than or Equal
> Greater Than
>= Greater Than or Equal

Arithmetic Operators

Operator Description
+, -, *, / Basic arithmetic operations
Exponent
and, or, not Boolean operations

Conditions

if condition then block end

if condition then block1 else block2 end

if condition then block1 elseif condition2 then block2 else block3 end

for variable = start, end, jump distance do block end

while condition do block end

repeat block until condition

Abort: break