Skip 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.

Filter interface and methods

Featured Replies

interface Filter<T> {
    public abstract boolean isValid(final T param);
}

This feature is necessary because otherwise if I want to get some objects by name and some objects by ID and make a list, I have to do those calls separately and then intersect the resulting sets to create a final set containing the results of both calls.

 

This feature would simplify the above example down to

final Filter<PrimaryObject> objFilter = new Filter<PrimaryObject>() {
    private final String[] names = { "booth" };
    private final int[] ids = { 1234 };
 
    @Override
    public boolean isValid(final PrimaryObject obj) {
        for (final String name : names) {
            if (obj.getName().toLowerCase().contains(name)) {
                return true;
            }
        }
 
        for (final int id : ids) {
            if (obj.getId() == id) {
                return true;
            }
        }
 
        return false;
    }
};
 
List<PrimaryObjects> objs = getPrimaryObjects(obFilter);

Hopefully scripters would implement a more time efficient isValid method if they call this often. This is purely an example.

 

MethodProvider#getPrimaryObjects(Filter<PrimaryObject> filter);Ljava/util/List<Lorg/osbot/script/rs2/model/PrimaryObject>

Edited by Bit

Implementation can be done without API... Then why include it?

Implementation can be done without API... Then why include it?

 

What a stupid statement.

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.