User Tools

Site Tools


doc:lua:start

This is an old revision of the document!


Make your own Lua Scripts

FIXME under construction

What is Lua?

Simply said, Lua is “something” (a so called script interpreter) which is made to allow a program to run another program internally. The trick in that is, that the internal program does not need to be there when the “outer” program is made, it can be loaded later, just when you need it.

This allows to make a program now but change its behavior later as needed. This is widely used in the OOBD script engine: The script engine is there from the beginning, but what it does is defined by the script which is loaded at runtime. Another script, another functionality..

Luckely Lua became quite popular in the last years, so it's available for all major platforms, like Desktop PCs, Smartphone and Mobile Phones.

There are tons of documentation about Lua available in the internet, so we'll not explain the wheel here once more, we'll just focus on how Lua works inside OOBD.

The Lua - OOBD Interface

If Lua runs inside another program, without further assistance it does it like in a black box: No connection from the inside to the outside, no inputs, no feedbacks. This is obviously not very senseful, so when Lua is implemented into another program, there a normally some interfaces made up to let Lua and its host communicate to each other.

From the Lua perspective, these interfaces look like normal Lua function calls, but when such a function is called, the execution branches into the outer program, does something there and finally returns from that function back to Lua.

In the moment the OOBD interface supports two kinds of interfaces for Lua: Some for creating the menus, and some to talk to the serial line 1)

Compile your Scripts

1)
this is certainly subject to change in the future, when OOBD becomes more generic and the data links become more abstract
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
doc/lua/start.1307211180.txt.gz · Last modified: 2011/06/04 20:13 (external edit)