private void StartBot_Click(object sender, RoutedEventArgs e) { UpdateUI(); UpdateConfig(); bool HWIDCheck = false; bool LoginCheck = false; string uname = Properties.Settings.Default.username; string pword = Properties.Settings.Default.password; Task HWIDChecker = new Task(() => { HWIDCheck = Functions.Authentication.LoginHandler.CheckHWID(Properties.Settings.Default.username); }); LoginCheck = Functions.Authentication.LoginHandler.CheckLogin(uname, pword); HWIDChecker.Start(); Thread.Sleep(10000); Console.WriteLine(LoginCheck); Console.WriteLine(HWIDCheck); if (LoginCheck && HWIDCheck) { Main.LogConsole("Connected Successfully"); BotMain.BotStart(); } else { MessageBox.Show("Invalid"); Main.LogConsole("Unable to Connect to Server..."); Main.LogConsole("Shutting Down..."); Thread.Sleep(5); Application.Current.Shutdown(); } }