Advertisement
NJ5SkwAg

AutoRubies.ahk with two images

Mar 29th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SetControlDelay -1
  2. CoordMode Pixel, Screen
  3. ; fish area needs to be visible but not selected/active
  4. ; be very careful that the Fish_File_Name matches and that it's in the same folder as the script!
  5. ; make sure that when you take the screenshot you're in low quality mode
  6. Fish_File_Name := "4by4PixelUniqueSnippetOfTheFishInLowQualityMode.png"
  7. Fish_File_Name2 := "holidayClickable.png"
  8. f9:: ; press f9 with your game selected for the script to know where to look
  9. WinGet, actWin, ID, A
  10. loop {
  11.     WinGetPos X_Offset, Y_Offset, Width, Height, ahk_id %actWin%
  12.     ImageSearch X, Y, X_Offset, Y_Offset, Width + X_Offset, Height + Y_Offset, *30 %Fish_File_Name%
  13.     if ErrorLevel = 0
  14.         ControlClick % "x" X - X_Offset " y" Y - Y_Offset, ahk_id %actWin%,,,, NA
  15.     else
  16.     {
  17.         ImageSearch X, Y, X_Offset, Y_Offset, Width + X_Offset, Height + Y_Offset, *30 %Fish_File_Name2%
  18.         if ErrorLevel = 0
  19.             ControlClick % "x" X - X_Offset " y" Y - Y_Offset, ahk_id %actWin%,,,, NA
  20.     }
  21.     sleep 10000
  22. }
  23. f10:: reload ; f10 to stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement