public MilkyManager() { KeyboardListener = KeyboardListener.GetOrNewInstance(); ConsoleLoops = ConsoleLoops.GetOrNewInstance(); LoopsManager = LoopsManager.GetOrNewInstance(); StatisticsLoops = StatisticsLoops.GetOrNewInstance(); OutputSettings = OutputSettings.GetOrNewInstance(); ProgramInformations = ProgramInformations.GetOrNewInstance(); ProgramManager = ProgramManager.GetOrNewInstance(); RunInformations = RunInformations.GetOrNewInstance(); RunLists = RunLists.GetOrNewInstance(); RunManager = RunManager.GetOrNewInstance(); ConsoleSettings = ConsoleSettings.GetOrNewInstance(); RunSettings = RunSettings.GetOrNewInstance(); CustomStatistics = CustomStatistics.GetOrNewInstance(); RunStatistics = RunStatistics.GetOrNewInstance(); ConsoleUtils = ConsoleUtils.GetOrNewInstance(); DateTimeUtils = DateTimeUtils.GetOrNewInstance(); FileUtils = FileUtils.GetOrNewInstance(); FormatUtils = FormatUtils.GetOrNewInstance(); HashUtils = HashUtils.GetOrNewInstance(); ListUtils = ListUtils.GetOrNewInstance(); RequestUtils = RequestUtils.GetOrNewInstance(); StringUtils = StringUtils.GetOrNewInstance(); UserUtils = UserUtils.GetOrNewInstance(); }
public void StartListening() { _runInformations = RunInformations.GetOrNewInstance(); _customStatistics = CustomStatistics.GetOrNewInstance(); Task.Run(() => { while (_runInformations.runStatus == RunInformations.RunStatus.Running) { if (Console.KeyAvailable) { ConsoleKeyInfo pressed = Console.ReadKey(true); switch (pressed.Key) { case ConsoleKey.S: { _customStatistics.DisplayCustomStatistics(); break; } } } Thread.Sleep(100); } }); }
public void FinishRun() { _runInformations = RunInformations.GetOrNewInstance(); _customStatistics = CustomStatistics.GetOrNewInstance(); _consoleUtils = ConsoleUtils.GetOrNewInstance(); _runInformations.runStatus = RunInformations.RunStatus.Finished; _consoleUtils.WriteLine(null); _customStatistics.DisplayCustomStatistics(); _consoleUtils.UpdateTitle(); _consoleUtils.Write($"{Environment.NewLine}Finished "); }
public string FormatTitle(string text) { _programInformations = ProgramInformations.GetOrNewInstance(); _runInformations = RunInformations.GetOrNewInstance(); _runLists = RunLists.GetOrNewInstance(); _runStatistics = RunStatistics.GetOrNewInstance(); _customStatistics = CustomStatistics.GetOrNewInstance(); _outputSettings = OutputSettings.GetOrNewInstance(); text = text .Replace("%program.name%", _programInformations._name) .Replace("%program.version%", _programInformations._version) .Replace("%program.author%", _programInformations._author) .Replace("%lists.combos%", _runLists.combos.Count.ToString()) .Replace("%lists.proxies%", _runLists.combos.Count.ToString()) .Replace("%run.ran%", _runInformations.ran.ToString()) .Replace("%run.remaining%", (_runLists.combos.Count - _runInformations.ran).ToString()) .Replace("%run.hits%", _runInformations.hits.ToString()) .Replace("%run.free%", _runInformations.free.ToString()) .Replace("%run.ran.percentage%", _runLists.combos.Count == 0 ? "0,00%" : ((double)_runInformations.ran / (double)_runLists.combos.Count).ToString("0.00%")) .Replace("%run.hits.percentage%", _runInformations.ran == 0 ? "0,00%" : ((double)_runInformations.hits / (double)_runInformations.ran).ToString("0.00%")) .Replace("%run.free.percentage%", _runInformations.hits == 0 ? "0,00%" : ((double)_runInformations.free / (double)_runInformations.hits).ToString("0.00%")) .Replace("%statistics.rpm%", _runStatistics.ranPerMinute.ToString()) .Replace("%statistics.elapsed%", _runStatistics.GetElapsedTime()) .Replace("%statistics.estimated%", _runStatistics.GetEstimatedTime()); lock (_customStatistics.customStatisticsLocker) foreach (var customStatistic in _customStatistics.customStatistics) { text = text .Replace($"%custom.{customStatistic.Key.Replace(" ", "_")}%", customStatistic.Value.ToString()) .Replace($"%custom.{customStatistic.Key.Replace(" ", "_")}.percentage%", customStatistic.Value == 0 ? "0,00%" : ((double)customStatistic.Value / (double)_runInformations.hits).ToString("0.00%")); } return(text); }