lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Re-posted:

> 	lua_getglobal(m_LuaVM, "myscript");
> 	if(lua_istable(m_LuaVM,-1)) {
> 		lua_pushstring(m_LuaVM,"debug");
> 		lua_gettable(m_LuaVM,-2);
> 		if(lua_isfunction(m_LuaVM,-1))
Add this:
                  lua_pushvalue( m_LuaVM, -3 );  //self

> 			lua_call(m_LuaVM, 0, 0);

Call like this:
                  lua_call(m_LuaVM, 1, 0);

> 		else
> 			lua_pop(m_LuaVM,1);
> 	}
>