Jump to content

onResponseCode


sudoinit6

Recommended Posts

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?

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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