Menu Environment DoString/RunString?

I made a quick module that let me do this, but I can’t do it anymore. Any alternatives than me using a module?

Nope.

Something like this.

[lua]LUA_FUNCTION(RunString)
{
Lua()->CheckType(1 , GLua::TYPE_STRING);
Lua()->RunString(Lua->GetString(1));
}

[/lua]

Unless **[G.CompileString

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=G.CompileString)** works. I don’t think it does in the menu environment.

I meant there wasnt a runstring/dostring in the menu env, and my module worked. I guess ill try compilestring or just remake my module

[editline]12:35PM[/editline]

Yeah compilestring isnt in menu environment :\ Makes debugging harder. Can you compile that for me, or are you busy, if your busy ill just get vc++

Compiling one now.

Thanks, just reformatted my computer

[lua]#undef _UNICODE
#include <windows.h>
#include “GMLuaModule.h”

GMOD_MODULE(Init , ShutDown);

LUA_FUNCTION(RunString)

{
Lua()->CheckType(1 , GLua::TYPE_STRING);
Lua()->RunString("" , “” , Lua()->GetString(1) , true , true);
return 0;
}

int Init(lua_State *L)
{
Lua()->SetGlobal(“RunString” , RunString);
return 0;
}

int ShutDown( lua_State *L )
{
return 0;
}[/lua]

http://dl.dropbox.com/u/9104987/gm_runstring.dll

Untested.

If it compiled fine, it should work. IT also looks right, so thanks.

[editline]01:09PM[/editline]

Error loading module
gm_runstring.dll’:
system error 14001

Odd.

ERROR_SXS_CANT_GEN_ACTCTX

No idea what that is.

[editline]07:45PM[/editline]

Try this.

http://dl.dropbox.com/u/9104987/gm_runstring.dll

Use LuaMenu, includes RunString :smug:

That is why it works for me then.