2013-11-21 186 views
0

有什么办法来对AutoHotkey的外观的图片搜索命令两个图像的AutoHotkey - 图片搜索两个图像

目前我的代码是这样的:

Loop 
{ 
ImageSearch, wherexis, whereyis, 664, 556, 1364, 924, C:\Users\AHK Stuff\continue.PNG 
If ! ErrorLevel 
    { 
     Click %wherexis%,%whereyis% 
     break 
    } 
} 
Sleep, 1400 

有时,图像和其他时候,它的屏幕显示因为它无法找到图像,所以我的代码经常会显示另一个代码。我如何制作一个“或”种语句来使ImageSearch查找两个图像并单击显示的内容?

谢谢!

回答

0

刚做了另外图片搜索的情况下,第一个未找到:

Loop 
{ 
    ImageSearch, wherexis, whereyis, 664, 556, 1364, 924, C:\Users\AHK Stuff\continue.PNG 
    If ! ErrorLevel 
    { ;If the first image was found: 
     Click %wherexis%,%whereyis% 
     break 
    } 
    Else 
    { ;If the first image was not found: 
     ImageSearch, wherexis, whereyis, 664, 556, 1364, 924, C:\Users\AHK Stuff\image2.PNG 
     If ! ErrorLevel 
     { ;If the second image was found: 
      Click %wherexis%,%whereyis% 
      break 
     } 
    } 
    Sleep, 100 
} 
Sleep, 1400