jpnix: (Default)
[personal profile] jpnix
There is a fun game going around that has you attempt to draw a perfect circle with either your finger on mobile or mouse pointer on your machine and get points based on accuracy and speed.

https://neal.fun/perfect-circle/

circle game

Me being me I wanted to find a repeatable and consistent way to get high scores with my circle drawings and figured a computer could do it pretty well, so lets trick a computer into doing it for us.

First step is to record the mouse cursor and hold movement coordinates so that they could be repeated over and over on the game screen. I initially sought out to do this in xdotool as i've done something similar before with it and I just love it but after some web digging I cam across XNee

With Knee I didn't have to write anything or use xdotool I could simply perform a function after running it and save the output to a file, exactly how I wanted.

Now that I have a tool that could do the needful I set off to find a perfect circle

circle


After that we can run xnee to capture our coordinates while tracing this perfect circle and store those actions in a file to recall repeatedly.

Record the tracing of the circle.
$ sleep 4;  cnee --record --mouse --keyboard -o cnee.data


Perform the recorded steps
cnee --replay -f cnee.data -v -e /dev/null -ns


Now the script can be ran and get a 93% accuracy every single time.


finished gif of the script in action

Profile

jpnix: (Default)
JPNIX

January 2023

S M T W T F S
1234567
8910111213 14
15161718 192021
222324252627 28
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 29th, 2026 12:39 pm
Powered by Dreamwidth Studios