Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mouse.py, added ability to set custom mouse speed by developers #178

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

QuBerto
Copy link
Contributor

@QuBerto QuBerto commented Aug 29, 2023

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")

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)

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.
Copy link
Contributor Author

@QuBerto QuBerto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 fixes for checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant