|
In C: lua_load / luaL_loadfile loads your script into Lua without executing it; the script is left as a function on the top of the stack. You can store this function in a handy location (such as in LUA_REGISTRYINDEX, LUA_ENVIRONINDEX etc), and lua_pcall it multiple times (assuming that everything happens in one lua_State). If you're going to do it straightaway, just lua_pushvalue() the function before each lua_pcall but the last. In Lua: local buttonscript, err = loadfile("mybuttonscript.out") if not buttonscript then print(err) else for i = 1, 5 do buttonscript() end end HTH On May 4, 2008, at 11:48 AM, Mario wrote:
Be seeing you grrr waaa www.grahamwakefield.net |