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.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: oxymouse-1.1.0.tar.gz
  • Upload date:
  • Size: 7.3 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.1.0.tar.gz
Algorithm Hash digest
SHA256 33be267706c2b1174059d082797d11cbe66da276ffb070e189f136997e7bca7c
MD5 3d54db8bebafca62f27c963d044312ee
BLAKE2b-256 e531c4f1f9996ac9374cf00a397f919cd91a7ad76d7a61d2bebf75826057a388

See more details on using hashes here.

File details

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

File metadata

  • Download URL: oxymouse-1.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ddf5afe4ea28498701206d025e66d5e4474947afa9d5b8c50619a361036341a
MD5 b60d1d2f663a7c25fc9342f25dd37a26
BLAKE2b-256 d5e7e33ff3319f5c57b50cb5b7f4d060b2f7e2431a81ce59b0c6c02cf7e15f01

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