Image

About connecting Lua and Java

For those of you who may be interested in using Lua as a scripting tool for Java apps (I know Imagejvicious is): http://www.keplerproject.org/luajava/ . After adding it to the project you can pretty easily read data and use functions defined in Lua files. In its simplest use, as a parser of data files, it works like that:

(Java app)

import org.keplerproject.luajava.*;
...
LuaState lua = LuaStateFactory.newLuaState();
lua.doFile("data.lua");
LuaObject data = lua.getLuaObject("data");
String data_string = null
if(data.isString()) data_string = data.getString();
// it'd be nice to have a wrapper for the last three lines...

(data.lua)

data = "hello, world"

It can also be used in the other direction - to call Java methods from the inside of Lua. But I'm not interested in this right now, so mwah.