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.

Simple Deadman Mode Safe Deposit Box API (minimal)

Featured Replies

Written for lem0n api but you can easily change the imports and TaskScript to Script.

import org.osbot.rs07.api.def.ItemDefinition;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.utility.ConditionalSleep;

import lemons.api.script.TaskScript;

public class SafeDepositBox {

	private TaskScript script;
	private Area bank;

	public SafeDepositBox(TaskScript script, Area bank) {
		this.script = script;
		this.bank = bank;
	}

	public boolean isOpen() {
		RS2Widget openWidget = script.getWidgets().get(230, 4, 1);
		if (openWidget != null) {
			return true;
		}
		return false;
	}

	public boolean openBox() {
		NPC wizard = script.getNpcs().closest("Financial Wizard");
		if (wizard != null && !isOpen() && bank.contains(script.myPlayer())) {
			wizard.interact("Deposit-box");
			new ConditionalSleep(1500, 2000) {
				public boolean condition() {
					return isOpen();
				}
			}.sleep();
			return true;
		}
		script.log("Not in bank! Unable to interact with financial wizard!");
		return false;
	}

	public boolean closeBox() {
		RS2Widget closeWidget = script.getWidgets().get(230, 4, 13);
		if (closeWidget != null && isOpen()) {
			closeWidget.interact("Close");
			new ConditionalSleep(1500, 2000) {
				public boolean condition() {
					return !isOpen();
				}
			}.sleep();
		}
		return true;
	}

	public boolean depositAll() {
		RS2Widget depositAllWidget = script.getWidgets().get(230, 10);
		long freeInventCount = script.getInventory().getEmptySlots();
		if (depositAllWidget != null) {
			depositAllWidget.interact("Deposit inventory");
			new ConditionalSleep(1500, 2000) {
				public boolean condition() {
					return script.getInventory().getEmptySlots() > freeInventCount;
				}
			}.sleep();
		}
		return true;
	}

	public boolean depositAllWorn() {
		RS2Widget depositAllWornWidget = script.getWidgets().get(230, 11);
		long freeInventCount = script.getInventory().getEmptySlots();
		if (depositAllWornWidget != null) {
			depositAllWornWidget.interact("Deposit worn items");
			new ConditionalSleep(1500, 2000) {
				public boolean condition() {
					return script.getInventory().getEmptySlots() > freeInventCount;
				}
			}.sleep();
		}
		return true;
	}

	public boolean withdrawOne(String itemName) {
		RS2Widget containerParentWidget = script.getWidgets().get(230, 5);
		if (containerParentWidget != null) {
			for (RS2Widget child : containerParentWidget.getChildWidgets()) {
				if (child != null && getName(child.getItemId()).equalsIgnoreCase(itemName)) {
					child.interact("Withdraw-1");
					new ConditionalSleep(950, 1500) {
						public boolean condition() {
							return false;
						}
					}.sleep();
				}
			}
		}
		return true;
	}

	public String getName(int itemID) {
		ItemDefinition itemDef = ItemDefinition.forId(itemID);
		if (itemDef != null) {
			String itemName = itemDef.getName();
			if (itemName != null) {
				return itemName;
			}
		}
		return "";
	}

}

Create an account or sign in to comment

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.