!4::
__ImageFilePath:=”C:T_PDF橡皮擦.png”
gui,add,picture,hwnd__mypic,%__ImageFilePath%
if FileExist(__ImageFilePath){
controlgetpos,,,__img_w,__img_h,,ahk_id %__mypic%
CoordMode Pixel
ImageSearch, __FoundX, __FoundY, 0, 0, VirtualWidth, VirtualHeight,%__ImageFilePath%
CoordMode Mouse
PicX:=__FoundX + __img_w/2
PicY:=__FoundY + __img_h/2
if (ErrorLevel=0) {
MouseGetPos, NowX, NowY
CoordMode, Mouse , Screen
__ClickX:=PicX
__ClickY:=PicY
__ClickTimes:=1
Click %__ClickX%, %__ClickY%, %__ClickTimes%
__ClickX:=NowX
__ClickY:=NowY
__ClickTimes:=0
Click %__ClickX%, %__ClickY%, %__ClickTimes%
} else {
}
} else {
}
return
以上是主代码,应该会有四五个差不多,只是!4和C:T_PDF橡皮擦.png,这两个地方不一样。
怎么改一下,不同重复主代码,把热键和图片一一对应改下就行了