Created
March 4, 2020 03:58
-
-
Save harpocrates/f73946d4a319f3c78b7316186ab6708d to your computer and use it in GitHub Desktop.
Script for AFK-ing clicking π
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.event.InputEvent | |
def rightClickUntilMouseMove(setupMillis: Int, everyMillis: Int): Unit = { | |
Thread.sleep(setupMillis) | |
val pInit = MouseInfo.getPointerInfo().getLocation | |
while (pInit == MouseInfo.getPointerInfo().getLocation) { | |
val r = new Robot() | |
r.mousePress(InputEvent.BUTTON3_MASK) | |
r.mouseRelease(InputEvent.BUTTON3_MASK) | |
Thread.sleep(everyMillis) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment