Guest User

Reddit Zero Hour Clicker

a guest
Apr 5th, 2015
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance Force
  2. #Persistent
  3. area_count=0
  4. area_count2=0
  5. CoordMode, Mouse, Screen
  6. CoordMode, Pixel, Screen
  7.  
  8. ;===Hotkeys=========================================================================
  9.  
  10. ^Lbutton:: ;Ctrl+Left click and drag to define search area for the first (left) number 0, credit to Giorgio/Leef_me
  11. MouseGetPos, MX, MY
  12. Gui, +AlwaysOnTop -caption +Border +ToolWindow +LastFound
  13. WinSet, Transparent, 80
  14. Gui, Color, lime
  15.  
  16.  
  17. While, (GetKeyState("LButton", "p"))
  18. {
  19.     MouseGetPos, MXend, MYend
  20.     Send {control up}
  21.     w := abs(MX - MXend)
  22.     h := abs(MY - MYend)
  23.     If ( MX < MXend )
  24.         X := MX
  25.     Else
  26.         X := MXend
  27.     If ( MY < MYend )
  28.         Y := MY
  29.     Else
  30.         Y := MYend
  31.     Gui, Show, x%X% y%Y% w%w% h%h%
  32.     Sleep, 10
  33. }
  34.  
  35.  
  36. MouseGetPos, MXend, MYend
  37. Gui, Destroy
  38. If ( MX > MXend )
  39. {
  40.     temp := MX
  41.     MX := MXend
  42.     MXend := temp
  43. }
  44.  
  45. If ( MY > MYend )
  46. {
  47.     temp := MY
  48.     MY := MYend
  49.     MYend := temp
  50. }
  51. area_count++
  52. Area%area_count% = %MX%, %MY%, %MXend%, %MYend%
  53. ;Sleep, 100 ; if omitted, GUI sometimes stays in picture
  54. Return
  55.  
  56. ^Rbutton:: ;Ctrl+Right click and drag to define search area for the second (right) number 0, credit to Giorgio/Leef_me
  57. MouseGetPos, MX2, MY2
  58. Gui, +AlwaysOnTop -caption +Border +ToolWindow +LastFound
  59. WinSet, Transparent, 80
  60. Gui, Color, blue
  61.  
  62.  
  63. While, (GetKeyState("RButton", "p"))
  64. {
  65.     MouseGetPos, MXend2, MYend2
  66.     Send {control up}
  67.     w := abs(MX2 - MXend2)
  68.     h := abs(MY2 - MYend2)
  69.     If ( MX2 < MXend2 )
  70.         X := MX2
  71.     Else
  72.         X := MXend2
  73.     If ( MY2 < MYend2 )
  74.         Y := MY2
  75.     Else
  76.         Y := MYend2
  77.     Gui, Show, x%X% y%Y% w%w% h%h%
  78.     Sleep, 10
  79. }
  80.  
  81.  
  82. MouseGetPos, MXend2, MYend2
  83. Gui, Destroy
  84. If ( MX2 > MXend2 )
  85. {
  86.     temp2 := MX2
  87.     MX2 := MXend2
  88.     MXend2 := temp2
  89. }
  90.  
  91. If ( MY2 > MYend2 )
  92. {
  93.     temp2 := MY2
  94.     MY2 := MYend2
  95.     MYend2 := temp2
  96. }
  97. area_count2++
  98. Area%area_count2% = %MX2%, %MY2%, %MXend2%, %MYend2%
  99. ;Sleep, 100 ; if omitted, GUI sometimes stays in picture
  100. Return
  101.  
  102. F11::listvars
  103.  
  104. ]:: ;Set Button Location
  105. MouseGetPos, MXPress, MYPress
  106. ;MsgBox %MXPress% | %MYPress%
  107. Return
  108.  
  109. ':: ;arm and verify location set properly
  110. Click %MXPress%, %MYPress%
  111. ;MsgBox Click! This would click at %MXPress% | %MYPress%
  112. Return
  113.  
  114. [:: ; Initialize Search, click when found
  115. Loop,
  116. {
  117.     ImageSearch, , , %MX%, %MY%, %MXend%, %MYend%, *170 Reddit Zero Button.png
  118.     If ErrorLevel = 0
  119.     {
  120.         ImageSearch, , , %MX2%, %MY2%, %MXend2%, %MYend2%, *170 Reddit Zero Button.png
  121.         If ErrorLevel = 0
  122.         {
  123.             Click %MXPress%, %MYPress%
  124.             ;MsgBox Click! This would click the button, did it find the zero, or misfire?
  125.             Suspend
  126.             ExitApp
  127.         }
  128.     }  
  129.        
  130. }
  131. Return ;I...don't think this return will ever be reached though
  132.  
  133. Escape::
  134. Suspend
  135. ExitApp
  136.  
  137. ;Made by bloodstar23, selection parts blatantly stolen from http://www.autohotkey.com/board/topic/112071-how-to-select-screen-region-save-coordinate-with-mouse/
Advertisement
Add Comment
Please, Sign In to add comment