Jump to content

onResponseCode


Recommended Posts

Posted

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?

Posted
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 == #)

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...