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.

Bank withdraw methods

Featured Replies

~Hopefully this could make us look less like a bot.~

 

i made a couple of bank methods that contains

 

  • withdraw-(last amount) Both item id and item name.
  • deposit Inventory tab.
  • deposit worn item tab.

only method you need to use are 

  • withdrawAmount(int itemId, int amount);
  • withdrawAmount(String itemName, int amount);
  • depositInventory();
  • depositEquipments();

 

link

http://pastebin.com/j9ngMFDB

 

source code:

	public boolean withdrawAmount(int itemId, int amount) throws InterruptedException	{	
	int slot = this.client.getBank().getSlotForId(itemId);
	Rectangle rec = client.getBank().getAbsoluteSlotPosition(slot);
        MouseDestination des = new RectangleDestination((int)rec.getMinX(), (int)rec.getMinY(), 30, 30);
        MouseDestination selection = new RectangleDestination(this.client.getMenuX(), this.client.getMenuY()+65, this.client.getMenuWidth(), 10);
        
		if (!client.getBank().isOpen())	{
			return false;
		}else{
			if (!client.getBank().contains(itemId))	{
				return false;
			}else{
				if (!client.getBank().isSlotVisible(slot))	{
					this.client.getBank().scrollToSlot(slot);
				}else{
					if (!client.isMenuOpen())	{
						this.client.moveMouseTo(des, false, true, true);
					}else{
						if (client.getMenu() != null)	{
							if (hasOption("withdraw-"+amount))	{
								return this.client.moveMouseTo(selection, false, true, false);
							}else{
								//fix this, mouse move off of screen, withdraw x too fast, add a wait for interface.
								return this.client.getBank().withdrawX(itemId, amount);
							}
						}
					}
				}
			}
		}
		return false;	
	}

	public boolean withdrawAmount(String itemName, int amount)	throws InterruptedException{
	int slot = this.client.getBank().getSlotForId(getIdOfItemName(itemName));
	Rectangle rec = client.getBank().getAbsoluteSlotPosition(slot);
        MouseDestination des = new RectangleDestination((int)rec.getMinX(), (int)rec.getMinY(), 30, 30);
        MouseDestination selection = new RectangleDestination(this.client.getMenuX(), this.client.getMenuY()+65, this.client.getMenuWidth(), 10);
        
		if (!client.getBank().isOpen())	{
			return false;
		}else{
			if (!client.getBank().contains(itemName))	{
				return false;
			}else{
				if (!client.getBank().isSlotVisible(slot))	{
					this.client.getBank().scrollToSlot(slot);
				}else{
					if (!client.isMenuOpen())	{
						this.client.moveMouseTo(des, false, true, true);
					}else{
						if (client.getMenu() != null)	{
							if (hasOption("withdraw-"+amount))	{
								return this.client.moveMouseTo(selection, false, true, false);
							}else{
								//fix this, mouse move off of screen, withdraw x too fast, add a wait for interface.
								return this.client.getBank().withdrawX(getIdOfItemName(itemName), amount);
							}
						}
					}
				}
			}
		}
		
		return false;
	}

	public boolean hasOption(String option){
        for (int i = 0; i < client.getMenuCount(); i++){
            if (client.getMenu().get(i).action.equalsIgnoreCase(option))	{
            	return true;
            }
        }
        return false;
    }
	
	public int getIdOfItemName(String name) {
        for (Item item : client.getBank().getItems()) {
                if (item != null && item.getName().equalsIgnoreCase(name)) {
                        return item.getId();
                }
        }
        return -1;
	}
	
	public boolean depositInventory() throws InterruptedException	{
        MouseDestination des = new RectangleDestination(426,288,33,33);
		
		if (!client.getBank().isOpen())	{
			return false;
		}else{
			if (!client.getInventory().isEmpty())	{
				return this.client.moveMouseTo(des, false, true, false);
			}else{
				log("You inventory is empty");
				return true;
			}
		}
	}
	
	public boolean depositEquipments() throws InterruptedException	{
        MouseDestination des = new RectangleDestination(463,288,33,33);
		
        if (!client.getBank().isOpen())	{
        	return false;
        }else{
	        if (equipmentTab.isWearingItem(EquipmentSlot.AMULET)|| equipmentTab.isWearingItem(EquipmentSlot.ARROWS)|| equipmentTab.isWearingItem(EquipmentSlot.CAPE)|| equipmentTab.isWearingItem(EquipmentSlot.CHEST)|| equipmentTab.isWearingItem(EquipmentSlot.FEET)||equipmentTab.isWearingItem(EquipmentSlot.HANDS)|| equipmentTab.isWearingItem(EquipmentSlot.HAT)|| equipmentTab.isWearingItem(EquipmentSlot.LEGS)|| equipmentTab.isWearingItem(EquipmentSlot.RING)|| equipmentTab.isWearingItem(EquipmentSlot.SHIELD)|| equipmentTab.isWearingItem(EquipmentSlot.WEAPON))	{
	        	return client.moveMouseTo(des, false, true, false);
	        }else{
	        	log("Your not wearing anything");
	        	return true;
	        }
        }
	} 

 

Depending on the community, i might add more methods like:

  • search tab
  • withdraw-all-but-one

 

 

credits to @Pain: for helping me with menu contains string method

Edited by josedpay

  • Author

Looks great, these could come in a lot of use for me! Thank you QwPha8E.png

your welcome

Nice

One thing tho instead of checking isWearning items

Try check if the #getItems is not null or empty(length of array is 0)

Why does it matter whether or not you're wearing anything? You could have saved typing out that horrendously long series of OR's..

You could have saved time writing all those conditions for checking if their wearing equipment in each slot. Just have it iterate through the array of equipment slots.

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.