Questions tagged [luainterface]

LuaInterface is a library for integration between the Lua language and Microsoft .NET platform's Common Language Runtime (CLR).

LuaInterface is a library for integration between the Lua language and Microsoft .NET platform's Common Language Runtime (CLR). Lua scripts can use it to instantiate CLR objects, access properties, call methods, and even handle events with Lua functions.

95 questions
2
votes
2 answers

LuaInterface C# Metatables

I have some background lua codes and I load them on each startup, They work fine, But Is there any way I can convert them to C#? Here Is my meta table codes: player = {} player.__index = player function player:Add(name) return…
111WARLOCK111
  • 857
  • 2
  • 7
  • 14
2
votes
1 answer

C# LuaInterface class operators

I'm using LuaInterface in C# and I "exported" some custom C# classes to be used in Lua. For instance: local myVector = Vector2(10, 100) But, when I want to use class operators like in this example: local v1 = Vector2(1, 1) local v2 = Vector2(2,…
Erwin Okken
  • 233
  • 2
  • 17
2
votes
1 answer

LuaInterface: How to access multi dimensional lua table?

I am new to LuaInterface and have a very simple question: How can I access data from a multi dimensional lua table from c#? I managed to read strings and integer values but was not lucky with tables. My goal is to display the content of a…
2
votes
0 answers

Access of Lua functions from C# via LuaInterface

I have a problem with LuaInterface accessing Lua functions from C#. If I have a LuaFunction defined like this function object:OnEvent() -- Do something end this could be access from C# with a normal call like (object["OnEvent"] as…
user1829325
  • 108
  • 6
2
votes
2 answers

LuaInterface - How can I load an assembly from any path?

I am trying to load a .net assembly using LuaInterface. If I place the assembly in the same folder as my executable (and my LuaInterface.dll and LuaNet.dll) then everything works great. I would like to move the assembly into a different folder, but…
TobyD
  • 21
  • 4
2
votes
2 answers

LuaInterface - RegisterFunction Object Reference

I'm trying to integrate LuaInterface into C# and I am getting an System.NullReferenceException when I am trying to bind an C# function to Lua. The code I am trying to compile and run is: using System; using System.Collections.Generic; using…
jRiddick
  • 21
  • 1
  • 2
2
votes
3 answers

Mapping C# classes to Lua functions via dll

In my "LuaTest" namespace I have a class called "Planet". The C# code reads like this: using System; using System.Collections.Generic; using System.Linq; using System.Text; using LuaInterface; namespace LuaTest { public class Planet { …
proudnoldo
  • 71
  • 1
  • 4
2
votes
1 answer

C# and LuaInterface: How to add table entries to a C# object in Lua

I use SharpLua with MonoDevelop. I created a class on C# side, which should be usable from Lua. That's works fine, I can access all fields from Lua. It's very easy. public class Test { public string Name; } could be access from Lua…
user1829325
  • 108
  • 6
2
votes
1 answer

Building Lua Modules for LuaInterface

I have a Lua module (lpack) that I need to load into LuaInterface. I've tried a few different configurations for the project, but I can't seem to figure out the linking. I get the error unresolved external symbol "void __stdcall…
kyork
  • 713
  • 5
  • 14
1
vote
2 answers

Disconnect an event in Lua

I was reading a part of the LuaInterface Tutorial (here) and found out that you can associate an event with a function by doing something similar to this: button.Click:Add(function() MessageBox.Show("We wuz…
Freesnöw
  • 30,619
  • 30
  • 89
  • 138
1
vote
3 answers

LuaInterface multi-threading crash

Is there a way to make LuaInterface work in a multithreaded environment? I have a multithreaded c# (.Net 4) assembly that uses LuaInterface to process data from a native application. Each thread has its own instance of the Lua interpreter. I use…
Galen
  • 499
  • 5
  • 14
1
vote
1 answer

LuaInterface event handling

I have looked around for a good tutorial on how to Handle events using LuaInterface, but am still stuck trying to find one that actually explains what must be done in detail. Could someone write up a simple tutorial, or point me in the direction of…
ZeunO8
  • 422
  • 6
  • 25
1
vote
2 answers

Getting a FileNotFoundException on lua51.dll when using LuaInterface on C# 4.0 but it's right there

I've been using LuaInterface and Lua 5.1 in several C# applications that required scripting, most notably a few games, an IRC bot and a full IRC client that I've recently decided to resume working on. At one point, I switched to .Net 4.0 and had to…
Kawa
  • 1,478
  • 1
  • 15
  • 20
1
vote
2 answers

How do I setup Wireshark to run Lua's CLRPackage

I'm trying to setup Wireshark so that I can use the LuaInterface to use some of the classes in the .NET framework. I'm able to get it working running through the Lua command line, but when I try to require "CLRPackage" in the init.lua startup…
SwDevMan81
  • 48,814
  • 22
  • 151
  • 184
1
vote
1 answer

Wait for Asynchronous Event in Lua

I have a library in Lua that creates and parses data packets for a protocol. When I send a packet out, I'm expecting a reply back from the destination that is then parsed into a table. I'm trying to write a wrapper around this library so that I…
kyork
  • 713
  • 5
  • 14