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

[原创] 我是新手,大家来帮帮忙

[复制链接]
发表于 2010-3-10 16:06:19 | 显示全部楼层 |阅读模式
我试着写了一个qq2009的脚本,如下
Run("qq2009.exe")
WinWait("腾讯QQ2009 安装向导","欢迎使用腾讯QQ2009")
ControlCommand("腾讯QQ2009 安装向导","欢迎使用腾讯QQ2009","Button1","Check")
Send("!n")
WinWait("腾讯QQ2009 安装向导","自定义安装选项")
ControlCommand("腾讯QQ2009 安装向导","自定义安装选项","Button9","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","自定义安装选项","Button8","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","自定义安装选项","Button10","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","自定义安装选项","Button11","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","自定义安装选项","Button7","UnCheck")
Send("!n")
WinWait("腾讯QQ2009 安装向导","请选择安装路径")
ControlSetText("腾讯QQ2009 安装向导","请选择安装路径","Edit1","d:\backup\qq")
Send("!i")
If WinWait("腾讯QQ2009 安装向导","您选择的目录安装了旧版本") Then
Send("!y")
EndIf
WinWait("腾讯QQ2009 安装向导","安装完成")
ControlCommand("腾讯QQ2009 安装向导","安装完成","Button6","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","安装完成","Button7","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","安装完成","Button8","UnCheck")
Send("!f")
Exit


为什么红色的代码不执行?我去掉if...then ....endif后可以执行,大家给说说,先谢谢了!
发表于 2010-3-10 19:37:11 | 显示全部楼层
Run("qq2009.exe")
WinWait("腾讯QQ2009 安装向导","欢迎使用腾讯QQ2009")
ControlCommand("腾讯QQ2009 安装向导","欢迎使用腾讯QQ2009","Button1","Check")
Send("!n")
WinWait("腾讯QQ2009 安装向导","自定义安装选项")
ControlCommand("腾讯QQ2009 安装向导","自定义安装选项","Button9","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","自定义安装选项","Button8","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","自定义安装选项","Button10","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","自定义安装选项","Button11","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","自定义安装选项","Button7","UnCheck")
Send("!n")
WinWait("腾讯QQ2009 安装向导","请选择安装路径")
ControlSetText("腾讯QQ2009 安装向导","请选择安装路径","Edit1","d:\backup\qq")
Send("!i")
If WinExists("腾讯QQ2009 安装向导","您选择的目录安装了旧版本") Then
Send("!y")
EndIf
WinWait("腾讯QQ2009 安装向导","安装完成")
ControlCommand("腾讯QQ2009 安装向导","安装完成","Button6","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","安装完成","Button7","UnCheck")
ControlCommand("腾讯QQ2009 安装向导","安装完成","Button8","UnCheck")
Send("!f")
Exit
发表于 2010-3-10 19:41:14 | 显示全部楼层
本帖最后由 jybb001 于 2010-3-10 19:42 编辑

为什么要用ControlCommand呢那么麻烦

以后是我用程序自动生成的代码

; -------安装脚本开始--------By jybb001 QQ:576022718



run("C:\Downloads\QQ2009_chs.exe")
WinWaitActive("腾讯QQ2009 安装向导")
sleep(1520)
ControlClick("腾讯QQ2009 安装向导","","Button1")
sleep(720)
ControlClick("腾讯QQ2009 安装向导","","Button3")
sleep(1360)
ControlClick("腾讯QQ2009 安装向导","","Button11")
sleep(320)
ControlClick("腾讯QQ2009 安装向导","","Button10")
sleep(400)
ControlClick("腾讯QQ2009 安装向导","","Button8")
sleep(400)
ControlClick("腾讯QQ2009 安装向导","","Button9")
sleep(880)
ControlClick("腾讯QQ2009 安装向导","","Button2")
sleep(1360)
ControlClick("腾讯QQ2009 安装向导","","Button2")
sleep(10880)
ControlClick("腾讯QQ2009 安装向导","","Button8")
sleep(320)
ControlClick("腾讯QQ2009 安装向导","","Button7")
sleep(320)
ControlClick("腾讯QQ2009 安装向导","","Button6")
sleep(800)
ControlClick("腾讯QQ2009 安装向导","","Button2")
稍做修改就行了
发表于 2010-3-11 13:40:48 | 显示全部楼层
复制了去试试,感谢!
 楼主| 发表于 2010-3-12 20:29:20 | 显示全部楼层
谢谢大家!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-21 22:46 , Processed in 0.074443 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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