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.

How to detect finished to connecting to update server?

Featured Replies

getBot().isLoaded() return true when is black screen appears.

ueIn5YB.png

 

 

How to detect this when I use cli with -allow norandoms

9JlHXI6.png

 

 

Edited by Pegasus

 

I use Tasks in my code so verify is essentially how I check if I should attempt to log in

 

@Override
    public boolean verify() {
        return getLobbyButton() != null || !isLoggedIn();
    }

private RS2Widget getLobbyButton() {

        RS2Widget button = null;
        try {
            button = script.getWidgets().getWidgetContainingText("CLICK HERE TO PLAY");
        }
        catch (NullPointerException e) {
            script.log(e);
        }
        return button;
    }

public boolean isLoggedIn() {
        return isHopping() ||
                script.getClient().getLoginStateValue() == 30 ||
                script.getClient().isLoggedIn();
    }
 public boolean isHopping() {
        return script.getClient().getLoginStateValue() == 45 ||
                script.getClient().getLoginStateValue() == 25;
    }
 

Edited by HunterRS

  • Author
14 minutes ago, HunterRS said:

 

I use Tasks in my code so verify is essentially how I check if I should attempt to log in

 


@Override
    public boolean verify() {
        return getLobbyButton() != null || !isLoggedIn();
    }

private RS2Widget getLobbyButton() {

        RS2Widget button = null;
        try {
            button = script.getWidgets().getWidgetContainingText("CLICK HERE TO PLAY");
        }
        catch (NullPointerException e) {
            script.log(e);
        }
        return button;
    }

public boolean isLoggedIn() {
        return isHopping() ||
                script.getClient().getLoginStateValue() == 30 ||
                script.getClient().isLoggedIn();
    }
 public boolean isHopping() {
        return script.getClient().getLoginStateValue() == 45 ||
                script.getClient().getLoginStateValue() == 25;
    }
 

Thanks.<3

It works.

How do you know what do the values of getLoginStateValue() represent?

 

Pretty sure I just tested them out by logging them.

Might be documented someplace though.

12 hours ago, Pegasus said:

Thanks.<3

It works.

How do you know what do the values of getLoginStateValue() represent?

 

https://osbot.org/api/org/osbot/rs07/api/Client.html#getLoginStateValue-- has the following values:

Quote

10 = Logged out 20 = Loading please wait... 30 = Logged in

However @HunterRS's code suggests that there's more you'd be able to find by testing.

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.