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 LoadProxies(string proxyType = null) { _runLists = RunLists.GetOrNewInstance(); _consoleUtils = ConsoleUtils.GetOrNewInstance(); string text = $"Select your{(proxyType != null ? $" {proxyType}" : null)} Proxies File"; _consoleUtils.Write($"{text} "); OpenFileDialog dialog = new OpenFileDialog { Title = text, Filter = "Text File|*.txt" }; while (true) { if (dialog.ShowDialog() == DialogResult.OK) { string file = dialog.FileName; foreach (string line in File.ReadAllLines(file)) { _runLists.proxies.Add(line); } if (_runLists.proxies.Count != 0) { break; } } } Console.Clear(); }
public string GetRandomProxy(ProxyList proxies = null) { _runLists = RunLists.GetOrNewInstance(); if (proxies == null) { proxies = _runLists.proxies; } return(proxies[random.Next(proxies.Count)]); }
public string GetRandomCombo(ComboList combos = null) { _runLists = RunLists.GetOrNewInstance(); if (combos == null) { combos = _runLists.combos; } return(combos[random.Next(combos.Count)]); }
public string GetEstimatedTime() { _runLists = RunLists.GetOrNewInstance(); _runInformations = RunInformations.GetOrNewInstance(); int estimatedSeconds; try { estimatedSeconds = (_runLists.combos.Count - _runInformations.ran) / (ranPerMinute / 60); } catch { estimatedSeconds = 0; } return(TimeSpan.FromSeconds(estimatedSeconds).ToString()); }
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); }