Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. import java.awt.AWTException;
  2. import java.awt.Robot;
  3. import java.awt.event.MouseEvent;
  4. import java.util.Random;
  5.  
  6. public class Main {
  7. Thread thread = new Thread(new Runnable()) {
  8.  
  9.  
  10. static int time = 0; //Time variable, we will use this to check whether or not to use overload
  11. static int offset = 0;
  12.  
  13. private static Robot robot = null;
  14.  
  15. public static void main (String[] args)
  16. {
  17. try{
  18. robot = new Robot ();
  19. }
  20. catch (AWTException e){
  21. e.printStackTrace();
  22. }
  23.  
  24. timer();
  25.  
  26. }
  27. thread.start();
  28.  
  29.  
  30. public static int randomizeClickPrayerX()
  31. {
  32. Random rand = new Random();
  33. int randomCoords = rand.nextInt((1008 - 995) + 1) + 995;
  34. return randomCoords;
  35. }
  36.  
  37. public static int randomizeClickPrayerY()
  38. {
  39. Random rand = new Random();
  40. int randomCoords = rand.nextInt((157 - 145) + 1) + 145;
  41. return randomCoords;
  42. }
  43.  
  44. public static int randomizeClickIntervals()
  45. {
  46. Random rand = new Random();
  47. int randomIntervals = rand.nextInt((400 - 100) + 1) + 100;
  48. return randomIntervals;
  49. }
  50.  
  51. public static int incrementTime()
  52. {
  53. try{
  54. thread.start();
  55. Thread.sleep(1000);
  56. time++;
  57. } catch (InterruptedException e){
  58. e.printStackTrace();
  59. }
  60. return time;
  61.  
  62. }
  63.  
  64.  
  65. public static void timer()
  66. {
  67. do{
  68.  
  69. clickPray(randomizeClickPrayerX() , randomizeClickPrayerY());
  70.  
  71.  
  72. System.out.println(time);
  73. System.out.println(randomizeClickIntervals());
  74.  
  75. incrementTime();
  76.  
  77. //1st sip
  78. if (time == 10){
  79. clickOvl(1000 , 500);
  80. }
  81. //2nd sip
  82. if (time == 600){
  83. clickOvl(300 , 500);
  84. }
  85. //3rd sip
  86. if (time == 900){
  87. clickOvl(300 , 500);
  88. }
  89. //4th sip
  90. if (time == 1200){
  91. clickOvl(300 , 500);
  92. }
  93.  
  94.  
  95. } while (time != 6);
  96.  
  97. //18 overloads per 6 uur, dus voor 4x18 clicks doen
  98. }
  99.  
  100.  
  101. public static void clickOvl (int x, int y)
  102. {
  103. robot.mouseMove(x, y);
  104. robot.delay(10);
  105. robot.mousePress(MouseEvent.BUTTON1_MASK);
  106. robot.mouseRelease(MouseEvent.BUTTON1_MASK);
  107. }
  108.  
  109. public static void clickPray (int x, int y)
  110. {
  111. robot.mouseMove(x, y);
  112. robot.delay(randomizeClickIntervals());
  113. robot.mousePress(MouseEvent.BUTTON1_MASK);
  114. robot.mouseRelease(MouseEvent.BUTTON1_MASK);
  115. }
  116.  
  117.  
  118.  
  119. }
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement