【问题标题】:AutoHotKey - ImageSearch Two ImagesAutoHotKey - ImageSearch 两个图像
【发布时间】:2013-11-21 03:22:17
【问题描述】:

有没有办法让 AutoHotKey 上的 ImageSearch 命令查找两个图像

目前我的代码是这样的:

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

有时屏幕会显示在图像上,有时会显示另一个,所以我的代码经常停止运行,因为它找不到图像。我怎样才能做出“或”类型的声明,让 ImageSearch 查找两个图像并单击显示的任何内容?

谢谢!

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    如果没有找到第一个图像,只需再进行一次图像搜索:

    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
    

    【讨论】:

      猜你喜欢
      • 2019-06-19
      • 1970-01-01
      • 2019-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-12
      • 2013-07-11
      • 1970-01-01
      相关资源
      最近更新 更多