Skip to content

Instantly share code, notes, and snippets.

@joemaffei
Created December 11, 2023 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joemaffei/ab407104b748fe725195a0d5fb8635ab to your computer and use it in GitHub Desktop.
Save joemaffei/ab407104b748fe725195a0d5fb8635ab to your computer and use it in GitHub Desktop.
Mouse mover in Node using RobotJS
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