January 21, 20206 yr 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)
January 21, 20206 yr Make your own method using mouse.click - You would have to calculate pos etc. yourself, but that's relatively easy.
January 21, 20206 yr 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 January 21, 20206 yr by BravoTaco
January 21, 20206 yr 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
January 21, 20206 yr 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.
January 21, 20206 yr 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.
January 21, 20206 yr 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.
January 22, 20206 yr 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 😭
April 26, 20205 yr 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