找回密码
 加入
搜索
查看: 1740|回复: 4

[AU3基础] 如何能退出循环,向下运行?谢谢 (已解决)

[复制链接]
发表于 2011-4-26 18:11:19 | 显示全部楼层 |阅读模式
本帖最后由 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)
发表于 2011-4-26 18:55:19 | 显示全部楼层
MouseMove(500, 500, 0)
后加
ExitLoop
就可以了吧?

评分

参与人数 1金钱 +20 收起 理由
creativewwz + 20 谢谢,可以啦

查看全部评分

发表于 2011-4-26 19:05:23 | 显示全部楼层
if 找到图片
then 点击
ExitLoop
endif

评分

参与人数 1金钱 +20 收起 理由
creativewwz + 20 谢谢,已解决

查看全部评分

 楼主| 发表于 2011-4-26 19:27:10 | 显示全部楼层
MouseMove(500, 500, 0)
后加
ExitLoop
就可以了吧?
posheng 发表于 2011-4-26 18:55



    可以啦,谢谢 看来我还要更加努力学习啊,谢谢!!
 楼主| 发表于 2011-4-26 19:29:35 | 显示全部楼层
if 找到图片
then 点击
ExitLoop
endif
love5173 发表于 2011-4-26 19:05



    已解决,if方法没有试!不知道怎么写,请指教
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-2 06:41 , Processed in 0.073704 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表