Skip to content
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

Closed
wants to merge 2 commits into 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

@QuBerto QuBerto closed this by deleting the head repository Sep 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant