This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
justync7's profile picture

Implementing Lua into a VB.NET Application

Started by justync7, 16 July 2014 - 11:29 PM
justync7 #1
Posted 17 July 2014 - 01:29 AM
Does anyone know how to go about this? I have been trying to figure out a way, and I have already tried LuaInterface with no luck.

Everytime I run my application it just errors, I guess luainterface is mainly meant for C#.
Edited on 16 July 2014 - 11:29 PM
SquidDev #2
Posted 17 July 2014 - 08:15 AM
Shameless Plug

I rewrote LuaInterface to work with KopiLua: https://github.com/S...v/LuaInterface. If you include the DLL in the project (You will have to build it first - though I can provide binaries if you haven't got C# installed (but why wouldn't you - everyone has C# installed right?)).

Example code (lets see if I can remember VB):

Imports LuaInterface
''Your window/logic/whatever
Dim LuaInstance as Lua = new Lua();
Lua["Hello"] = 60;
Lua["Cheese"] = "Hai";
Dim Table as LuaTable = new LuaTable(LuaInstance);
Table["Thing"] = "Something";
Lua["Stuff"] = Table;
Dim Thing as Object = Lua["Hello"] ''60
Dim Result as Object = LuaInstance.DoString("print(Hello) return Cheese") ''Prints 60, returns "Hai"

I hope that explains it, you're best off reading the source code, most of it is pretty well documented, but feel free to ask.
Edited on 17 July 2014 - 06:19 AM
justync7 #3
Posted 17 July 2014 - 08:18 AM
Shameless Plug

I rewrote LuaInterface to work with KopiLua: https://github.com/S...v/LuaInterface. If you include the DLL in the project (You will have to build it first - though I can provide binaries if you haven't got C# installed (but why wouldn't you).

Example code (lets see if I can remember VB):

Imports LuaInterface
''Your window/logic/whatever
Dim LuaInstance as Lua = new Lua();
Lua["Hello"] = 60;
Lua["Cheese"] = "Hai";
Dim Table as LuaTable = new LuaTable(LuaInstance);
Table["Thing"] = "Something";
Lua["Stuff"] = Table;
Dim Thing as Object = Lua["Hello"] ''60
Dim Result as Object = LuaInstance.DoString("print(Hello) return Cheese") ''Prints 60, returns "Hai"

I hope that explains it, you're best off reading the source code, most of it is pretty well documented, but feel free to ask.

Oh my, you're my savior. You have brought the life back into the deserted LuaInterface :)/>