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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: oxymouse-1.0.1.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.0.1.tar.gz
Algorithm Hash digest
SHA256 7a9130a0826d25193429ed927072fd6f36884ac213be2e0b7a6888d255049090
MD5 db758e6ede66fb6ff5fe0047358ec6d5
BLAKE2b-256 0fc0b9191def845dff7638dc067f9a817651fa3efe86f02f8107d651ea4131c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: oxymouse-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f2614283e65a813b0623f799f3b51156e652f8bf2cec7e0896ab50c96f689a83
MD5 c4679aee2f321a6d6ff1cd2f40242696
BLAKE2b-256 e19f0c584c65730d2d403e604ed3ca13b16a152b16ab73173fd0c3ebaa85737a

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