private void Connect() { if (connectCheck) { if (!needConnect) { if (WB_Main.Url.ToString() == "https://heroes-wow.com/wotlk/index.php?page=login") { TM_ConnectedCheck.Start(); } else if (WB_Main.Url.ToString() == "https://heroes-wow.com/wotlk/index.php" && TM_ConnectedCheck.Enabled) { connectCheck = false; TM_ConnectedCheck.Stop(); BT_EnableDisable.Enabled = true; LBL_Status.Text = "Ready !"; Log("He is ! Ready."); if (voting) { Vote(true); } else if (Array.Exists(Environment.GetCommandLineArgs(), arg => arg == "/enabled")) { EnableDisable(); } } } else if (needConnect && WB_Main.Url.ToString() == "https://heroes-wow.com/wotlk/index.php?page=loginb") { connectCheck = false; MessageBox.Show("Connection successfull !"); needConnect = false; ((Control)WB_Main).Enabled = false; BT_EnableDisable.Enabled = true; LBL_Status.Text = "Ready !"; if (voting) { Vote(true); } else if (Array.Exists(Environment.GetCommandLineArgs(), arg => arg == "/enabled")) { EnableDisable(); } } } }
private void TM_ConnectedCheck_Tick(object sender, EventArgs e) { TM_ConnectedCheck.Stop(); Log("He isn't. Prompting user to log in."); if (WindowState == FormWindowState.Minimized) { NTI_Main.Visible = false; Show(); WindowState = FormWindowState.Normal; } MessageBox.Show("Please connect to Heroes-WoW's website."); LBL_Status.Text = "Waiting for connection..."; needConnect = true; ((Control)WB_Main).Enabled = true; WB_Main.Navigate("https://heroes-wow.com/wotlk/index.php?page=login"); }