Skip to main content

No project description provided

Project description

🐭 Oxy® Mouse

Generate mouse movements with Python & different algorithms

Discord

OxyMouse is a Python library for generating mouse movements.

It is designed to work with any browser control library that supports 2D moving of the mouse cursor.

Installation

pip install oxymouse

Usage

Specify algorithm an algorithm.

Supported algorithms:

bezier, gaussian, perlin

from oxymouse import OxyMouse

mouse = OxyMouse(algorithm="bezier")
movements = mouse.generate_random_coordinates(viewport_width=1920, viewport_height=1080)

generate_random_coordinates

This method will generate random coordinates based on your viewport width and viewport height.

generate_coordinates

This method will generate random coordinates from a given 2D point to another 2D point.

You can use this to generate movements to a button.

For example:

  • get button coordinates
  • get current mouse coordinates
  • generate movements from current mouse coordinates to button coordinates
from oxymouse import OxyMouse

mouse = OxyMouse(algorithm="bezier")
movements = mouse.generate_coordinates(from_x=400, from_y=500, to_x=1000, to_y=1200)

generate_scroll_coordinates

This method will generate random coordinates for scrolling.

from oxymouse import OxyMouse

mouse = OxyMouse(algorithm="bezier")
movements = mouse.generate_scroll_coordinates()

Supported Algorithms

Bezier

The Bezier algorithm generates mouse movements using the Bezier curve. Perfect for moving to click a button

bezier.png

Gaussian

The Gaussian algorithm generates mouse movements using the Gaussian distribution. Perfect for simulating human-like mouse movements

gaussian.png

Perlin

The Perlin algorithm generates mouse movements using the Perlin noise. Perfect for simulating human-like mouse movements

perlin.png

Testing

You can easily test generated mouse movements visually with specific algorithm.

Use the CLI to test the generated mouse movements.

For example, to test the generated mouse movements with the Bezier algorithm and generate_coordinates function.

python3 visualize.py bezier gc

You will see the generated mouse movements in a window. Similar in the examples above.

Other function names:

function_names_to_function_map = {
    "gc": "generate_coordinates",
    "grc": "generate_random_coordinates",
    "gsc": "generate_scroll_coordinates",
}

Contributing

Contributions are welcome! For feature requests and bug reports please submit an issue!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oxymouse-1.0.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

oxymouse-1.0.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file oxymouse-1.0.0.tar.gz.

File metadata

  • Download URL: oxymouse-1.0.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.8.0-40-generic

File hashes

Hashes for oxymouse-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8c28413127394f4912290a40f3c5f73d7c1d4f282cb0314128622e740a4538b8
MD5 2f3d3084b8edccd3bb8b2b57684140e4
BLAKE2b-256 712a46192c170f868bb8033f9f9b32565532696afc2fcb2f1b7f6c0f45e330dd

See more details on using hashes here.

File details

Details for the file oxymouse-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: oxymouse-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.8.0-40-generic

File hashes

Hashes for oxymouse-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79ebfabc075b64f10e0c6abe40ab7b9375b580ea58d4943f595986a0ed6bcdf6
MD5 078f6a8c3ebd82e5b48e6eb1b32beadb
BLAKE2b-256 8d538d4fe51d8a86b5d7b4dee67a9799f2f15bda71f9a490dcfc6353903b582f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page