sudoinit6 Posted February 2, 2018 Author Share Posted February 2, 2018 35 minutes ago, Lemons said: So your mistake is thinking ResponseCode.isDisabledError knows the response code. It does not, it only checks the given response code (and your always giving 4 and 18, so its always true on any response code). Simple misunderstanding, those have bit all of us in the ass at some point. That makes perfect sense. Thanks again for your help. Quote Link to comment Share on other sites More sharing options...
Lemons Posted February 2, 2018 Share Posted February 2, 2018 5 minutes ago, sudoinit6 said: That makes perfect sense. Thanks again for your help. No problem, you can always add me on skype or discord (handles in profile) if you want to shoot questions at me. Always willing to help someone who is willing to learn Quote Link to comment Share on other sites More sharing options...
sudoinit6 Posted February 3, 2018 Author Share Posted February 3, 2018 (edited) With lemon's help I found a way to make it work without a custom login handler, at least well enough to suit my needs here is what I did: Spoiler @Override public void onResponseCode(int responseCode) throws InterruptedException { if (ResponseCode.isDisabledError(responseCode)) { log("Account locked"); try { log("trying to create text file."); PrintWriter writer = new PrintWriter( "/root/OSBot/Data/lockedAccounts.txt", "UTF-8"); writer.println("FIGJAM"); writer.close(); } catch (IOException e) { log("creating text file failed"); // TODO Auto-generated catch block e.printStackTrace(); System.exit(0); } System.exit(0); }if (ResponseCode.isConnectionError(responseCode)){ log("login failed"); try { log("trying to create text file."); PrintWriter writer = new PrintWriter( "/root/OSBot/Data/failedLogin.txt", "UTF-8"); writer.println("FIGJAM"); writer.close(); } catch (IOException e) { log("creating text file failed"); // TODO Auto-generated catch block e.printStackTrace(); System.exit(0); } } } } What this does is write one file if the error type is disable error but a different file if it is a connection error (although I don't really need to write the second file). Before it was executing my code on any error because I was passing thorough something that would always match. With this code it checks to see what kind of code it is, if it isn't a disabled code, it doesn't execute my instructions in the first section (which include an exit) and moves to the second. Since the second doesn't include an exit, the default login handler handles it like a normal connection error and waits 17 seconds to try again. Hopefully someone else can find use out of this. Thanks Alek and lemons! Edited February 3, 2018 by sudoinit6 Quote Link to comment Share on other sites More sharing options...