|
|
本帖最后由 creativewwz 于 2011-4-26 19:31 编辑
- FileInstall("QMDispatch.dll", @SystemDir & "\QMDispatch.dll")
- FileInstall("helper.dll", @SystemDir & "\helper.dll")
- FileInstall("WinIo.dll", @SystemDir & "\WinIo.dll")
- RunWait("Regsvr32 /s " & @SystemDir & "\QMDispatch.dll")
- $obj = ObjCreate("QMDispatch.QMFunction")
- ;循环查找图片
- While 1
- $pos = _FindPic(1, 1, @DesktopWidth, @DesktopHeight, @ScriptDir & "\start.bmp", 1)
- If $pos[0] > 0 Or $pos[1] > 0 Then ;如果$pos[0] > 0 与 $pos[1] > 1 说明找到图片.
- MouseClick('left',$pos[0] + 40 ,$pos[1] + 10,1,0);发送鼠标点击
- Sleep(500)
- MouseMove(500, 500, 0)
-
- EndIf
- Sleep(10)
- WEnd
- Func _FindPic($iLeft, $iTop, $iRight, $iBottom, $szFileName, $fSimilar)
- Dim $pos[2]
- $foundpixel = $obj.FindPic($iLeft, $iTop, $iRight, $iBottom, $szFileName, $fSimilar)
- $pos[0] = Int($foundpixel / 8192)
- $pos[1] = Mod($foundpixel, 8192)
- Return $pos
- EndFunc ;==>_FindPic
- ;如何能找到图片后,退出循环,向下运行?
- Sleep(1000)
- MouseClick("left", 0, 500, 2)
复制代码 |
|