This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
Update mouse.py, added ability to set custom mouse speed by developers #178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I find the fastest mousespeed defined inside the project too slow for certain tasks, ie dropping items or swapping gear.
With these changes developers will be able to add their custom mouse speed. In your botscript you can register the custom mouse speed with:
self.mouse.register_mouse_speed("custom", 4, 8)
Now you can use mousespeed "custom" in your script, just like you would do normally:
self.mouse.move_to(item.random_point(), mouseSpeed="custom")
You can define multiple custom mousespeeds
self.mouse.register_mouse_speed("super_duper_fast", 2, 4)
self.mouse.register_mouse_speed("super_duper_slow", 200, 400)
self.mouse.move_to(item.random_point(), mouseSpeed="super_duper_fast")
self.mouse.move_to(item.random_point(), mouseSpeed="super_duper_slow")
Value errors are raised when the developers input is below 2, and if min_val is higher then max_val.
All default mouseSpeeds will work the same as they used to before.
self.mouse.move_to(item.random_point(), mouseSpeed="slowest")
self.mouse.move_to(item.random_point(), mouseSpeed="slow")
self.mouse.move_to(item.random_point(), mouseSpeed="fast")
self.mouse.move_to(item.random_point(), mouseSpeed="fastest")