Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. #Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5.  
  6. CoordMode, Mouse, Screen
  7. CoordMode, Pixel, Screen
  8. Gui, 1: +AlwaysOnTop
  9. Gui, 1: Add, Button, x10 y10 w200 h20 gFind_Image, Begin
  10. Gui, 1: Add, Text, x10, Press Numpad 1 to stop.
  11. Gui, 1: Show, x1000 y200
  12. return
  13. 1GuiClose:
  14.     ExitApp
  15.  
  16. Find_Image:
  17.     Stop := 0
  18.     While !Stop
  19.         {
  20.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_1.png
  21.             If !ErrorLevel
  22.             {  
  23.                 tx := Loc_X
  24.                 ty := Loc_Y
  25.                 click, %tx% %ty%
  26.             }
  27.            
  28.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_2.png
  29.             If !ErrorLevel
  30.             {  
  31.                 tx := Loc_X
  32.                 ty := Loc_Y
  33.                 click, %tx% %ty%
  34.             }
  35.            
  36.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_3.png
  37.             If !ErrorLevel
  38.             {  
  39.                 tx := Loc_X
  40.                 ty := Loc_Y
  41.                 click, %tx% %ty%
  42.             }
  43.            
  44.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_4.png
  45.             If !ErrorLevel
  46.             {  
  47.                 tx := Loc_X
  48.                 ty := Loc_Y
  49.                 click, %tx% %ty%
  50.             }
  51.            
  52.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_5.png
  53.             If !ErrorLevel
  54.             {  
  55.                 tx := Loc_X
  56.                 ty := Loc_Y
  57.                 click, %tx% %ty%
  58.             }
  59.            
  60.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_6.png
  61.             If !ErrorLevel
  62.             {  
  63.                 tx := Loc_X
  64.                 ty := Loc_Y
  65.                 click, %tx% %ty%
  66.             }
  67.            
  68.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_7.png
  69.             If !ErrorLevel
  70.             {  
  71.                 tx := Loc_X
  72.                 ty := Loc_Y
  73.                 click, %tx% %ty%
  74.             }
  75.            
  76.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_8.png
  77.             If !ErrorLevel
  78.             {  
  79.                 tx := Loc_X
  80.                 ty := Loc_Y
  81.                 click, %tx% %ty%
  82.             }
  83.            
  84.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_9.png
  85.             If !ErrorLevel
  86.             {  
  87.                 tx := Loc_X
  88.                 ty := Loc_Y
  89.                 click, %tx% %ty%
  90.             }
  91.            
  92.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_10.png
  93.             If !ErrorLevel
  94.             {  
  95.                 tx := Loc_X
  96.                 ty := Loc_Y
  97.                 click, %tx% %ty%
  98.             }
  99.            
  100.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_11.png
  101.             If !ErrorLevel
  102.             {  
  103.                 tx := Loc_X
  104.                 ty := Loc_Y
  105.                 click, %tx% %ty%
  106.             }
  107.            
  108.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_12.png
  109.             If !ErrorLevel
  110.             {  
  111.                 tx := Loc_X
  112.                 ty := Loc_Y
  113.                 click, %tx% %ty%
  114.             }
  115.            
  116.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_13.png
  117.             If !ErrorLevel
  118.             {  
  119.                 tx := Loc_X
  120.                 ty := Loc_Y
  121.                 click, %tx% %ty%
  122.             }
  123.            
  124.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_14.png
  125.             If !ErrorLevel
  126.             {  
  127.                 tx := Loc_X
  128.                 ty := Loc_Y
  129.                 click, %tx% %ty%
  130.             }
  131.            
  132.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_15.png
  133.             If !ErrorLevel
  134.             {  
  135.                 tx := Loc_X
  136.                 ty := Loc_Y
  137.                 click, %tx% %ty%
  138.             }
  139.            
  140.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_16.png
  141.             If !ErrorLevel
  142.             {
  143.                 ImgFound := false
  144.                 While !ImgFound
  145.                 {
  146.                     ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_17.png
  147.                     if !ErrorLevel
  148.                     {
  149.                         tx := Loc_X
  150.                         ty := Loc_Y
  151.                         click, %tx% %ty%
  152.                     }
  153.                     ImgFound := true
  154.                 }
  155.             }
  156.            
  157.             ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_18.png
  158.             If !ErrorLevel
  159.             {
  160.                 ImgFound := false
  161.                 While !ImgFound
  162.                 {
  163.                     ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, Image_19.png
  164.                     if !ErrorLevel
  165.                     {
  166.                         tx := Loc_X
  167.                         ty := Loc_Y
  168.                         click, %tx% %ty%
  169.                     }
  170.                     ImgFound := true
  171.                 }
  172.             }
  173.            
  174.         }
  175.         return
  176.        
  177.         Numpad1::
  178.         Stop := 1
  179.         return
  180.        
  181.         *ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement