Skip to content

Instantly share code, notes, and snippets.

@tinylinden
Created December 2, 2022 22:06
Show Gist options
  • Save tinylinden/ec7696b8d87c9094198650555a89c661 to your computer and use it in GitHub Desktop.
Save tinylinden/ec7696b8d87c9094198650555a89c661 to your computer and use it in GitHub Desktop.
///usr/bin/env jbang "$0" "$@" ; exit $?
import java.awt.*;
import java.util.concurrent.*;
object Jiggler : Runnable {
private val robot: Robot = Robot()
override fun run() =
with (MouseInfo.getPointerInfo().getLocation()) {
robot.mouseMove(x, y)
}
}
fun main() {
Executors
.newSingleThreadScheduledExecutor()
.scheduleAtFixedRate(Jiggler, 0, 42, TimeUnit.SECONDS);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment