Succulent 18 Share Posted August 2, 2020 I'd like to try my hand at creating a custom mouse movement algorithm for dreambot to use to move the mouse to an AbstractMouseDestination. If anyone has any tips, advice, or resources I could look at that would point me in the right direction for tackling this task it would be greatly appreciated! It would be great to be able to customise some characteristics of mouse pathing/movement, such as overshooting, sway, acceleration, accuracy, so I could try to mimick a particular playstyle or pick movements based on the context of the interaction, for example the difference between afk skilling and panicking when bossing. Thanks, Succulent Link to comment Share on other sites More sharing options...
Pandemic 2711 Share Posted August 2, 2020 If we're talking about DB3's new interface, here's some general tips: You'll need to do all of the movement (or fail quickly) in the whole call, it's called once before trying to interact Make sure to return as soon as possible after you're sure the mouse is over the correct point so we can do any interactions accurately without needing to move again To actually move the mouse, you can send normal AWT events straight to the canvas (Instance#getCanvas) For best results, you may want to handle entity mouse destinations a bit differently Hope that helps Link to comment Share on other sites More sharing options...
Succulent 18 Author Share Posted August 2, 2020 9 minutes ago, Pandemic said: If we're talking about DB3's new interface, here's some general tips: You'll need to do all of the movement (or fail quickly) in the whole call, it's called once before trying to interact Make sure to return as soon as possible after you're sure the mouse is over the correct point so we can do any interactions accurately without needing to move again To actually move the mouse, you can send normal AWT events straight to the canvas (Instance#getCanvas) For best results, you may want to handle entity mouse destinations a bit differently Hope that helps Thanks for the tips! I am still concerned about the actual path generation, but these will certainly help with how to actually apply any custom behaviour to the interaction Link to comment Share on other sites More sharing options...
Bunnybun 181 Share Posted August 2, 2020 3 hours ago, Pandemic said: If we're talking about DB3's new interface, here's some general tips: You'll need to do all of the movement (or fail quickly) in the whole call, it's called once before trying to interact Make sure to return as soon as possible after you're sure the mouse is over the correct point so we can do any interactions accurately without needing to move again To actually move the mouse, you can send normal AWT events straight to the canvas (Instance#getCanvas) For best results, you may want to handle entity mouse destinations a bit differently Hope that helps What new interface? Is there a way to override the built-in movement now? Link to comment Share on other sites More sharing options...
Pandemic 2711 Share Posted August 2, 2020 33 minutes ago, Bunnybun said: What new interface? Is there a way to override the built-in movement now? There is if you're using the DB3 beta (you can find the builds in the script developer subforum). You can implement your own (org.dreambot.api.input.mouse.algorithm.MouseMovementAlgorithm), then set it with Instance#setMouseMovementAlgorithm Link to comment Share on other sites More sharing options...
holic 233 Share Posted August 21, 2020 Bump. Is it safe to use Mouse#hop to set the mouse? I'm not able to get my algo working by sending events to the canvas, I see some movement via the in game top text but I don't see actual mouse movement. If not, maybe you provide a little more insight as to the best approach. All I've found in terms of examples/tuts is listening for events not dispatching events. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.