Advertisement
severen1999

OLDAUTOIT PixelSearch based function

Aug 25th, 2016
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.18 KB | None | 0 0
  1. #include <Misc.au3>
  2. #include <MsgBoxConstants.au3>
  3. #include <GUIConstants.au3>
  4.  
  5. HotKeySet("{NUMPADSUB}", "TogglePause")
  6. HotKeySet("=","_exit")
  7. WinSetState("[CLASS:SciTEWindow]","",@SW_MINIMIZE)
  8. $on = 1
  9. Global $Paused
  10.  
  11. Func TogglePause()
  12.     $Paused = NOT $Paused
  13.     While $Paused
  14.         sleep(200)
  15.         ToolTip('Color Find is "Paused press Minus to resume"',1,30)
  16.     WEnd
  17.     ToolTip("")
  18. EndFunc
  19.  
  20. ;pants without hovering 0x193232
  21. ;pants while hovering   0x193232
  22.  
  23. Func _testpants()
  24.     $coord = PixelSearch(1,435,644, 565,0x193232,1,10)
  25.     If Not @error Then
  26.         $coord = PixelSearch(1,435,644, 565,0x3C6065,1,10)
  27.             if Not @error Then
  28.                 _clickfastfinish()
  29.             EndIf
  30.     EndIf
  31. EndFunc
  32.  
  33. While $on = 1
  34. ;$coord = PixelSearch(1,435,644, 565,0x54B098,1,3)
  35. ;If Not @error Then
  36. ;       ;_clickfastfinish()
  37. ;   EndIf
  38. $coord = PixelSearch(1,435,644, 565,0x54B098,1,10)
  39. If Not @error Then
  40.         $coord = PixelSearch(1,381,1206,394,0x00FFBB,1,10)
  41.         if Not @error Then
  42.         _clickfastfinish()
  43.         EndIf
  44. EndIf
  45.  
  46. $coord = PixelSearch(670, 388,1206, 667,0x54B098,1,10)
  47. If Not @error Then
  48.         $coord = PixelSearch(1,381,1206,394,0x00FFBB,1,10)
  49.         if Not @error Then
  50.         _clickfastfinish()
  51.         EndIf
  52. EndIf
  53.  
  54. $coord = PixelSearch(1,435,644, 565,0x349F82,1,10)
  55. If Not @error Then
  56.     $coord = PixelSearch(1,381,1206,394,0x00FFBB,1,10)
  57.         if Not @error Then
  58.         _clickfastfinish()
  59.         EndIf
  60. EndIf
  61.  
  62. $coord = PixelSearch(670,388,1206, 667,0x349F82,1,10)
  63. If Not @error Then
  64.     $coord = PixelSearch(1,381,1206,394,0x00FFBB,1,10)
  65.         if Not @error Then
  66.             _clickfastfinish()
  67.         EndIf
  68. EndIf
  69.  
  70.     ;small inbetween box
  71.     $coord = PixelSearch(435,565,522,746,0x349F82,1,10)
  72. If Not @error Then
  73.     $coord = PixelSearch(1,381,1206,394,0x00FFBB,1,10)
  74.         if Not @error Then
  75.         _clickfastfinish()
  76.         EndIf
  77. EndIf
  78.  
  79.  
  80.     $coord = PixelSearch(435,565,522,746,0x349F82,1,10)
  81. If Not @error Then
  82.     $coord = PixelSearch(1,381,1206,394,0x00FFBB,1,10)
  83.         if Not @error Then
  84.         _clickfastfinish()
  85.         EndIf
  86. EndIf
  87.  
  88.     ;_testpants()
  89. WEnd
  90. ;435,565,522,746
  91.  
  92. Func _clickfastfinish()
  93.     ;MouseClick("left",$bPos[0],$bPos[1],3,1)
  94.     MouseClick("left",$coord[0],$coord[1],2,1)
  95.     Sleep(25)
  96.     ;MsgBox("","","clicked")
  97. EndFunc
  98.  
  99. func _exit()
  100.     Exit
  101. endfunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement