1 Basics of Lua
The Lua scripting language was originally designed for extending the functionality of existing applications, but it is often used as a standalone language. It is very similar to Pascal.
The language has the objectives of simplicity, efficiency and portability of code. The full Lua language documentation can be found at http://www.lua.org/manual/5.1/ . Below are some basic elements that you need to get started with writing scripts in Lua.
1.1 Structure of the code
In Lua, commands are typed, as in other programming languages in lines one under the other. There is no need for a termination character at the end of each line (however Lua ignores a semicolon at the end of the line, so you do not have to get rid of habits acquired from other programming languages which require that symbol).
1.2 Declaring local variables
If you want to declare a local variable, type:

