private void ErrorHandling() { if (ErrorDialog.IsVisible) { // Check if Demonbuddy found errordialog if (!handlederror) { Send("CheckConnection", pause: true); handlederror = true; } else { handlederror = false; ErrorDialog.Click(); bootTo(); } } else if (UIElementTester.isValid(_UIElement.errordialog_okbutton)) { // Demonbuddy failed to find error dialog use static hash to find the OK button Send("CheckConnection", pause: true); UIElement.FromHash(_UIElement.errordialog_okbutton).Click(); bootTo(); } else { handlederror = false; if (UIElementTester.isValid(_UIElement.loginscreen_username)) { // We are at loginscreen Send("CheckConnection", pause: true); } } }
private void ErrorHandling() { if (ErrorDialog.IsVisible) { // Check if Demonbuddy found errordialog if (!_handlederror) { Send(ControlRequest.CheckConnection); _handlederror = true; } else { _handlederror = false; ErrorDialog.Click(); CheckForLoginScreen(); } } if (UIElementTester.IsValid(UIElement.ErrorDialogOkButton)) { // Demonbuddy failed to find error dialog use static hash to find the OK button Send(ControlRequest.CheckConnection); Zeta.Game.Internals.UIElement.FromHash(UIElement.ErrorDialogOkButton).Click(); CheckForLoginScreen(); } _handlederror = false; if (UIElementTester.IsValid(UIElement.LoginScreenUsername)) { // We are at loginscreen Send(ControlRequest.CheckConnection); } }
internal void ErrorClickerWorker() { do { Thread.Sleep(DefaultSleepTime); bool InGame = false; try { using (ZetaDia.Memory.AcquireFrame()) { InGame = ZetaDia.IsInGame; } } catch (Exception) { DBLog.Debug("[ErrorClicker] Safely Handled IsInGame Exception!"); } if (InGame) { try { using (ZetaDia.Memory.AcquireFrame()) { if (ErrorDialog.IsVisible) { if (ErrorDialog.ErrorCode == -1) { HadDisconnectError = true; } DBLog.Debug("[ErrorClicker] Closing error " + ErrorDialog.ErrorCode.ToString()); ErrorDialog.Click(); } //else if(BotMain.ExecutionStateAvailable) //{ UIElement OkButton; if (UIElement.IsValidElement(0xB4433DA3F648A992) && (OkButton = UIElement.FromHash(0xB4433DA3F648A992)) != null) { if (OkButton.IsValid && OkButton.IsVisible && OkButton.IsEnabled) { DBLog.Info("[ErrorClicker] Closing unhandled error"); OkButton.Click(); } } //} } } catch (Exception) { } } } while (true); }