public static void DoTalents() { try { if (GetNumUnspentTalents() == 0) { return; } if (Others.ExistFile(Application.StartupPath + "\\CombatClasses\\Talents\\" + ObjectManager.ObjectManager.Me.WowSpecialization() + ".talents.txt")) { Lua.RunMacroText("/click PlayerTalentFrameCloseButton"); // Make sure it's already closed. Thread.Sleep(400); Lua.RunMacroText("/click TalentMicroButton"); string advised = Others.ReadFile(Application.StartupPath + "\\CombatClasses\\Talents\\" + ObjectManager.ObjectManager.Me.WowSpecialization() + ".talents.txt"); var talents = advised.Split('|'); foreach (string s in talents) { Lua.LuaDoString("PlayerTalentFrame_SelectTalent(" + s + ")"); } Lua.RunMacroText("/click PlayerTalentFrameTalentsLearnButton"); Thread.Sleep(400); Lua.RunMacroText("/click PlayerTalentFrameCloseButton"); } } catch (Exception exception) { Logging.WriteError("DoTalents(): " + exception); } }
private void InitializeProgram() { try { // File .exe.config Process tempsProcess = Process.GetCurrentProcess(); if (!Others.ExistFile(Application.StartupPath + "\\" + tempsProcess.ProcessName + ".exe.config")) { var sw = new StreamWriter(Application.StartupPath + "\\" + tempsProcess.ProcessName + ".exe.config"); sw.WriteLine("<?xml version=\"1.0\"?>"); sw.WriteLine("<configuration>"); sw.WriteLine("<startup>"); sw.WriteLine("<supportedRuntime version=\"v4.0\"/>"); sw.WriteLine("</startup>"); sw.WriteLine("<runtime>"); sw.WriteLine("<loadFromRemoteSources enabled=\"true\"/>"); sw.WriteLine("</runtime>"); sw.WriteLine("</configuration>"); sw.Close(); Process.Start(Application.StartupPath + "\\" + tempsProcess.ProcessName + ".exe"); tempsProcess.Kill(); } LangSelection.DropDownStyle = ComboBoxStyle.DropDownList; Others.GetVisualStudioRedistribuable2013(); } catch (Exception ex) { Logging.WriteError("Login > InitializeProgram(): " + ex); } }
private void InitializeProgram() { try { // File .exe.config Process tempsProcess = Process.GetCurrentProcess(); bool restartBot = !Others.ExistFile(Application.StartupPath + "\\" + tempsProcess.ProcessName + ".exe.config"); var sw = new StreamWriter(Application.StartupPath + "\\" + tempsProcess.ProcessName + ".exe.config"); sw.WriteLine("<?xml version=\"1.0\"?>"); sw.WriteLine("<configuration>"); sw.WriteLine(" <startup>"); sw.WriteLine(" <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\"/>"); sw.WriteLine(" </startup>"); sw.WriteLine(" <runtime>"); sw.WriteLine(" <loadFromRemoteSources enabled=\"true\"/>"); sw.WriteLine(" <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">"); sw.WriteLine(" <probing privatePath=\"products\"/>"); sw.WriteLine(" </assemblyBinding>"); sw.WriteLine(" </runtime>"); sw.WriteLine("</configuration>"); sw.Close(); if (restartBot) { Process.Start(Application.StartupPath + "\\" + tempsProcess.ProcessName + ".exe"); tempsProcess.Kill(); } LangSelection.DropDownStyle = ComboBoxStyle.DropDownList; Others.GetVisualStudioRedistribuable2013(); } catch (Exception ex) { Logging.WriteError("Login > InitializeProgram(): " + ex); } }
private void Translate() { try { LangSelection.Items.Clear(); foreach (string l in Others.GetFilesDirectory(Application.StartupPath + "\\Data\\Lang\\", "*.xml")) { Application.DoEvents(); LangSelection.Items.Add(l.Remove(l.Length - 1 - 3)); } string langSelected = "English.xml"; if (Others.ExistFile(Application.StartupPath + "\\Settings\\lang.txt")) { string langTemp = Others.ReadFile(Application.StartupPath + "\\Settings\\lang.txt"); if (!string.IsNullOrEmpty(langTemp)) { if (Others.ExistFile(Application.StartupPath + "\\Data\\Lang\\" + langTemp)) { langSelected = langTemp; } } } if (!nManager.Translate.Load(langSelected)) { return; } LangSelection.Text = langSelected.Remove(langSelected.Length - 1 - 3); LangSelection.SelectedIndexChanged += LangSelection_SelectedIndexChanged; MainHeader.TitleText = nManager.Translate.Get(nManager.Translate.Id.LoginFormTitle) + @" - " + Information.MainTitle; Text = MainHeader.TitleText; Identifier.Text = nManager.Translate.Get(nManager.Translate.Id.LoginFormDefaultIdentifier); Remember.Text = nManager.Translate.Get(nManager.Translate.Id.LoginFormRemember); SetToolTypeIfNeeded(Remember); Register.Text = nManager.Translate.Get(nManager.Translate.Id.LoginFormRegister); SetToolTypeIfNeeded(Register); LoginButton.Text = nManager.Translate.Get(nManager.Translate.Id.LoginFormStart); SetToolTypeIfNeeded(LoginButton); RefreshButton.Text = nManager.Translate.Get(nManager.Translate.Id.LoginFormRefresh); SetToolTypeIfNeeded(RefreshButton); WebsiteLink.Text = nManager.Translate.Get(nManager.Translate.Id.LoginFormWebsite); SetToolTypeIfNeeded(WebsiteLink); ForumLink.Text = nManager.Translate.Get(nManager.Translate.Id.LoginFormForum); SetToolTypeIfNeeded(ForumLink); UseKey.Text = nManager.Translate.Get(nManager.Translate.Id.LoginFormUseKey); SetToolTypeIfNeeded(UseKey); } catch (Exception e) { MessageBox.Show(e.ToString()); } }
private bool forceDownloadTile(string fileName) { lock (_threadLocker) { try { const string stringHttpMapBaseAddress = "http://meshes.thenoobbot.com/"; string stringHttpMap = stringHttpMapBaseAddress + Utility.GetDetourSupportedVersion() + "/"; var continentDir = fileName.Split('\\'); Directory.CreateDirectory(_meshPath + "\\" + continentDir[0] + "\\"); if (!Others.ExistFile(_meshPath + "\\" + fileName)) { Logging.Write("Downloading \"" + fileName + "\"..."); if (!Others.DownloadFile(stringHttpMap + fileName.Replace("\\", "/") + ".gz", _meshPath + "\\" + fileName + ".gz")) { return(false); } if (!GZip.Decompress(_meshPath + "\\" + fileName + ".gz")) { return(false); } if (Others.ExistFile(_meshPath + "\\" + fileName + ".gz")) { File.Delete(_meshPath + "\\" + fileName + ".gz"); } if (Others.ExistFile(_meshPath + "\\" + fileName)) { return(true); } return(false); } return(true); } catch (Exception exception) { Logging.WriteError("forceDownloadTile(string fileName): " + exception); return(false); } } }
private void MainFormOnLoad(object sender, EventArgs e) { try { if (Others.ExistFile(Application.StartupPath + "\\Settings\\.login")) { var strReader = new StreamReader(Application.StartupPath + "\\Settings\\.login", Encoding.Default); try { string text = Others.DecryptString(strReader.ReadLine()); string[] text2 = text.Split('#'); Identifier.Text = text2[0]; Password.Text = text2[1]; Identifier.ForeColor = Color.FromArgb(118, 118, 118); Password.ForeColor = Color.FromArgb(118, 118, 118); if (Identifier.Text != "") { Remember.Checked = true; if (Password.Text == "Password") { UseKey.Checked = true; Password.Hide(); } } } catch { Identifier.Text = ""; Password.Text = ""; Remember.Checked = false; } strReader.Close(); } LoginButton.Enabled = false; RefreshButton.Enabled = false; LoginServer.CheckServerIsOnline(); while (!LoginServer.IsOnlineserver) { Thread.Sleep(10); Application.DoEvents(); Thread.Sleep(50); } LoginServer.CheckUpdate(); LoginButton.Enabled = true; RefreshButton.Enabled = true; RefreshProcessList(); /* Begin AutoStart code */ bool sIdFound = false; if (_autoStarted > 0) { for (int i = 0; i < SessionList.Items.Count; i++) { object item = SessionList.Items[i]; if (item.ToString().Contains(_autoStarted + " -")) { SessionList.SelectedIndex = i; sIdFound = true; break; } } if (sIdFound) { nManagerSetting.ActivateProductTipOff = false; LoginButton_Click(new object(), new EventArgs()); } } /* End AutoStart code */ } catch (Exception ex) { Logging.WriteError("MainFormOnLoad(object sender, EventArgs e): " + ex); } }
private void MainFormOnLoad(object sender, EventArgs e) { try { if (Others.ExistFile(Application.StartupPath + "\\Settings\\.login")) { var strReader = new StreamReader(Application.StartupPath + "\\Settings\\.login", Encoding.Default); try { string text = Others.DecryptString(strReader.ReadLine()); string[] text2 = text.Split('#'); Identifier.Text = text2[0]; Password.Text = text2[1]; Identifier.ForeColor = Color.FromArgb(118, 118, 118); Password.ForeColor = Color.FromArgb(118, 118, 118); if (Identifier.Text != "") { Remember.Checked = true; if (Password.Text == "Password") { UseKey.Checked = true; Password.Hide(); } } } catch { Identifier.Text = ""; Password.Text = ""; Remember.Checked = false; } strReader.Close(); } LoginButton.Enabled = false; RefreshButton.Enabled = false; LoginServer.CheckServerIsOnline(); while (!LoginServer.IsOnlineserver) { Thread.Sleep(30); Application.DoEvents(); } LoginServer.CheckUpdate(); LoginButton.Enabled = true; RefreshButton.Enabled = true; RefreshProcessList(); /* Begin AutoStart code */ bool sIdFound = false; if (_autoStarted > 0) { for (int i = 0; i < SessionList.Items.Count; i++) { Application.DoEvents(); object item = SessionList.Items[i]; if (item.ToString().Contains(_autoStarted + " -")) { SessionList.SelectedIndex = i; sIdFound = true; break; } } if (sIdFound) { nManagerSetting.ActivateProductTipOff = false; LoginButton_Click(new object(), new EventArgs()); } } /*Process.Start("https://goo.gl/TtMsEh");*/ //else // MessageBox.Show(@"Blizzard is currently very active in the Anti-Bot fight and it may not be wise to use the bot at that very moment in time.", @"WARNING / ATTENTION / ARTUNG / внимание / 注意"); /* End AutoStart code */ } catch (Exception ex) { Logging.WriteError("MainFormOnLoad(object sender, EventArgs e): " + ex); } }