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.*; | |
import java.awt.event.InputEvent; | |
public class NoSleep { | |
public static void main(String[] arg) throws Exception { | |
Robot robot = new Robot(); | |
while (true) { | |
Point point = MouseInfo.getPointerInfo().getLocation(); | |
robot.mouseMove((int) point.getX() + 200, (int) point.getY()); | |
Thread.sleep(2_000); |
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
# Run `pip install mouse` first | |
from mouse import move, get_position | |
from time import sleep | |
# This will move the mouse in squares. | |
# You can change the size of the square (default 200px) and the | |
# movement duration (default 2s), the programm will sleep for 20s. | |
# You can change the square implementation or introduce some randomness | |
# to the above values to make it difficult to be detected. |