Created
December 11, 2023 18:32
-
-
Save joemaffei/ab407104b748fe725195a0d5fb8635ab to your computer and use it in GitHub Desktop.
Mouse mover in Node using RobotJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const robot = require('robotjs'); | |
const screenSize = robot.getScreenSize(); | |
(async () => { | |
while (true) { | |
robot.moveMouseSmooth( | |
Math.random() * screenSize.width, | |
Math.random() * screenSize.height, | |
1 | |
); | |
await new Promise((resolve) => { | |
setTimeout(resolve, Math.random() * 3000); | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment