2018-03-14 03:17:51 -04:00
|
|
|
import java.awt.Point;
|
2018-03-13 10:33:32 -04:00
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
public class DropperThread implements Runnable {
|
|
|
|
Thread dropperThread;
|
2018-03-14 03:17:51 -04:00
|
|
|
Point clickLocation;
|
2018-03-13 10:33:32 -04:00
|
|
|
Cursor cursor;
|
|
|
|
|
2018-03-14 03:17:51 -04:00
|
|
|
public DropperThread(Point clickLocation, Cursor cursor) {
|
|
|
|
this.clickLocation = clickLocation;
|
2018-03-13 10:33:32 -04:00
|
|
|
this.cursor = cursor;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
try {
|
2018-03-14 03:17:51 -04:00
|
|
|
cursor.moveAndRightlickAtCoordinatesWithRandomness(clickLocation, 15, 15);
|
2018-03-13 10:33:32 -04:00
|
|
|
} catch (IOException e) {
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
e.printStackTrace();
|
|
|
|
} catch (Exception e) {
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
2018-03-14 04:18:07 -04:00
|
|
|
//System.out.println("~~~~~~~~~~~~~ dropperThread finished!");
|
2018-03-13 10:33:32 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void start() {
|
2018-03-14 04:18:07 -04:00
|
|
|
//System.out.println("dropperThread started");
|
2018-03-13 10:33:32 -04:00
|
|
|
if (dropperThread == null) {
|
|
|
|
dropperThread = new Thread(this, "dropperThread");
|
|
|
|
dropperThread.start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void waitTillDone() throws InterruptedException {
|
|
|
|
dropperThread.join();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|