Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.awt.event.InputEvent;
- public class clicker {
- private static int height = 275;
- private static int base_wigth = 238;
- private static int gap = 175;
- private static int delay = 100;
- private static StringBuilder stringBuilder = new StringBuilder();
- private static void hanoi(int n, char A, char B, char C) {
- if (n > 0) {
- hanoi(n - 1, A, C, B);
- stringBuilder.append(A).append(C);
- hanoi(n - 1, B, A, C);
- }
- }
- public static void main(String[] args) throws AWTException {
- Robot robot = new Robot();
- hanoi(3, 'a', 'b', 'c');
- String word = stringBuilder.toString();
- System.out.println(word);
- for (int i = 0; i < word.length(); i++) {
- if (word.charAt(i) == 'a') {
- robot.mouseMove(811, height);
- robot.delay(delay);
- } else if (word.charAt(i) == 'b') {
- robot.mouseMove(983, height);
- robot.delay(delay);
- } else if (word.charAt(i) == 'c') {
- robot.mouseMove(1161, height);
- robot.delay(delay);
- }
- robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
- robot.delay(delay);
- robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
- robot.delay(delay);
- }
- }
- }
Add Comment
Please, Sign In to add comment