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.

Accurate Interaction

Featured Replies

  • Author

I updated it, but there is always a problem with noted items.

  • 2 weeks later...
  • Author

It's been a while since I've tested this out, but I looked at it and found that I wasn't checking for the entity name inside of the menu box. I fixed that and tested it out. Everything seems fine, it would be nice for people to test it out and criticize the worst.

  • 11 months later...

I was trying to help you, don't act like a know it all when you just had a static sleep timer of 500-1500 please.

1) I'm not sure why you still think you're doing it right, but this:

2950fb51d2ecd38f4eb36b686fa697f2.png

NEVER GETS ANY OPTION. All it does is click, and that's assuming there's one thing on the cursor (you're not even checking that that's the correct entity, just that there's one there).

2) Your while loop just assures that the mouse gets moved to the bounding box. This could be good I guess, but it's kind of redundant when you could just return false if a menu is not open when you go to interact with it.

3) Fine if you're going to act like that I will:

public boolean interactNPC(NPC npc, String action) throws InterruptedException {	if (npc != null && npc.getDefinition().getActions() != null) {		Rectangle boundingBox = npc.getMouseDestination().getBoundingBox();		if (Arrays.asList(npc.getDefinition().getActions()).get(0).equalsIgnoreCase(action)) {			client.moveMouseTo(new RectangleDestination(boundingBox.x+5, boundingBox.y+5, boundingBox.width-10, boundingBox.height-10), false, false, false);			if (client.getEntitiesOnCursor().get(0).getName().equalsIgnoreCase(npc.getName())) {				client.clickMouse(false);				return true;			}			else {				client.moveMouseTo(new RectangleDestination(boundingBox.x+5, boundingBox.y+5, boundingBox.width-10, boundingBox.height-10), false, true, true);				return selectMenuOption(action);			}		}		else {			client.moveMouseTo(new RectangleDestination(boundingBox.x+5, boundingBox.y+5, boundingBox.width-10, boundingBox.height-10), false, true, true);			return selectMenuOption(action);		}	}	return false;}	public boolean selectMenuOption(String action) throws InterruptedException {	if (client.isMenuOpen()) {		List<Option> options = client.getMenu();		for (int i= 0; i < options.size(); i++) {			if (options.get(i).action.equalsIgnoreCase(action)) {				return client.moveMouseTo(new RectangleDestination(client.getMenuX(), client.getMenuY()+19+(i*15), client.getMenuWidth(), 15), false, true, false);			}		}	}	return false;}
Of course I could do more checking, but that can easily be accomplished by checking the boolean returned when the scripter calls the method.
can i use this in my scripts?

idc but I'd optimize it since that codes pretty shitty

Ive just skimmed it so far. Ill look more into it tomorrow, but if i need help optimizing it can i ask you for tips

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.