Skip to content
Advertisement

python random mouse movements

I would like to make random mouse movements in specified rectangle area (limited with coordinates x1, y1, x2, y2, x3, y3, x4, y4). Movements should be smooth, random, not just straight lines, go randomly up/down/left/right/etc for specified time duration.

Could you give me a hand or working example I can learn from? many thanks

Advertisement

Answer

This code works on Windows only. You can experiment with the parameters inside the random_movement function to get better results. Good luck!

JavaScript

Example:

JavaScript
Advertisement