diff --git a/ChaosBot/Services/ProgrammingLanguageInterpreter/LuaProgrammingLanguageInterpreter.cs b/ChaosBot/Services/ProgrammingLanguageInterpreter/LuaProgrammingLanguageInterpreter.cs index bfdcb0a..2322e9b 100644 --- a/ChaosBot/Services/ProgrammingLanguageInterpreter/LuaProgrammingLanguageInterpreter.cs +++ b/ChaosBot/Services/ProgrammingLanguageInterpreter/LuaProgrammingLanguageInterpreter.cs @@ -26,7 +26,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter MethodInfo printMethod = GetType().GetMethod("Print", BindingFlags.NonPublic | BindingFlags.Instance); LoggingFacade.Info($"Overwriting print function with {printMethod}"); - _state["print"] = printMethod; + _state["print"] = _state.RegisterFunction("print", this, printMethod); LoggingFacade.Trace("Disabling Lua `import` function"); _state.DoString ("\nimport = function () end\n"); @@ -51,9 +51,9 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter // ReSharper disable once UnusedMember.Local private void Print(params object[] parameters) { - string str = string.Join(" ", from param in parameters select param == null ? string.Empty : param.ToString()); + string str = string.Join("\t", from param in parameters select param == null ? string.Empty : param.ToString()); - _outputBuilder.Append(str); + _outputBuilder.AppendLine(str); } } }