I recently started using LuaInterface in order to be able to run Lua scripts from a C# program. I wrote a test script which returns a string:
teststring = "PRIVMSG #```` : SUCCESS!"
return testring
I then try and add it to a C# Queue<string
> by doing:
sendQueue.Enqueue(lua.DoFile(script).ToString());
However, this doesn't return a string. Instead, it returns System.Object[]. How do I get it to return System.String instead?
A friend of mine managed to stumble upon the answer. In order to get it to produce an actual string, you should do the following:
I don't understand why this method works, just that it does.