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.

Withdraw without scrolling bug

Featured Replies


public boolean withdrawX(int itemID, int amount) throws InterruptedException {

if(!client.getBank().isOpen() || !client.getBank().contains(itemID)) {

return false;

}

int firstVisibleSlot = -1;

int lastVisibleSlot = -1;

int itemSlot = client.getBank().getSlotForId(itemID);

if(!client.getBank().isSlotVisible(itemSlot)) {

for(int i = 0; i < 1000; i++) {

if(firstVisibleSlot == -1 && client.getBank().isSlotVisible(i)) {

firstVisibleSlot = i;

} else if(firstVisibleSlot != -1 && !client.getBank().isSlotVisible(i)) {

lastVisibleSlot = i - 1;

break;

}

}

if(itemSlot >= firstVisibleSlot && itemSlot <= lastVisibleSlot) {

//Visible //No Scrolling!

} else {

//Invisible //Scrolling!

if(itemSlot < firstVisibleSlot) {

//Scrolling up!

MouseDestination md = new RectangleDestination(new Rectangle(481, 60, 12, 12));

client.moveMouse(md, true);

while(!client.getBank().isSlotVisible(itemSlot)) {

client.clickMouse(false);

}

} else if(itemSlot > lastVisibleSlot) {

//Scrolling down!

MouseDestination md = new RectangleDestination(new Rectangle(481, 272, 12, 12));

client.moveMouse(md, true);

while(!client.getBank().isSlotVisible(itemSlot)) {

client.clickMouse(false);

}

}

}

}

return client.getBank().withdrawX(itemID, amount);

}


public boolean withdrawAll(int itemID) throws InterruptedException {

if(!client.getBank().isOpen() || !client.getBank().contains(itemID)) {

return false;

}

int firstVisibleSlot = -1;

int lastVisibleSlot = -1;

int itemSlot = client.getBank().getSlotForId(itemID);

if(!client.getBank().isSlotVisible(itemSlot)) {

for(int i = 0; i < 1000; i++) {

if(firstVisibleSlot == -1 && client.getBank().isSlotVisible(i)) {

firstVisibleSlot = i;

} else if(firstVisibleSlot != -1 && !client.getBank().isSlotVisible(i)) {

lastVisibleSlot = i - 1;

break;

}

}

if(itemSlot >= firstVisibleSlot && itemSlot <= lastVisibleSlot) {

//Visible //No Scrolling!

} else {

//Invisible //Scrolling!

if(itemSlot < firstVisibleSlot) {

//Scrolling up!

MouseDestination md = new RectangleDestination(new Rectangle(481, 60, 12, 12));

client.moveMouse(md, true);

while(!client.getBank().isSlotVisible(itemSlot)) {

client.clickMouse(false);

}

} else if(itemSlot > lastVisibleSlot) {

//Scrolling down!

MouseDestination md = new RectangleDestination(new Rectangle(481, 272, 12, 12));

client.moveMouse(md, true);

while(!client.getBank().isSlotVisible(itemSlot)) {

client.clickMouse(false);

}

}

}

}

return client.getBank().withdrawAll(itemID);

}

Edited by Soldtodie

Thanks for releasing this :)

I think this could help (night-time 'throw-together'):

public static RectangleDestination getScrollerDes(Script script, int id) {

		if (!script.client.getBank().isOpen()
				|| !script.client.getBank().contains(id))
			return null;

		int i = 0;

		for (Item next : script.client.getBank().getItems())
			if (next != null && next.getId() == id)
				break;
			else
				i++;

		i /= 2;

		return new RectangleDestination(new Rectangle(480, 68 + i, 15, 4));
	}

Edited by liverare

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.