sudoinit6 Posted May 20, 2017 Posted May 20, 2017 I have some code in my script that creates a file when accounts get locked. I have another process that checks for that file every 5 minutes and if it finds it, it closes OSBot, bounces my proxy so it gets a new IP then creates new accounts and launches new bots. The problem I am having is that the code doesn't seem to differentiate between different login failures. Here is what I have: @Override public void onResponseCode(int responseCode) throws InterruptedException { if (ResponseCode.isDisabledError(18)) { log("Account locked, creating text file."); try { PrintWriter writer = new PrintWriter( "//$OSBotPath//data//AccountLocked.txt", "UTF-8"); writer.println("WhateverText"); writer.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } Occasionally I will have a network error and in the logs the response code is -2 but this bit of code executes on ANY login failure. I have tried adding code using: if (ResponseCode.isDisabledError(-2)) { But it doesn't seem to matter what integer I put in the code, it activates all of them on any failure. Ideally I would like to perform one action if it is -2 and a different action if it is 18 but I can't seem to get it to work, anyone have experience in thios area?
scape Posted May 20, 2017 Posted May 20, 2017 51 minutes ago, sudoinit6 said: I have some code in my script that creates a file when accounts get locked. I have another process that checks for that file every 5 minutes and if it finds it, it closes OSBot, bounces my proxy so it gets a new IP then creates new accounts and launches new bots. The problem I am having is that the code doesn't seem to differentiate between different login failures. Here is what I have: @Override public void onResponseCode(int responseCode) throws InterruptedException { if (ResponseCode.isDisabledError(18)) { log("Account locked, creating text file."); try { PrintWriter writer = new PrintWriter( "//$OSBotPath//data//AccountLocked.txt", "UTF-8"); writer.println("WhateverText"); writer.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } Occasionally I will have a network error and in the logs the response code is -2 but this bit of code executes on ANY login failure. I have tried adding code using: if (ResponseCode.isDisabledError(-2)) { But it doesn't seem to matter what integer I put in the code, it activates all of them on any failure. Ideally I would like to perform one action if it is -2 and a different action if it is 18 but I can't seem to get it to work, anyone have experience in thios area? isDisabled includes both a ban and lock. If youre having a problem do this: if (responseCode == #)
sudoinit6 Posted May 20, 2017 Author Posted May 20, 2017 8 minutes ago, scape said: isDisabled includes both a ban and lock. If youre having a problem do this: if (responseCode == #) Aha! I will give that a try, thanks!