collect Lua scripts in one script
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: collect Lua scripts in one script
- From: Philipp Kraus <philipp.kraus@...>
- Date: 2012年12月29日 20:00:06 +0100
Hello,
I have got different Lua scripts, that have all the same structure. The scripts have got four functions, but two of the functions are optional eg:
function init( ... )
end
function iterate( ... )
end
and optional
function event( ... )
end
function destroy( ... )
end
All scripts have got these functions, so I would read all scripts into one Lua state, so that I can call each script
like :
script1.init
script2.init
script1.iterate
...
How can I read the Lua script and push the Lua functions into a nested table? Or is there a better way to do this structure?
Thanks
Phil