You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
697 B

package xyz.wbsite.jmacro;
import java.awt.*;
public class JRoot extends Robot {
private static final int MAX_DELAY = 60000;
public JRoot() throws AWTException {
}
public JRoot(GraphicsDevice screen) throws AWTException {
super(screen);
}
@Override
public synchronized void delay(int ms) {
checkDelayArgument(ms);
try {
Thread.sleep(ms);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
private void checkDelayArgument(int ms) {
if (ms < 0 || ms > MAX_DELAY) {
throw new IllegalArgumentException("Delay must be to 0 to 60,000ms");
}
}
}

Powered by TurnKey Linux.