Macros 自动热键图像搜索功能不工作
你好吗 我使用的是AHK v1.1.33.06,我正在尝试执行一个简单的脚本,试图在整个屏幕上找到一个图像,但它从来没有工作过,我可以在屏幕上看到图像,但代码不能哈哈 我还试图寻找完整图像的一部分,但我得到了相同的错误 这是我的代码:Macros 自动热键图像搜索功能不工作,macros,autohotkey,Macros,Autohotkey,你好吗 我使用的是AHK v1.1.33.06,我正在尝试执行一个简单的脚本,试图在整个屏幕上找到一个图像,但它从来没有工作过,我可以在屏幕上看到图像,但代码不能哈哈 我还试图寻找完整图像的一部分,但我得到了相同的错误 这是我的代码: #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. #SingleInstance, Force SendMode Input ; Re
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance, Force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode Pixel
WinActivate, Kakele
while 1 = 1
{
sleep, 5000
;ImageSearch, OutputVarX, OutputVarY, 0, 0, 711, 343, Reflect.bmp
ImageSearch,x,y,0,0,%A_ScreenWidth%,%A_ScreenHeight%, *w12 *h12 Reflect.JPG
if (ErrorLevel = 2)
MsgBox Could not conduct the search.
else if (ErrorLevel = 1)
MsgBox Icon could not be found on the screen.
else
MsgBox The icon was found at %x%x%y%.
;sleep, 100
}
return
我尝试使用jpg、png和bmp格式,但我的代码从未找到该格式。我尝试了*w12和*h12,因为这是图像片段的分辨率
请看我正在寻找的图片,第一个是整个游戏的完整屏幕,第二个是左上角图标的碎片,双剑一个
是否有任何暗示或我做错了什么?我快发疯了,因为这件事