I added a Lua script to my C # application using DynamicLua libary and it works very well. I would like to realize that you get the current line that is running (as in Visual Studio), and highlight it.
I am currently doing this:
public static void RunLua(string LuaToExecute)
{
dynamic lua = new DynamicLua.DynamicLua();
string[] lua_s_split = LuaToExecute.Split('\n');
int counter = 0;
foreach (string line in lua_s_split)
{
HighlightLine(counter + 1);
lua(line);
counter++;
}
}
This works fine with my Lua code like
move(20, 19)
sleep(1000)
move(5, 19)
but I can not execute only one string expression. Like my related function move(). But I would also like to use multi-line expressions such as functions and loops. If the text editor contains:
function test()
return "Hallo Welt"
end
lua(line)will throw an exception because only the first line is passed function test(), and the interpreter is missing the final operator.
? , , ... , ? ? ?
, .