private void button_Copy_mini_Click(object sender, EventArgs e) //copy wow { string WowexeFullPath = "wow.exe"; try { WowexeFullPath = _pathSettings.Mini_pathDest + "\\Wow.exe"; CopyWoW(_pathSettings.Mini_pathSource, _pathSettings.Mini_pathDest, _pathSettings.Mini_pathVM, _progressBar, _statusLabel); if (checkBox_Relogger_mini.Checked || checkBox_Proxifier_mini.Checked) { QSnode selectedNode = _QSnodes.First(a => $"{a.Nick}-{a.Realm}" == Regex.Match(comboBox_QS_mini.SelectedItem.ToString(), @"^(\w*-\w*\s*\w*) \(").Groups[1].Value); MakeSettings_Single(new Character(selectedNode.Nick, "", selectedNode.Realm, false), _pathSettings.Mini_pathHB); if (checkBox_Relogger_mini.Checked) { try { AddHBRelogProfile(WowexeFullPath, _pathSettings.Mini_pathHB, selectedNode, checkBox_225_15_mini.Checked); } catch (Exception) { Log("ошибка при добавлении профиля"); // throw; } } if (checkBox_Proxifier_mini.Checked) { string wowname = Regex.Match(WowexeFullPath, @"\\(\w+).exe").Groups[1].Value; addProxifierProfile(_pathSettings.Mini_pathVM, wowname, selectedNode.proxyIP); } } } catch (Exception ex) { _statusLabel.Text = "Ошибка при копировании"; Log("Ошибка при копировании"); _statusLabel.ForeColor = System.Drawing.Color.Red; MessageBox.Show(ex.Message); } }
void LoadQuickSettings(string PathQSDirectory) { DirectoryInfo dir = new DirectoryInfo(PathQSDirectory); //var files1 = dir.GetFiles("*.xml"); var files = dir.GetFiles("*.xml").OrderBy(f => f.LastWriteTime).ToList(); files.Reverse(); foreach (var file in files) { QSnode node = new QSnode(file.FullName); //заружаем настройки из файла _QSnodes.Add(node); } foreach (var node in _QSnodes) { listBox_Available_full.Items.Add($@"{node.Nick}-{node.Realm} ({node.emailFull} | {node.WoWX})"); comboBox_QS_mini.Items.Add($@"{node.Nick}-{node.Realm} ({node.emailFull} | {node.WoWX})"); } }
void AddHBRelogProfile(string WowexeFullPath, string path_FolderHB, QSnode QuickSettigs, bool checked_225_15) { //XDocument doc; if (!Directory.Exists($@"C:\Users\{Environment.UserName}\AppData\Roaming")) { Directory.CreateDirectory($@"C:\Users\{Environment.UserName}\AppData\Roaming"); } if (!Directory.Exists($@"C:\Users\{Environment.UserName}\AppData\Roaming\HighVoltz")) { Directory.CreateDirectory($@"C:\Users\{Environment.UserName}\AppData\Roaming\HighVoltz"); } if (!Directory.Exists($@"C:\Users\{Environment.UserName}\AppData\Roaming\HighVoltz\HBRelog")) { Directory.CreateDirectory($@"C:\Users\{Environment.UserName}\AppData\Roaming\HighVoltz\HBRelog"); } if (!File.Exists($@"C:\Users\{Environment.UserName}\AppData\Roaming\HighVoltz\HBRelog\Settings.xml")) { XDocument doc = new XDocument(new XElement("BotManager")); doc.Root.Add(new XElement("AutoStart", "false")); doc.Root.Add(new XElement("WowDelay", "60")); doc.Root.Add(new XElement("HBDelay", "25")); doc.Root.Add(new XElement("LoginDelay", "6")); doc.Root.Add(new XElement("UseDarkStyle", "true")); doc.Root.Add(new XElement("CheckRealmStatus", "false")); doc.Root.Add(new XElement("CheckHbResponsiveness", "true")); doc.Root.Add(new XElement("CheckWowResponsiveness", "false")); doc.Root.Add(new XElement("MinimizeHbOnStart", "false")); doc.Root.Add(new XElement("AutoUpdateHB", "false")); doc.Root.Add(new XElement("AutoAcceptTosEula", "true")); if (tabControl1.SelectedTab == tab_full && checkBox_Relogger_full.Checked) { doc.Root.Add(new XElement("SetGameWindowTitle", "true")); } else { doc.Root.Add(new XElement("SetGameWindowTitle", "false")); } doc.Root.Add(new XElement("GameWindowTitle", "{name}-{pid}")); doc.Root.Add(new XElement("EncryptSettings", "false")); doc.Root.Add(new XElement("WowVersion", "")); doc.Root.Add(new XElement("GameStateOffset", "0")); doc.Root.Add(new XElement("FocusedWidgetOffset", "0")); doc.Root.Add(new XElement("LuaStateOffset", "0")); doc.Root.Add(new XElement("LoadingScreenEnableCountOffset", "0")); doc.Root.Add(new XElement("CharacterProfiles")); doc.Save($@"C:\Users\{Environment.UserName}\AppData\Roaming\HighVoltz\HBRelog\Settings.xml"); Log("HBRelog файл создан."); } Thread.Sleep(100); if (File.Exists($@"C:\Users\{Environment.UserName}\AppData\Roaming\HighVoltz\HBRelog\Settings.xml")) { XDocument doc = XDocument.Load($@"C:\Users\{Environment.UserName}\AppData\Roaming\HighVoltz\HBRelog\Settings.xml"); if (doc.Root.Element("CharacterProfiles").Elements("CharacterProfile").Any(a => a.Element("Settings").Element("WowSettings").Element("LoginData").Value == QuickSettigs.emailFull && a.Element("Settings").Element("WowSettings").Element("AcountName").Value == QuickSettigs.WoWX && a.Element("Settings").Element("WowSettings").Element("CharacterName").Value == QuickSettigs.Nick && a.Element("Settings").Element("WowSettings").Element("ServerName").Value == QuickSettigs.Realm)) { Log("Идентичный профиль в HBRelog уже существует, не будем добавлять"); return; } XElement characterprofile = new XElement("CharacterProfile"); XElement settings = new XElement("Settings"); settings.Add(new XElement("ProfileName", Regex.Match(WowexeFullPath, @"\\(\w+).exe").Groups[1].Value)); settings.Add(new XElement("IsEnabled", "true")); XElement wowsettings = new XElement("WowSettings"); wowsettings.Add(new XElement("LoginData", QuickSettigs.emailFull)); wowsettings.Add(new XElement("PasswordData", QuickSettigs.Password)); wowsettings.Add(new XElement("AcountName", QuickSettigs.WoWX)); wowsettings.Add(new XElement("CharacterName", QuickSettigs.Nick)); wowsettings.Add(new XElement("ServerName", QuickSettigs.Realm)); wowsettings.Add(new XElement("AuthenticatorSerialData", "")); wowsettings.Add(new XElement("AuthenticatorRestoreCodeData", "")); wowsettings.Add(new XElement("Region", "Auto")); wowsettings.Add(new XElement("WowPath", WowexeFullPath)); wowsettings.Add(new XElement("WowArgs", "-noautolaunch64bit")); string screenWidth = Screen.PrimaryScreen.Bounds.Width.ToString(); string screenHeight = Screen.PrimaryScreen.Bounds.Height.ToString(); if (screenWidth == "1920" && screenHeight == "1080") { wowsettings.Add(new XElement("WowWindowWidth", "400")); wowsettings.Add(new XElement("WowWindowHeight", "300")); } else if (screenWidth == "1600" && screenHeight == "900") { wowsettings.Add(new XElement("WowWindowWidth", "320")); wowsettings.Add(new XElement("WowWindowHeight", "180")); } else if (screenWidth == "1280" && screenHeight == "1024") { wowsettings.Add(new XElement("WowWindowWidth", "320")); wowsettings.Add(new XElement("WowWindowHeight", "256")); } else if (screenWidth == "800" && screenHeight == "600") { wowsettings.Add(new XElement("WowWindowWidth", "480")); wowsettings.Add(new XElement("WowWindowHeight", "360")); } else if (screenWidth == "1024" && screenHeight == "768") { wowsettings.Add(new XElement("WowWindowWidth", "505")); wowsettings.Add(new XElement("WowWindowHeight", "400")); } else { wowsettings.Add(new XElement("WowWindowWidth", "640")); wowsettings.Add(new XElement("WowWindowHeight", "480")); } wowsettings.Add(new XElement("WowWindowX", "0")); wowsettings.Add(new XElement("WowWindowY", "0")); settings.Add(wowsettings); XElement hbsettings = new XElement("HonorbuddySettings"); hbsettings.Add(new XElement("HonorbuddyKeyData", "")); hbsettings.Add(new XElement("CustomClass", "singular")); hbsettings.Add(new XElement("HonorbuddyArgs", "")); hbsettings.Add(new XElement("BotBase", "")); hbsettings.Add(new XElement("HonorbuddyProfile", "")); hbsettings.Add(new XElement("HonorbuddyPath", path_FolderHB + "\\Honorbuddy.exe")); hbsettings.Add(new XElement("UseHBBeta", "false")); settings.Add(hbsettings); characterprofile.Add(settings); XElement tasks = new XElement("Tasks"); if (checked_225_15) { tasks.Add(new XElement("WaitTask", new XAttribute("Minutes", "225"), new XAttribute("RandomMinutes", "15"))); tasks.Add(new XElement("IdleTask", new XAttribute("Minutes", "14"), new XAttribute("RandomMinutes", "3"))); } characterprofile.Add(tasks); doc.Root.Element("CharacterProfiles").Add(characterprofile); doc.Save($@"C:\Users\{Environment.UserName}\AppData\Roaming\HighVoltz\HBRelog\Settings.xml"); Log("HBRelog профиль создан."); } }
private void button_CopySome_full_Click(object sender, EventArgs e) //clone wow { string WowexeFullPath = ""; try { int a = Convert.ToInt32(textBox_from_full.Text); int b = Convert.ToInt32(textBox_to_full.Text); DirectoryInfo destDirectoryInfo = new DirectoryInfo(_pathSettings.Full_pathDest); List <Character> characters = new List <Character>(); if ((checkBox_Relogger_full.Checked || checkBox_Proxifier_full.Checked) && listViewEx1.Items.Count > 0) { for (int i = 0; i < listViewEx1.Items.Count; i++) { string str1 = Regex.Match(listViewEx1.Items[i].Text, @"^(\w*-\w*\s*\w*) \(").Groups[1].Value; QSnode selectedNode = _QSnodes.First(o => $"{o.Nick}-{o.Realm}" == str1); characters.Add(new Character(selectedNode.Nick, "", selectedNode.Realm, (listViewEx1.GetEmbeddedControl(1, i) as RadioButton).Checked)); } } MakeSettings_Multiple(characters, _pathSettings.Full_pathHB); for (int i = a; i <= b; i++) { string wowname = destDirectoryInfo.Name + i; CopyWoW(_pathSettings.Full_pathSource, (_pathSettings.Full_pathDest + i.ToString()), _pathSettings.Full_pathVM, _progressBar, _statusLabel); File.Move(_pathSettings.Full_pathDest + i.ToString() + "\\Wow.exe", _pathSettings.Full_pathDest + i.ToString() + "\\" + wowname + ".exe"); File.Move(_pathSettings.Full_pathDest + i.ToString() + "\\Wow-64.exe", _pathSettings.Full_pathDest + i.ToString() + "\\" + wowname + "-64.exe"); if ((checkBox_Relogger_full.Checked || checkBox_Proxifier_full.Checked) && listViewEx1.Items.Count > 0) { //var egwgw = (listViewEx1.GetEmbeddedControl(1, 0) as ComboBox).Items; // 2 столбец 1 строки, комбобокс для роли. string str1 = Regex.Match(listViewEx1.Items[0].Text, @"^(\w*-\w*\s*\w*) \(").Groups[1].Value; QSnode selectedNode = _QSnodes.First(o => $"{o.Nick}-{o.Realm}" == str1); bool isLeader = (listViewEx1.GetEmbeddedControl(1, 0) as RadioButton).Checked; bool tasks_255_15 = (listViewEx1.GetEmbeddedControl(2, 0) as CheckBox).Checked; if (checkBox_Relogger_full.Checked) { try { WowexeFullPath = _pathSettings.Full_pathDest + i.ToString() + "\\" + wowname + ".exe"; AddHBRelogProfile(WowexeFullPath, _pathSettings.Full_pathHB, selectedNode, tasks_255_15); } catch (Exception) { Log("ошибка при добавлении профиля"); // throw; } } if (checkBox_Proxifier_full.Checked) { addProxifierProfile(_pathSettings.Full_pathVM, wowname, selectedNode.proxyIP); } listViewEx1.Items[0].Remove(); } else { if (checkBox_Relogger_full.Checked) { try { WowexeFullPath = _pathSettings.Full_pathDest + i.ToString() + "\\" + wowname + ".exe"; AddHBRelogProfile(WowexeFullPath, _pathSettings.Full_pathHB, new QSnode("@@@@@@@BATTLE.NET", "WoW", "qwer1234", "", "Ревущий фьорд"), false); } catch (Exception) { Log("ошибка при добавлении профиля"); // throw; } } if (checkBox_Proxifier_full.Checked) { Log($"Закончились QSnodes.\r\nБыли созданы \\{_pathSettings.Full_pathDest + a.ToString()}\\ - \\{_pathSettings.Full_pathDest + (i - 1).ToString()}\\\r\n и пуской конфиг для \\{_pathSettings.Full_pathDest + i.ToString()}\\"); MessageBox.Show( $"Закончились QSnodes.\r\nБыли созданы \\{_pathSettings.Full_pathDest + a.ToString()}\\ - \\{_pathSettings.Full_pathDest + (i - 1).ToString()}\\ и пуской конфиг для \\{_pathSettings.Full_pathDest + i.ToString()}\\"); return; } } } } catch (Exception ex) { label_Status_full.Text = "Ошибка при копировании"; Log("Ошибка при копировании"); label_Status_full.ForeColor = System.Drawing.Color.Red; MessageBox.Show(ex.Message); //throw; } }