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.

Overriding Interact Mouse Movement

Featured Replies

I was wanting to implement my own mouse movements generated via machine learning against human data. That being said, I don't want to go manually calculating coords and hitboxes if at all possible.

Is there any way to override the default mouse movement when entity.interact is called? I'd basically like to just rip out OSBot's default implementation of mouse movements and replace with my own.

Any advice would be awesome, just trying not to reinvent the wheel and go back to calculating / learning XY coords for everything. Makes more sense to leverage what the API already knows (coords / size of clickable areas, etc)

Make your own method using mouse.click - You would have to calculate pos etc. yourself, but that's relatively easy.

If you just need the position of whatever you are trying to click, and the object implements Entity, you can retrieve the bounding box of said object. Than use your mouse movement logic to move within the bounding box, than interact with it.

Edited by BravoTaco

4 minutes ago, BravoTaco said:

If you just need the position of whatever you are trying to click, and the object implements Entity, you can retrieve the bounding box of said object. Than use your mouse movement logic to move within the bounding box, than interact with it.

Only problem with this would be that the boundingboxes sometimes are too big.

public static void clickObject(MethodProvider api, RS2Object o, boolean rClick) {
		int x = (int) o.getModel().getBoundingBox(o.getGridX(), o.getGridY(), o.getZ()).getX();
		int y = (int) o.getModel().getBoundingBox(o.getGridX(), o.getGridY(), o.getZ()).getY();
		api.getMouse().click(x, y, rClick);
	}

That will get the boundingbox of an object and click it, but if it's a ladder or some shit it will misclick a lot

3 hours ago, Medusa said:

Only problem with this would be that the boundingboxes sometimes are too big.


public static void clickObject(MethodProvider api, RS2Object o, boolean rClick) {
		int x = (int) o.getModel().getBoundingBox(o.getGridX(), o.getGridY(), o.getZ()).getX();
		int y = (int) o.getModel().getBoundingBox(o.getGridX(), o.getGridY(), o.getZ()).getY();
		api.getMouse().click(x, y, rClick);
	}

That will get the boundingbox of an object and click it, but if it's a ladder or some shit it will misclick a lot

Forgot about that. You can make the bounding box smaller after retrieving it to give a tighter area to click within. Would reduce the amount of differing positions when moving to the point but if the offset is small enough it should be ok.

Pretty sure he wants to override the mouse path, not just how to instantly click it with mouse.click

12 hours ago, Medusa said:

Make your own method using mouse.click - You would have to calculate pos etc. yourself, but that's relatively easy.

 

3 hours ago, BravoTaco said:

If you just need the position of whatever you are trying to click, and the object implements Entity, you can retrieve the bounding box of said object. Than use your mouse movement logic to move within the bounding box, than interact with it.

 

1 minute ago, Naked said:

Pretty sure he wants to override the mouse path, not just how to instantly click it with mouse.click

 

 

Shoo. No one wants to hear about your mouse paths.

  • Author
8 hours ago, Naked said:

Pretty sure he wants to override the mouse path, not just how to instantly click it with mouse.click

 

 

Yeah, overriding mouse path was exactly what I was looking for.

 

12 hours ago, BravoTaco said:

If you just need the position of whatever you are trying to click, and the object implements Entity, you can retrieve the bounding box of said object. Than use your mouse movement logic to move within the bounding box, than interact with it.

This is what I was referring to with leveraging API, awesome.

 

12 hours ago, Medusa said:

Only problem with this would be that the boundingboxes sometimes are too big.


public static void clickObject(MethodProvider api, RS2Object o, boolean rClick) {
		int x = (int) o.getModel().getBoundingBox(o.getGridX(), o.getGridY(), o.getZ()).getX();
		int y = (int) o.getModel().getBoundingBox(o.getGridX(), o.getGridY(), o.getZ()).getY();
		api.getMouse().click(x, y, rClick);
	}

That will get the boundingbox of an object and click it, but if it's a ladder or some shit it will misclick a lot

You probably just saved me a *lot* of debugging time lol, thanks

 

8 hours ago, Medusa said:

Shoo. No one wants to hear about your mouse paths.

Actually I do 😭

  • 3 months later...

Hey, I was wondering how far you got on this? I don't think implementing this with some natural mouse movement libraries is all that difficult but I am hesitant on whether or not it will see any results.

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.