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.

My TreeFilter

Featured Replies

I wrote this after realizing that calling @getMap().canReach(...) is really expensive.

package org.bjornkrols.events;

import java.util.HashMap;
import java.util.Map;

import org.bjornkrols.script.BotreMethodProvider;
import org.osbot.rs07.api.filter.Filter;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;

/**
 * @author 		Bjorn Krols (Botre)
 * @version		0.2
 * @since		March 26, 2015
 */

public class TreeFilter implements Filter<RS2Object> {
	
	/**
	 * The script instance.
	 */
	private final Script script;
	
	/**
	 * The tree's name.
	 */
	private String name;
	
	/**
	 * The chop radius's center.
	 */
	private Position chopCenter;
	
	/**
	 * The chop radius.
	 */
	private int chopRadius;
	
	/**
	 * <Position, reachable && in range>
	 */
	private Map<Position, Boolean> validityMap;
	
	public TreeFilter(final Script script) {
		this.script = script;
		validityMap = new HashMap<Position, Boolean>();
	}
	
	@Override
	public boolean match(RS2Object o) {
		if (!BotreMethodProvider.isValid(o))  	return false;
		if (!o.hasAction("Chop down")) 		return false;
		if (!o.getName().equals(name))		return false;
		Position p = o.getPosition();
		if (validityMap.containsKey(p))		return validityMap.get(p);

		validityMap.put(p, chopCenter.distance(o) < chopRadius && script.getMap().canReach(o));

		return validityMap.get(p);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Position getChopCenter() {
		return chopCenter;
	}

	public void setChopCenter(Position chopCenter) {
		this.chopCenter = chopCenter;
	}

	public int getChopRadius() {
		return chopRadius;
	}

	public void setChopRadius(int chopRadius) {
		this.chopRadius = chopRadius;
	}
	
}
  • Author

return true;

 

sendMessage(getBrochachos(CoolestBrochachos.APAEC), "no");

 

edit; hope to see u with a blue name soon, it will match your profile pic too ;p

 

Such coincidence doge.png

looking good m9

 

edit; hope to see u with a blue name soon, it will match your profile pic too ;p

 

What's the difference between the two? Other than the color :P

  • Author

What's the difference between the two? Other than the color tongue.png

 

One looks good with my logo, the other not so much doge.png

Edited by Botre

One looks good with my logo, the other not so much doge.png

 

Silly  Troll.png How'd it go with your region problem?

Create an account or sign in to comment

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.