Parts bellow.
https://www.thingiverse.com/thing:569333
https://www.thingiverse.com/thing:1750875
_lua = new NLua.Lua();
_lua.LoadCLRPackage();
_lua.RegisterFunction("SendData", this, this.GetType().GetMethod("SendData"));
public void SendData(object dat)
{
byte[] byteData = (byte[])data;
// you can use ByteData from Lua Script
}
import ('System')
byteData = Byte[4] -- create 4 length Byte Array
byteData[0] = 0x00
byteData[1] = 0x11
byteData[2] = 0x22
byteData[3] = 0x33
SendData(byteData) -- Call C# Function from Lua