toxidworm
toxidworm
CC#
Created by toxidworm on 12/30/2023 in #help
Is it possible to access windows objects in a static method?
5 replies
CC#
Created by toxidworm on 12/26/2023 in #help
NLua problem
I'm trying to embed lua in my application and I'm stuck over a problem that it cannot pick method names from .NET LUA:
import ('System.Diagnostics')

Process:Start("notepad")
import ('System.Diagnostics')

Process:Start("notepad")
C#:
static void Main()
{
Lua state = new Lua();
state.LoadCLRPackage();
string script = File.ReadAllText("script.lua");
state.DoString(script);
}
static void Main()
{
Lua state = new Lua();
state.LoadCLRPackage();
string script = File.ReadAllText("script.lua");
state.DoString(script);
}
The error
Unhandled Exception: NLua.Exceptions.LuaScriptException: [string "chunk"]:3: attempt to index a nil value (global 'Process')
at NLua.Lua.ThrowExceptionFromError(Int32 oldTop)
at NLua.Lua.DoString(String chunk, String chunkName)
at LuaEmbed.Program.Main() in D:\Dev\Sharp\LuaEmbed\LuaEmbed\Program.cs:line 15
Unhandled Exception: NLua.Exceptions.LuaScriptException: [string "chunk"]:3: attempt to index a nil value (global 'Process')
at NLua.Lua.ThrowExceptionFromError(Int32 oldTop)
at NLua.Lua.DoString(String chunk, String chunkName)
at LuaEmbed.Program.Main() in D:\Dev\Sharp\LuaEmbed\LuaEmbed\Program.cs:line 15
31 replies