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.

Banking api ~ almost finished

Featured Replies

need to make scrolling methods

public boolean bankIsOpen() {
		if (script.client.getInterface(12) != null) {
			RS2InterfaceChild c = getChild(12,21);
			if (c != null && c.isVisible()) {
				return true;
			}
		}
		return false;
	}
	
	private RS2InterfaceChild getChild(int parent, int child) {
		if (script.client.getInterface(parent) != null) {
			RS2InterfaceChild c = script.client.getInterface(parent).getChild(
					child);
			if (c != null && c.isVisible()) {
				return c;
			}
		}
		return null;
	}

	public int getScrollHeight() {
		if (!bankIsOpen()) {
			return -1;
                        }
				return getChild(12, 6).getScrollPosition();

	}

	public int getColumn(int slot) {
		return slot / 8;
	}

	public int getRow(int slot) {
		return slot % 8;
	}



        // you can view the first 6 columns at the height of 0
	public int getMinScrollHeightNeeded(int slot) {
		return getColumn(slot) > 5 ? (getColumn(slot) - 5) * 37 : 0;
	}

	public int getMaxScrollHeightNeeded(int slot) {
		return getMinScrollHeightNeeded(slot) + (37 * 5);
	}

	public boolean slotVisable(int slot) {
		return (getScrollHeight() >= getMinScrollHeightNeeded(slot) && getScrollHeight() <= getMaxScrollHeightNeeded(slot));
	}

	public boolean needToScrollUp(int slot) {
		return !slotVisable(slot)
				&& getScrollHeight() > getMaxScrollHeightNeeded(slot);
	}

	public boolean needToScrollDown(int slot) {
		return !slotVisable(slot)
				&& getScrollHeight() < getMinScrollHeightNeeded(slot);
	}

	public boolean needToScroll(int slot) {
		return needToScrollDown(slot) || needToScrollUp(slot);
	}

    public boolean contains(String item) {
        Item[] items = getBankItems();
        if (items != null && items.length > 0) {
            for (Item i : items) {
                if (i != null && i.getName() != null
                        && i.getName().equalsIgnoreCase(item)) {
                    return true;
                }
            }
        }
        return false;
    }

    public boolean contains(int item) {
        Item[] items = getBankItems();
        if (items != null && items.length > 0) {
            for (Item i : items) {
                if (i != null && i.getId() > 0 && i.getId() == item) {
                    return true;
                }
            }
        }
        return false;
    }

    public int getSlotForName(String name) {
        if (bankIsOpen()) {
            Item[] array = getBankItems();
            for (int i = 0; i < array.length; i++) {
                if (array[i] != null) {
                    if (array[i].getName() != null) {
                        if (array[i].getName().equalsIgnoreCase(name)) {
                            return i;
                        }
                    }
                }
            }
        }
        return -1;
    }

Edited by TheScrub

  • Author

why you remade the banking API?

 

i don't like the scrolling so i'm going to make it not fail scrolling but it's going to click the little buttons so it will be alil slow

i don't like the scrolling so i'm going to make it not fail scrolling but it's going to click the little buttons so it will be alil slow

Why not just use the mouse wheel?

  • Author

You should just add in a search method

 

good idea but also this will be a good open source to teach people how to use scroll bars in relation to runescape this can be useful for other stuff

  • Author

Why not just use the mouse wheel?

 

smart but i just relised you can easily use math to click along the to the correct spot..

 

6C2Se.png

smart but i just relised you can easily use math to click along the to the correct spot..

 

6C2Se.png

 

ive been knowing that, but that just make you look like a straight bot

ive been knowing that, but that just make you look like a straight bot

 

You can find the min and max numbers to be able to see each row in the bank and then randomise it so the row you want can come out on the top, around the middle or at the bottom. That isn't botlike at all. I actually do this in a lot of my scripts with the timings between actions, walking coordinate randomisation, delay between opening bank and using it, etc.

But the fact that you supposedly know where all your items are at in the bank, does seem bot like. no matter how many randomize sleep you take. But on the other hand if you search for a item it reduces the fact that you look like a bot :D

Guest
This topic is now closed to further replies.

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.