Created
February 1, 2021 03:22
-
-
Save erikgregorywebb/ff4648436f8f3500e1abfc827b1709d5 to your computer and use it in GitHub Desktop.
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 | |
library(rJava) | |
library(rMouse) | |
Sys.setenv(JAVA_HOME='C:/Program Files/Java/jre1.8.0_241') # for 64-bit version | |
# loop | |
condition = FALSE | |
while(condition == FALSE) { | |
Sys.sleep(30) | |
current_coordinates = rMouse::coord() | |
print(paste('X: ', current_coordinates$x, ' Y: ', current_coordinates$y)) | |
new_x = current_coordinates$x + sample(-2:2, 1) | |
new_y = current_coordinates$y + sample(-2:2, 1) | |
rMouse::move(new_x, new_y, failSafe = FALSE) | |
} | |
print(Sys.time()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment