Jump to content

Human mouse movements and clicks


douko

Recommended Posts

Best way would be to write your own algorithm. You could take a look at this its written in Pascal so you won't be able to just plop into java, but the algorithm is there for you to take a look at than write your own based on that knowledge. It has pretty good functionality such as overshooting the target, shaky pathing to target, and variable speed, to just name a few.

Link to comment
Share on other sites

20 hours ago, BravoTaco said:

Best way would be to write your own algorithm. You could take a look at this its written in Pascal so you won't be able to just plop into java, but the algorithm is there for you to take a look at than write your own based on that knowledge. It has pretty good functionality such as overshooting the target, shaky pathing to target, and variable speed, to just name a few.

What methods would you have to override to have osbot universally to implement custom mouse movement like that? I've spent about 4 hours trying to find information on how other people have done it in the past and I only came across 2 different topics that had anything to do with what I am asking/trying to do.

Topic 1: This topic slightly addresses my question but the responses got derailed off the topic and is irrelevant to me. In the topic "making your own Mouse.click()" was mentioned which I assume was intended to mean overriding the Mouse.click() and Mouse.move() functions which is not possible because those methods are final and cannot be overridden. And before anyone answers "just make your own function that clicks where you want to click with the custom mouse movement you want to use...", i'm specifically asking how to universally override the mouse movement without having to create every single possible method I would ever need to use that would move the mouse like a new NPC.interact() method, a new Item.interact() method, etc.

 

Topic 2: This topic is almost exactly what I want to be able to do, but the main topic it references (https://osbot.org/forum/topic/47398-semi-advanced-creating-your-own-mouse-controller/) has been moved to a location I cannot see with my osbot account (maybe I need VIP or something but I doubt it) and I went through all the archived topics in the date range that the topic existed and I couldn't find it. To be able to do what this topic below mentions, I need to be able to use the MouseController class (which is in the topic that is referenced above) and I have not found a way to see it.

 

While having the ability to implement custom mouse movement would be really nice, my scripts work entirely fine right now so there is no real urgency here.

Link to comment
Share on other sites

7 hours ago, datpigeon said:

Topic 1: This topic slightly addresses my question but the responses got derailed off the topic and is irrelevant to me. In the topic "making your own Mouse.click()" was mentioned which I assume was intended to mean overriding the Mouse.click() and Mouse.move() functions which is not possible because those methods are final and cannot be overridden. And before anyone answers "just make your own function that clicks where you want to click with the custom mouse movement you want to use...", i'm specifically asking how to universally override the mouse movement without having to create every single possible method I would ever need to use that would move the mouse like a new NPC.interact() method, a new Item.interact() method, etc

To my knowledge, you won't be able to override the default mouse movement/interactions within the API so you will have to create custom methods and call those. You wont have to create that many methods as the objects you interact with always have an X, Y position, knowing this you could create a moveMouse(int X, int Y) method that would work for all interactable objects. Than after using your own mouse movement logic to move closely to the object you could than finish off the method with an interaction() call to the API. This may even provide more randomness to the mouse logic since the API will than have a chance to also use its own movement logic to interact with the object.

Link to comment
Share on other sites

23 minutes ago, BravoTaco said:

To my knowledge, you won't be able to override the default mouse movement/interactions within the API so you will have to create custom methods and call those. You wont have to create that many methods as the objects you interact with always have an X, Y position, knowing this you could create a moveMouse(int X, int Y) method that would work for all interactable objects. Than after using your own mouse movement logic to move closely to the object you could than finish off the method with an interaction() call to the API. This may even provide more randomness to the mouse logic since the API will than have a chance to also use its own movement logic to interact with the object.

ok well I may end up trying that out, i did something similar to that a long time ago but rather than moving the mouse close with some other mouse movement API i just instantly moved the mouse to the x,y position and then used the standard methods to interact with the object and that worked really well for the critical task it needed to do

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...