Guest User

Untitled

a guest
Nov 16th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.InputEvent;
  3.  
  4. public class clicker {
  5. private static int height = 275;
  6. private static int base_wigth = 238;
  7. private static int gap = 175;
  8. private static int delay = 100;
  9. private static StringBuilder stringBuilder = new StringBuilder();
  10.  
  11. private static void hanoi(int n, char A, char B, char C) {
  12. if (n > 0) {
  13. hanoi(n - 1, A, C, B);
  14. stringBuilder.append(A).append(C);
  15. hanoi(n - 1, B, A, C);
  16. }
  17. }
  18.  
  19. public static void main(String[] args) throws AWTException {
  20. Robot robot = new Robot();
  21. hanoi(3, 'a', 'b', 'c');
  22. String word = stringBuilder.toString();
  23. System.out.println(word);
  24. for (int i = 0; i < word.length(); i++) {
  25. if (word.charAt(i) == 'a') {
  26. robot.mouseMove(811, height);
  27. robot.delay(delay);
  28. } else if (word.charAt(i) == 'b') {
  29. robot.mouseMove(983, height);
  30. robot.delay(delay);
  31. } else if (word.charAt(i) == 'c') {
  32. robot.mouseMove(1161, height);
  33. robot.delay(delay);
  34. }
  35. robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
  36. robot.delay(delay);
  37. robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
  38. robot.delay(delay);
  39.  
  40. }
  41.  
  42.  
  43. }
  44. }
Add Comment
Please, Sign In to add comment