vincentbavitz/bezmouse
概要
Simulate human mouse movements with xdotool
仕事効率化・自動化計測したスター増加
- 24時間
- 0
- 7日間
- +1
- 15日間
- +1
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルBezMouse
BezMouse is a lightweight tool written in Python to simulate human-like mouse movements with Bézier curves. Some applications might include:
- aimbots (prevent bans)
- MMORPG bots (avoid macro detection)
- controlled macros
BezMouse was originally written for a RuneScape color bot and has never triggered macro detection in over 400 hours of continuous use.
Noteworthy Functions
move_to_img - this function takes the name of an input image (excluding file extension) and moves the mouse to a random pixel on that image if it is found on the screen. Commands for xdotool are saved to a temporary bash file in the ramdisk ./tmp called 'mouse.sh'. It is then executed as a bash script to give best performance. Note: This function is very slow because it must identify the image across your screen. It is highly recommended to find the coordinates of the image in a separate thread and feed this into the move() function.
connected_bez - connects all the (x, y) coordinates in a list of coordinates with a string of interconnected Bézier curves. A parameter deviation is required which controls how straight the lines drawn by the cursor are. Zero deviation gives straight lines. Accuracy is a percentage of the displacement of the mouse from point A to B, which is given as maximum Bézier control point deviation. Naturally, deviation of 10 (10%) gives maximum control point deviation of 10% of magnitude of displacement of mouse from point A to B, and a minimum of 5% (deviation / 2). Here is an example of connected_bez as a trace of the mouse as it passes 26 points in order, where deviation is set to 30.

move
Each of the move_* functions are abstractions from the move function which handles the math of the Bézier curves such to produce realistic overshoots as well as variable speed and momentum. The following graphic was made using the draw = True argument and demonstrates the overshoot and variable speed.

Dependencies
- Linux (generates bash scripts)
- Python >=3
- PyAutoGui
- xdotool
- more_itertools
- maim
Development
Find something wrong with my code? See room for improvement? Please let me know!
Regarding Performance
I am looking into injecting mouse events directly into a uinput virtual mouse. This has the benefits of:
- minimising latency
- giving OS-level control over mouse acceleration
- generating perfectly smooth, coordinate independent movements
- eliminating heavy dependencies
I will implement this feature if I can find an equivalent to uinput for Windows.
Todos
関連プロジェクトを探す
読み込み中…