Created
June 11, 2015 21:26
-
-
Save jnsdbr/2f48691615d8e65896b6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.*; | |
import java.awt.Robot; | |
Robot bot = null; | |
int nextClick = (int)random(15, 50); | |
void setup() { | |
try { | |
bot = new Robot(); | |
} | |
catch (Exception failed) { | |
System.err.println("Failed instantiating Robot: " + failed); | |
} | |
} | |
void draw() { | |
if(frameCount > nextClick) | |
{ | |
nextClick = frameCount + (int)random(15, 50); | |
click(); | |
} | |
} | |
void click() { | |
int mask = InputEvent.BUTTON1_DOWN_MASK; | |
bot.mousePress(mask); | |
bot.mouseRelease(mask); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment