First of all Im a total beginner of this, but thanks to all ppl in this forum I have got some nice things up and running in a pretty short time period. Especially big thanks to Cypher, Kynox and Shynd, whos valuable information and findings pointed me in a good direction to start.
Well on to it, call LUA and get return values have been covered in lots of threads here, but from what Ive seen theres a missconception that the Lua_ToXXX (String, Int, etc) pops the LUA stack, this is not the case. So if you have problems with growing stacks, you want to call
lua_settop at 0x007ADAF0 for 3.0.9 (havnt seen it in dump lists dunno why)
use it from c you do like this to empty the stack (pop it all, see LUA docs for more info)
typedef void (__cdecl * tLuaSetTop)(LPDWORD luaState, int idx);
tLuaSetTop luaSetTop = (tLuaSetTop)0x007ADAF0;
luaSetTop(state, 0)
I know that escpecially Cyper now will point out that there are ways to call LUA without you having to manage youre stack, and there are. Just wanted to share this finding since I havnt seen it covered before, but on the other hand, I cant even search this forum...