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.

Banking Util

Featured Replies

My task interface is a simple node interface everybody uses. 

 

Contains three methods:

  1. String: status()
  2. int: run()
  3. boolean: activate();

you could remove dsAPI its my own api but i did release some of the methods some where in this section il give you links.

containsAll

 

This is an abstract class which is meant to be extended. You can override activate if it doesnt suit your needs.

package util;

import java.util.ArrayList;
import java.util.List;

import org.osbot.rs07.api.util.Utilities;
import org.osbot.rs07.script.Script;

import osb.setting.Task;
import osb.util.DsAPI;
import osb.web.WebBank;

public abstract class DsBanking implements Task {
	
	public List<String> requirements = new ArrayList<String>();
	public final Script ctx;
	private final DsAPI dsAPI;
	private WebBank webBank;
	
	public DsBanking(Script ctx, DsAPI dsAPI)	{
		this.ctx = ctx;
		this.dsAPI = dsAPI;
		this.webBank = dsAPI.getWebBank();
	}
	
	public abstract String status();	
	public abstract void run() throws InterruptedException;
	
	@Override
	public boolean activate() throws InterruptedException {
		return this.webBank.insideBank() && !dsAPI.containsAll(true, getList());
	}

	public void clearList()	{
		requirements.clear();
	}
	
	public void setupList(String...items)	{
		for (String item: items)	{
			requirements.add(item);
		}		
	}
	
	public String[] getList()	{
		return Utilities.convertStrings(requirements);
	}
	
	public boolean openBank()	{
		return webBank.openBank();
	}
	
	public boolean depositAll()	{
		if (ctx.inventory.contains(getList()))
			return ctx.bank.depositAllExcept(getList());
		else
			return ctx.bank.depositAll();
	}
	
	public void withdraw(String name, int amount) throws InterruptedException	{
		if (dsAPI.containsAll(false, name))	{
			boolean all = (amount == -2) ? true: false;
			boolean allButOne = (amount == -1) ? true: false;
			
			if (all)
				ctx.bank.withdrawAll(name);
			else if (allButOne)
				ctx.bank.withdrawAllButOne(name);
			else
				ctx.bank.withdraw(name, amount);
			dsAPI.conSleep(dsAPI.containsAll(true, name), 7000).sleep();
		}else{
			ctx.log("doesnt have " +name);
			ctx.bot.getScriptExecutor().stop();
		}
	}
}

Edited by josedpay

Guest
This topic is now closed to further replies.

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.