Advertisement
andrewb

cookie-click.au3

Aug 24th, 2014
634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.11 KB | None | 0 0
  1. #include <GUIConstantsEx.au3>
  2.  
  3. Opt("WinTitleMatchMode", 2)
  4. Opt("MouseClickDelay", 0)
  5.  
  6. HotKeySet("{ESC}", "Yesno")
  7. HotKeySet("^+x", "Terminate")
  8.  
  9. ;; Give me time to let go of the mouse
  10. Sleep(1000)
  11.  
  12. Global $yesno = 1
  13. Global $endit = 0
  14. Global $sX=60;
  15. Global $sY=370;
  16. Global $eX=320;
  17. Global $eY=620;
  18. Global $mouseX, $mouseY;
  19. Local $Title = "Cookie"
  20.  
  21. WinSetOnTop($Title, "", 0)
  22. WinActivate($Title, "")
  23.  
  24. ;; Set mouse into position
  25. Clicky()
  26.  
  27. ;; Start the loop
  28. While 1
  29.    If $yesno = 1 Then
  30.       MouseMove($mouseX, $mouseY, 10) ;; Prevents mass clicking an icon.
  31.       MouseClick("left")
  32.      
  33.       $mouseX += 20
  34.      
  35.       If $mouseX > $eX Then
  36.          $mouseX = $sX
  37.          $mouseY += 10
  38.          If $mouseY > $eY Then $mouseY = $sY
  39.       EndIf
  40.    EndIf
  41.    
  42.    If $endit = 1 Then ExitLoop
  43. WEnd
  44.  
  45. ;; Goodbye
  46. MsgBox(4096, "Exit", "Clicking down...", 2)
  47.  
  48. ;; THE FUNCTIONS
  49. Func Clicky()
  50.    $mouseX = $sX
  51.    $mouseY = $sY
  52.    $yesno = 1
  53. EndFunc
  54.  
  55. Func PauseC()
  56.     $yesno = 0
  57.  EndFunc
  58.  
  59. Func Yesno()
  60.    If $yesno = 0 Then
  61.       Clicky()
  62.    Else
  63.       PauseC()
  64.    EndIf
  65. EndFunc
  66.  
  67. Func Terminate()
  68.    $endit = 1
  69. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement