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

[原创] 酷狗音乐2010自动安装脚本

  [复制链接]
发表于 2010-10-22 13:13:03 | 显示全部楼层 |阅读模式
新手学习AU3,HOHO
if判断写得不怎么好,希望大家给点建议!
#cs ____________________________________

 Au3 版本: v3.3.6.1
 脚本作者: ChaseDream
        Email: 76993559@qq.com
        QQ/TM: 76993559
 脚本版本: 6.1.28.472
 脚本功能: 酷狗音乐2010

#ce _______________脚本开始_________________
#region ---Au3Recorder generated code Start ---
Opt("WinWaitDelay",100)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

Dim $AppName = "[CLASS:TWizardForm]"
Dim $App = @ScriptDir&"\KuGou2010.exe"
Dim $installpath = "D:\Program Files\KuGou\KuGou2010"

Run($App)
_WinWaitActivate($AppName,"欢迎使用 酷狗音乐 安装向导")
ControlClick($AppName,"","[CLASS:TNewButton; INSTANCE:1]")
_WinWaitActivate($AppName,"我已阅读并接受用户许可协议")
ControlClick($AppName,"","[CLASS:TNewButton; INSTANCE:2]")
_WinWaitActivate($AppName,"安装程序将把 酷狗音乐 安装到以下文件夹。")
ControlSetText($AppName,"","[CLASS:TEdit; INSTANCE:1]",$installpath)
ControlClick($AppName,"","[CLASS:TNewButton; INSTANCE:3]")

While 1
If WinExists($AppName," 酷狗音乐推荐安装以下绿色软件") Then
ControlCommand($AppName,"","[CLASS:TNewCheckListBox; INSTANCE:1]","Check")
ControlClick($AppName,"","[CLASS:TNewButton; INSTANCE:3]")
_WinWaitActivate($AppName,"酷狗音乐 安装完毕")
Send("{SPACE},{TAB},{SPACE},{TAB},{SPACE},{TAB},{SPACE}")
ControlClick($AppName,"","[CLASS:TNewButton; INSTANCE:3]")
ExitLoop
ElseIf WinExists($AppName,"酷狗音乐 安装完毕") Then
Send("{SPACE},{TAB},{SPACE},{TAB},{SPACE},{TAB},{SPACE}")
ControlClick($AppName,"","[CLASS:TNewButton; INSTANCE:3]")
ExitLoop
EndIf
WEnd

;清除多余文件
FileDelete(@AppDataDir&"\Microsoft\Internet Explorer\Quick Launch\酷狗音乐2010.lnk")
FileDelete(@ProgramsCommonDir&"\酷狗音乐\酷狗音乐2010\最新网页游戏.lnk")
FileDelete(@StartMenuCommonDir&"\酷狗音乐2010.lnk")
FileDelete(@ProgramsCommonDir&"\酷狗音乐2010.lnk")

#region --- Internal functions Au3Recorder Start ---
Func _WinWaitActivate($title,$text,$timeout=0)
        WinWait($title,$text,$timeout)
        If Not WinActive($title,$text) Then WinActivate($title,$text)
        WinWaitActive($title,$text,$timeout)
EndFunc
#endregion --- Internal functions Au3Recorder End ---

#endregion --- Au3Recorder generated code End ---
发表于 2010-10-23 12:09:54 | 显示全部楼层
你这个好像不能成功安装你 判断那里有问题
 楼主| 发表于 2010-10-25 09:31:59 | 显示全部楼层
呵呵,好像可以吧。我测试成功了!

我也觉得if判断那里写得不好
发表于 2010-12-12 22:01:59 | 显示全部楼层
路过支持下
发表于 2011-1-9 17:28:04 | 显示全部楼层
好像都用不了啊  。  郁闷哦
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-22 00:22 , Processed in 0.073494 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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