Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

onResponseCode

Featured Replies

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?

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

 

  • Author
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!

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.