#NoTrayIcon CoordMode, Mouse, Screen ;鼠标操作坐标相对全屏 CoordMode, Pixel, Screen ;pixek操作相对全屏 Run, kcleaner.exe /scan:0 ;自动清理 WinWaitActive, 垃圾清理 ;等待激活 WinGetPos, ox, oy, ow, oh, 垃圾清理 ;获取坐标 Sleep, 5000 ;等待自动执行缓冲 Loop { WinActivate, 垃圾清理 ;强制激活 PixelSearch, Px, Py, %ox%, %oy%, % ox+ow, % Ceil(oy+oh*0.20), 0x18b957, 10, Fast ;区域找像素 ceil是把小数转为整数,像素允许偏差10 if !ErrorLevel ;找到 { MouseClick, Left, %Px%, %Py% ;点击 break ;中断循环 } else Sleep, 200 ;等待 } WinWait, ahk_class ATL:0059F3B0, , 60 ;人工确认窗口 if !ErrorLevel { WinGetPos, sx, sy, sw, sh, ahk_class ATL:0059F3B0 MouseClick, Left, % sx+sw-80, % sy+sh-40 } ;等待清理完成 Loop { WinActivate, 垃圾清理 ;强制激活 PixelSearch, Px, Py, %ox%, %oy%, % ox+30, % oy+30, 0x0BB43D, 10, Fast ;区域找像素 ceil是把小数转为整数,像素允许偏差10 if !ErrorLevel ;找到 { WinClose, 垃圾清理 break ;中断循环 } else Sleep, 200 ;等待 }