Created
May 26, 2014 14:33
-
-
Save bartoleo/471a9d11bb2c73f49c41 to your computer and use it in GitHub Desktop.
move mouse pointer to random position with Groovy
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
import java.awt.Robot | |
int SLEEP = 2000 | |
int MAX_Y = 400 | |
int MAX_X = 400 | |
Robot robot = new Robot() | |
Random random = new Random() | |
println "Mouse Pointer under control" | |
while (true) { | |
println "moving Mouse Pointer" | |
robot.mouseMove(random.nextInt(MAX_X), random.nextInt(MAX_Y)) | |
Thread.sleep(SLEEP) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment