public static string ReadConsoleLine() { if (Variables.GetValue("inputText") != "null") { Console.Write(Variables.GetValue("inputText")); } return(EConsole.ReadLine()); }
public static void CommandLine() { ScriptColor = ConsoleColor.White; Cmd.Process("ShowConsole"); new Thread(CheckUpdates).Start(); Variables.Set("showResult", "1"); GlobalVars.StopProgram = false; EConsole.ForegroundColor = ConsoleColor.White; EConsole.WriteLine("Need help? Type: help"); if (!GlobalVars.IsCompiledScript && !System.Reflection.Assembly.GetExecutingAssembly().Location.Contains("\\ESCRIPT\\escript.exe")) { EConsole.WriteLine("To install this copy of ESCRIPT type: install"); } while (true) { EConsole.ForegroundColor = ConsoleColor.Green; EConsole.Write(Variables.GetValue("invitation")); EConsole.ForegroundColor = ConsoleColor.White; string line = EConsole.ReadLine(); EConsole.ForegroundColor = ScriptColor; SetResult(Cmd.Process(GlobalVars.RemoveDirtFromString(line))); if (Variables.GetValue("showResult") == "1") { PrintResult(Variables.GetValue("result")); } if (Variables.GetValue("forceGC") == "1") { GC.Collect(); GC.WaitForPendingFinalizers(); } if (GlobalVars.StopProgram) { break; } } }