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.

...ForName(java.lang.String... names)

Featured Replies

As Maxi mentioned here, it is always better to use names. I was wondering if it was possible to add the following methods:

 

Bank

contains(java.lang.String... names)
getAmount(java.lang.String... names)

Inventory

getAmount(java.lang.String... names)
isEmptyExcept(java.lang.String... names) 

I am sure there are others, but these are the ones that I noticed when I was trying to find a similar version.

Edited by BotRs123

  • Author

woah what's with the naming

just contains(String name)

That has been the naming for MethodsProvider, so I just went with it.

  • Author

Strings are slower, f that xd

I only requested this because of what Maxi said. Now I am debating to change some of the scripts back to using ints instead.

I see only one point in adding into the API.

But, i think it better for the script writer to make there own. Those method take less then 1 min to make each.

Strings are a lot slower but a lot more reliable for stability.  Because if Jagex decides to change some ids it won't affect the scripts who use Strings.

public Item nameContains(String name) {
        for (Item item : client.getInventory().getItems()) {
            if (item.getName().contains(name)) {
                return item;

            }
        }
        return null;
    }

Strings are slower, f that xd

I haven't checked for myself, but in the update to revision 16 of Oldschool RS there were id changes, this makes names more accurate.

public Item nameContains(String name) {

        for (Item item : client.getInventory().getItems()) {

            if (item.getName().contains(name)) {

                return item;

            }

        }

        return null;

    }

final tongue.png

 

for Bank.contains

just use a filter that accepts the given names.

Edited by Rawr

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.