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.

Some banking methods

Featured Replies

The OSBot methods are slow and unreliable so I wrote my own. Thanks to @TheScrub for cluing me in on what interface in the bank had the items! smile.png

public boolean bankContains(int item) {
	for (Item i : sI.client.getInterface(12).getItems(6)) {
		if (i != null && i.getId() == item) {
			return true;
		}
	}
	return false;
}

public boolean bankContains(String item) {
	for (Item i : sI.client.getInterface(12).getItems(6)) {
		if (i != null && i.getName().equalsIgnoreCase(item.toLowerCase())) {
			return true;
		}
	}
	return false;
}

public boolean rightClickBankItem(int item) throws InterruptedException {
	if (!bankContains(item)) {
		return false;
	}
	int slot = sI.client.getBank().getSlotForId(item);
	if (!sI.client.getBank().isSlotVisible(slot)) {
		sI.client.getBank().scrollToSlot(slot);
	}
	Rectangle rect = sI.client.getBank().getAbsoluteSlotPosition(slot);
	sI.client.moveMouseTo(new RectangleDestination((int) rect.getX(), (int) rect.getY(), (int) rect.getWidth(), (int) rect.getHeight()), false, true, true);
	return sI.client.isMenuOpen();
}

public boolean rightClickBankItem(String item) throws InterruptedException {
	if (!bankContains(item)) {
		return false;
	}
	int slot = sI.client.getBank().getSlotForId(sI.client.getBank().getItemForName(item).getId());
	if (!sI.client.getBank().isSlotVisible(slot)) {
		sI.client.getBank().scrollToSlot(slot);
	}
	Rectangle rect = sI.client.getBank().getAbsoluteSlotPosition(slot);
	sI.client.moveMouseTo(new RectangleDestination((int) rect.getX(), (int) rect.getY(), (int) rect.getWidth(), (int) rect.getHeight()), false, true, true);
	return sI.client.isMenuOpen();
}

public boolean selectOpenMenuOption(String option) throws InterruptedException {
	if (sI.client.isMenuOpen()) {
		List<Option> options = sI.client.getMenu();
		for (int i= 0; i < options.size(); i++) {
			if (options.get(i).action.equalsIgnoreCase(option.toLowerCase())) {
				return sI.client.moveMouse(new RectangleDestination(sI.client.getMenuX(), sI.client.getMenuY()+19+(i*15), sI.client.getMenuWidth(), 15), false);
			}
		}
	}
	return false;
}

public boolean withdraw(int id, int amount) throws InterruptedException {
	if (!bankContains(id)) {
		return false;
	}
	if (rightClickBankItem(id)) {
		if (sI.client.isMenuOpen()) {
			List<Option> options = sI.client.getMenu();
			for (int i= 0; i < options.size(); i++) {
				if (options.get(i).action.equalsIgnoreCase("withdraw-" + amount)) {
					return sI.client.moveMouse(new RectangleDestination(sI.client.getMenuX(), sI.client.getMenuY()+19+(i*15), sI.client.getMenuWidth(), 15), false);
				}
				else if (options.get(i).action.equalsIgnoreCase("withdraw-x")) {
					sI.client.moveMouseTo(new RectangleDestination(sI.client.getMenuX(), sI.client.getMenuY()+21+i*14, sI.client.getMenuWidth(), 10), false, true, false);
					sI.sleep(MethodProvider.random(615, 963));
					sI.client.typeString(Integer.toString(amount));
					return true;
				}
			}
		}
	}
	return false;
}

public boolean withdraw(String name, int amount) throws InterruptedException {
	if (!bankContains(name)) {
		return false;
	}
	if (rightClickBankItem(name)) {
		if (sI.client.isMenuOpen()) {
			List<Option> options = sI.client.getMenu();
			for (int i= 0; i < options.size(); i++) {
				if (options.get(i).action.equalsIgnoreCase("withdraw-" + amount)) {
					return sI.client.moveMouseTo(new RectangleDestination(sI.client.getMenuX(), sI.client.getMenuY()+21+i*14, sI.client.getMenuWidth(), 10), false, true, false);
				}
				else if (options.get(i).action.equalsIgnoreCase("withdraw-x")) {
					sI.client.moveMouse(new RectangleDestination(sI.client.getMenuX(), sI.client.getMenuY()+19+(i*15), sI.client.getMenuWidth(), 15), false);
					sI.sleep(MethodProvider.random(615, 963));
					sI.client.typeString(Integer.toString(amount));
					return true;
				}
			}
		}
	}
	return false;
}

Edited by Swizzbeat

How would this be used?

 

sike idc i dont code

Edited by Ricky

How would this be used?

 

sike idc i dont code

 

Then why the hell are you even posting?

 

OT:

 

Great methods.  Mine look similar for my fast actions with banking/items

the problem with osbot's banking is the scrolling yet here you continue to use osbot's scrolling..

 

not h8ing just saying nothing will change with this

Edited by zScripz

  • Author

the problem with osbot's banking is the scrolling yet here you continue to use osbot's scrolling..

 

not h8ing just saying nothing will change with this

I've never had an issue with it O_o but I could rewrite it, what would you change?

I've never had an issue with it O_o but I could rewrite it, what would you change?

It only searches for items below the current point it is at if it gets to low in the bank, so basically it won't go up :P

  • Author

It only searches for items below the current point it is at if it gets to low in the bank, so basically it won't go up tongue.png

Weird, I've been using this and it works just fine scrolling both up and down! Maybe it's just been luck :p

Weird, I've been using this and it works just fine scrolling both up and down! Maybe it's just been luck tongue.png

Hmm let me try :P I'll tell you. Could be that I'm just withdrawing too many items too

  • Author

Hmm let me try tongue.png I'll tell you. Could be that I'm just withdrawing too many items too

You might get a bug where it will miss-click the option, I have that fixed in the local version I'm using but still have to update the one here :p it's just a small miscalculation of the option rectangle.

2 things,

1. You need to use absoluteSlotPosition

2. It withdraws stuff really fast :P

 

 

But anyways thanks for this! Used this as a base for my own bank api :P

  • Author

2 things,

1. You need to use absoluteSlotPosition

2. It withdraws stuff really fast tongue.png

 

 

But anyways thanks for this! Used this as a base for my own bank api tongue.png

Yeah I changed that in my local version! But the mouse destination in this snippet is actually wrong and will missclick sometimes, here's the updated one:

sI.client.moveMouse(new RectangleDestination(sI.client.getMenuX(), sI.client.getMenuY()+19+(i*15), sI.client.getMenuWidth(), 15), false);
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.