[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Call module function from C
- From: "Tony Paloma" <drunkenf00l@...>
- Date: Tue, 18 Dec 2007 01:31:41 -0800
I'm trying to call a module function from C. What I tried to do was this:
lua_getglobal(GetLuaState(), "hook.Call");
lua_pushstring(GetLuaState(), "Think");
if(lua_pcall(GetLuaState(), 1, 1, 0) == 0)
{
/* get the result */
int sum = (int)lua_tointeger(GetLuaState(), -1);
lua_pop(GetLuaState(), 1);
}
This doesn't work, and I understand that you cannot access a module function
like this. I'm trying to call the Call function of the hook module. How
would I do this correctly?