Moving the Mouse like a Human would

Here's a set of macros that lets you record and play back human mouse movements for automating very smooth/human-like mouse movements in Keyboard Maestro. I just wrote it today, but even though it's a new rewrite of old code, I think it's bug free. But let me know if you find any problems.

The KM action "Move Mouse" is good for basic/autonomous mouse movement, but it doesn't do the job in an aesthetic or human-like way. These macros will let you record and play back human motion, which can be used for purely aesthetic reasons or perhaps for passing server/captcha "human tests."

Mouse, Human Motion Macros.kmmacros (45.4 KB)

As documented in the macro, you will need to set up at least one mouse path using the Mouse Recorder macro. It's better to set up two or three paths first, then run the Mouse Test macro to see the mouse moved randomly using your recorded paths.

2 Likes

Could you explain how to record the mouse movement and how to choose a path?
Can't seem to figure it out

Thanks in advance

If you run the macro Mouse Recorder you will get this dialog box:

As the dialog box says, click on OK then move the mouse from the upper left corner of the screen to the lower right.

Once you do that you will get this:

If you press CONTINUE, the mouse movement that you created from the upper left to lower right of the screen will be "recorded."

In order to run any macro, like the Mouse Recorder macro, you can either assign a hotkey to it and press the hotkey, or use the KM Editor to activate it, typically by selecting the macro and pressing the Run button.

Thanks, but when I run the recoreder I get the first message, when i click ok and moce the mouse to upper left en lower right, nothing happens and no messages appear...

Does your Mac have multiple monitors? I'm trying to figure out what could be causing your issue. My macro was not tested on a Mac with multiple monitors.

P.S. If you didn't get the second dialog box, then my macro may still be running and you will need to cancel all running macros, or use the debugger to stop my macro, or restart the engine.

Yes, I have multiple monitors, using mac studo m2 max 64GB

Aha! Either I have to add code to support multiple monitors, or I have to add code to tell the user that this macro won't work with multiple monitors.

I'll probably add code to support multiple monitors. That may take a little time to figure out. It never occurred to me to test my code for a multi-monitor user.

As a temporary fix, if you just temporarily disable your secondary monitor(s), the macro should record correctly, then you can re-attach your displays, and it should work fine.

Got it, so no lick for me on this one :slight_smile:
Hope you find a solution soon!

I will try to accommodate you, but you can use my temporary solution described in the last post.

Ok, you adjusted the post or you made e new one?

I added the following words to my post above:

Here's v1.1, which I think should support multi-monitors. But there are 100 different ways to configure and arrange multi-monitors, and I didn't test all of those arrangements! (I tested only my own temporary two-display arrangement, and it works for me.)

Mouse, Human Motion Macros v1.1.kmmacros (45.9 KB)