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.

Get loaded/nearest/second/furthest/random

Featured Replies

getLoaded, getNearest, getSecondNearest, getFurthest and getRandom for RS2Objects, NPCs, Players and GroundItems. Enjoy:

 

Download the class and source files here.

Files hosted on Copy.com

 

Open the Jar with any Zip/Rar program, and extract. There's pre-compiled classes (.class) and the source codes (.java). Enjoy.

 

[edit] Forgot to mention: The available parameters are int, String and Filter Var-Args for every method! You don't have to have any parameter at all if you don't want. [/edit]

 

Example of use:


		MethodAdapter methodAdapter = new MethodAdapter(this);
		


		final GroundItem bones = methodAdapter.getGroundItemHandler().getRandom(
				"Bones");

		methodAdapter.interactWithEntity(bones, "Take", 1000, 200, 400,
				new XDynamicSleep() {

					@Override
					public boolean canAwake() {

						return !bones.exists();
					}
				});

Or if you want to create an EntityXProfile:


		//Declare a new <code>MethodAdapter</code> instance
		final MethodAdapter m = new MethodAdapter(this);
		
		//Declare a new <code>EntityProfile<generic extends Entity>
		EntityXProfile<NPC> whiteKnight = new EntityXProfile<>();
		
		//Provide the profile defining attributes:
		whiteKnight.setAreas(falador);
		whiteKnight.setNames("White Knight");
		whiteKnight.setFilters(new Filter<NPC>() {
			@Override
			public boolean accept(NPC o) {
				
				return o.getFacing() == null || o.getFacing().equals(m.getLocalPlayer());
			}
		}); //Check to make sure that the NPC isn't in combat or is in combat with me
		
		//Find the nearest and second nearest Rock Crab and declare new <code>NPC</code> instances
		NPC first = m.getNPCHandler().getNearest(whiteKnight);
		NPC second = m.getNPCHandler().getSecondNearest(whiteKnight);
		




		//Do what you want, just make sure you null-check them first.
		if (first != null && !first.isMoving())
			first.interact("Attack");
		else if (second != null && !first.isMoving())
			second.interact("Attack");
		else
			//No NPC found

Description:

I've finished creating a generic-orientated getter class for Entities. This ensures that objects, NPC, players and ground items all use the same methods to their specific needs. Because I'm a bit of a perfectionist, I prefer "getting" and evaluating object instances before interacting. I want to be the one who handles those processed. This helps ensure that each interaction is concluded flawlessly.

 

 

How to install:

Copy the src/co/ folder to your source folder.

 

Edited by liverare

  • Author

Pain spotted a missing class file. That is now resolved. Please download the new version and disregard the old! I've also cleaned up the packaging a bit. :)

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.