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.

walk(BANK_AREA); not working

Featured Replies

package seersbot;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;

import org.osbot.script.Script;
import org.osbot.script.ScriptManifest;
import org.osbot.script.rs2.model.Entity;
import org.osbot.script.rs2.model.Player;
import org.osbot.script.rs2.ui.Bank;
import org.osbot.script.rs2.ui.Inventory;
import org.osbot.script.rs2.utility.Area;

@ScriptManifest(author = "xFADE48x", info = "Picks flax at seer's village and banks it", name = "xfade48x SeersBot", version = 1.0)
public class SEERSBOT extends Script {

	static Timer runTime;

	final String FLAX_NAME = "Flax";

	final Area BANK_AREA = new Area(2722, 3491, 2729, 3493);
	final Area FLAX_AREA = new Area(2738, 3438, 2741, 3442);

	final int BANK_BOOTH_ID = 25808;

	int flaxpicked = 0;

	// code used at start
	public void onStart() {

		runTime = new Timer(0);

	}

	// code to be executed at the end
	public void onExit() {

	}

	// code in loop
	public int onLoop() throws InterruptedException {

		Inventory inven = client.getInventory();
		Player player = client.getMyPlayer();
		Bank bank = client.getBank();

		if (!inven.isFull()) {
			// pick

			if (FLAX_AREA.contains(player)) {
				Entity flax = closestObjectForName(FLAX_NAME);

				if (flax != null) {
					if (flax.isVisible()) {
						if (!player.isAnimating()) {
							if (!player.isMoving()) {
								flax.interact("Pick");
								sleep(random(300, 400));
							}
						}
					} else {
						client.moveCameraToEntity(flax);

					}
				}
			} else {
				walk(FLAX_AREA);
			}
		} else {
			// bank
			if (BANK_AREA.contains(player)) {
				Entity bankbooth = closestObject(BANK_BOOTH_ID);

				if (bank.isOpen()) {
					bank.depositAll();
				} else {
					if (bankbooth != null) {
						if (bankbooth.isVisible()) {
							bankbooth.interact("Bank");
							sleep(random(700, 800));
						} else {
							client.moveCameraToEntity(bankbooth);
						}

					}

				}

			} else {
				walk(BANK_AREA);
			}
		}

		return 50;
	}

	public void onMessage(String message) {

		if (message.contains("You pick some flax.")) {
			flaxpicked++;
		}

	}

	// paint
	public void onPaint(Graphics g) {

		Graphics2D gr = (Graphics2D) g;

		gr.setColor(Color.WHITE);
		gr.setFont(new Font("Arial", Font.PLAIN, 10));

		gr.drawString("Flax Picked: " + flaxpicked, 25, 50);
		gr.drawString("Flax Picked/h: " + getPerHour(flaxpicked), 25, 65);
	}

	public static int getPerHour(int value) {
		if (runTime != null && runTime.getElapsed() > 0) {
			return (int) (value * 3600000d / runTime.getElapsed());
		} else {
			return 0;
		}
	}

	public static long getPerHour(long value) {
		if (runTime != null && runTime.getElapsed() > 0) {
			return (long) (value * 3600000d / runTime.getElapsed());
		} else {
			return 0;
		}
	}

}

Im making a flax bot, and It walks to the flax fields fine, but it doesn't walk to the bank. why? .-.

Edited by xfade48x

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.