无忧启动论坛

标题: 哪位兄弟帮忙看看这段au3代码 [打印本页]

作者: wjgyz740526    时间: 2010-12-10 10:22
标题: 哪位兄弟帮忙看看这段au3代码
写了一个nod2.7的au3代码以实现自动安装,考虑到xp和2003系统的不同,用了if...then语句,但是很奇怪,条件判断语句执行之后脚本就停滞不前了,代码如下:


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

MsgBox(4096, "注意!", "程序安装过程中,请不要有任何键鼠操作!", 3)
blockinput (1)
Run("setup.exe")
WinWaitActive("设定向导","欢迎使用NOD32设定程序")
ControlClick("设定向导","欢迎使用NOD32设定程序","[class:Button;ID:12324]")
WinWaitActive("最终用户软件使用协议","我同意")
ControlClick("最终用户软件使用协议","我同意","[class:Button;ID:1011]")
ControlClick("最终用户软件使用协议","我同意","[class:Button;ID:12324]")
WinWaitActive("自动更新设定","以后再设定更新参数")
ControlClick("自动更新设定","以后再设定更新参数","[class:Button;ID:3053]")
ControlClick("自动更新设定","以后再设定更新参数","[class:Button;ID:12324]")
WinWaitActive("ThreatSense.Net","预警系统")
ControlClick("ThreatSense.Net","预警系统","[class:Button;ID:12324]")
WinWaitActive("不受欢迎软件侦测","启动不受欢迎软件侦测")
ControlClick("不受欢迎软件侦测","启动不受欢迎软件侦测","[class:Button;ID:1025]")
ControlClick("不受欢迎软件侦测","启动不受欢迎软件侦测","[class:Button;ID:12324]")
WinWaitActive("文件实时监控AMON","我希望自动加载文件实时监控")
ControlClick("文件实时监控AMON","我希望自动加载文件实时监控","[class:Button;ID:12324]")
if WinWaitActive("网络监视","侦测来自互联网的入侵") then
ControlClick("网络监视","侦测来自互联网的入侵","[class:Button;ID:1000]")
ControlClick("网络监视","侦测来自互联网的入侵","[class:Button;ID:12324]")
EndIf
WinWaitActive("安装参数全部设定完毕","安装参数全部设定完毕") then
ControlClick("安装参数全部设定完毕","安装参数全部设定完毕","[class:Button;ID:12324]")
WinWaitActive("安装完成","需要重新启动")
ControlClick("安装完成","需要重新启动","[class:Button;ID:1011]")
ControlClick("安装完成","需要重新启动","[class:Button;ID:12325]")
FileDelete (@StartMenuCommonDir&"\程序\Eset\自述文件.lnk")
FileDelete (@StartMenuCommonDir&"\程序\Eset\卸载.lnk")
FileDelete (@StartMenuCommonDir&"\程序\Eset\帮助.lnk")
exit

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

xp环境下上述代码执行后,nod安装到"安装参数全部设定完毕"就停止了,2003环境正常,请问哪儿错了?该怎么写?
作者: ovemxlong    时间: 2010-12-13 19:55
if WinWaitActive("网络监视","侦测来自互联网的入侵") then
ControlClick("网络监视","侦测来自互联网的入侵","[class:Button;ID:1000]")
ControlClick("网络监视","侦测来自互联网的入侵","[class:Button;ID:12324]")
EndIf
WinWaitActive("安装参数全部设定完毕","安装参数全部设定完毕") then //这里是什么意思?上面的IF块已经关闭这个then是干嘛的?
ControlClick("安装参数全部设定完毕","安装参数全部设定完毕","[class:Button;ID:12324]")




欢迎光临 无忧启动论坛 (http://wuyou.net/) Powered by Discuz! X3.3