找回密码
 加入
搜索
查看: 3655|回复: 8

[AU3基础] [已解决]软件安装的鼠标坐标去勾怎么设置函数

  [复制链接]
发表于 2010-6-10 20:47:36 | 显示全部楼层 |阅读模式
本帖最后由 maybe131420 于 2010-6-12 17:02 编辑

run("kugou.exe")
dim $A="安装 - 酷狗音乐2008"
WinWaitActive($A,"欢迎使用 酷狗音乐2008 安装向导")
send("!n")
WinWaitActive($A,"许可协议")
send("!n")
WinWaitActive($A,"选择目标位置")
send("!n")
WinWaitActive($A,"准备安装")
send("!i")
WinSetOnTop($A,"酷狗音乐2008 安装完毕",1)
WinMove($A,"酷狗音乐2008 安装完毕",203,219,605,407)
WinWaitActive($A,"酷狗音乐2008 安装完毕")
MouseClick( "left",428,465,1)
MouseClick( "left",428,491,1)
MouseClick( "left",428,514,1)
WinWaitActive($A,"酷狗音乐2008 安装完毕")
send("!f")
Exit


以上是本人编的代码,我想问的是,如果屏幕的分辨率变了,或者显示器不同,那这坐标就不能通用了,有没有大虾能解答下如何编个通用的函数,本人初学,望高手指教,谢谢~

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-6-10 20:49:08 | 显示全部楼层
发表于 2010-6-10 21:02:41 | 显示全部楼层
本帖最后由 xxdahai 于 2010-6-10 21:24 编辑

楼主 不能模拟鼠标点击哇 直接读取要点击的button值  然后发送鼠标点击函数到此button啊
你那么整不行滴~~~

我刚才看了一下 发现最后要点的那三个地方控件名都是一个
你可以变通一下啊  写上
WinWaitActive ("安装 - 酷狗音乐","酷狗音乐 安装完毕")
Send ("{SPACE}")
Sleep ("200")
Send ("{TAB}")
Sleep ("200")
Send ("{SPACE}")
Sleep ("200")
Send ("{TAB}")
Sleep ("200")
Send ("{SPACE}")
Sleep ("200")
Send ("{LALT}f")
发送空格加tab来代替鼠标点击
手头没有酷狗2008 就用2010代替了 原理都是一样滴

评分

参与人数 1金钱 +10 收起 理由
afan + 10

查看全部评分

 楼主| 发表于 2010-6-10 21:06:51 | 显示全部楼层
初学,你说的有点不懂,能详细说下吗,谢谢
发表于 2010-6-11 10:55:38 | 显示全部楼层
你可以用controlclick(),这中方式准确的多。我自己做了一个Winzip的自动安装


#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\20100609090345942.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;自动安装Winzip14.5

Opt("WinWaitDelay",100)

Run("winzip145.exe")
WinWaitActive("[CLASS:#32770;]", "Thank you for your interest in WinZip!")

ControlClick("WinZip", "Thank you for your interest in WinZip!", 1)
WinWaitActive("WinZip 14.5 Setup", "Welcome to the WinZip 14.5 Installation Wizard")

ControlClick("WinZip 14.5 Setup", "Welcome to the WinZip 14.5 Installation Wizard", 1090)
;MsgBox(0,"11","11")
WinWaitActive("WinZip 14.5 Setup", "WinZip License Agreemen")

ControlClick("WinZip 14.5 Setup", "WinZip License Agreemen", 1081)

ControlClick("WinZip 14.5 Setup", "WinZip License Agreemen", 1090)
WinWaitActive("WinZip 14.5 Setup", "Select a folder where the application will be installed")

ControlClick("WinZip 14.5 Setup", "Select a folder where the application will be installed", "[CLASS:Button; INSTANCE:1]")
WinWaitActive("WinZip 14.5 Setup", "Check the items you want installed")

ControlClick("WinZip 14.5 Setup", "Check the items you want installed", 1090)
WinWaitActive("WinZip 14.5 Setup", "Please select the default compression method for WinZip")

ControlClick("WinZip 14.5 Setup", "Please select the default compression method for WinZip", 1857)

ControlClick("WinZip 14.5 Setup", "Please select the default compression method for WinZip", 1090)
WinWaitActive("WinZip 14.5 Setup", "WinZip User Feedback")

ControlClick("WinZip 14.5 Setup", "WinZip User Feedback", "[CLASS:Button; INSTANCE:5]")

ControlClick("WinZip 14.5 Setup", "WinZip User Feedback", "[ID:1090]")
WinWaitActive("WinZip 14.5 Setup", "Click Next to begin the installation")

ControlClick("WinZip 14.5 Setup", "Click Next to begin the installation", 1088)
WinWaitActive("WinZip Setup", "Express Setup associates WinZip with archives")

ControlClick("WinZip Setup", "Express Setup associates WinZip with archives", 8102)
WinWaitActive("WinZip Setup", "WinZip needs to associate itself with your archives")

ControlClick("WinZip Setup", "WinZip needs to associate itself with your archives", 8102)
WinWaitActive("WinZip 14.5 Setup", "Click the Finish button to exit this installation")

ControlClick("WinZip 14.5 Setup", "Click the Finish button to exit this installation", 165)

ControlClick("WinZip 14.5 Setup", "Click the Finish button to exit this installation", 1084)
WinWaitActive("[TITLE:WinZip; CLASS:Chrome_WidgetWin_0]")
WinClose("[TITLE:WinZip; CLASS:Chrome_WidgetWin_0]")
MsgBox(64, "", "Winzip已经安装完成。", 30)

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2010-6-11 16:19:22 | 显示全部楼层
就是啥意思呢  你要点的那三个选项除了用移动鼠标点击以外 还可以通过键盘来实现 你可以自己安装一下看看  WinWaitActive ("安装 - 酷狗音乐","酷狗音乐 安装完毕") 这个意思是等待出现这个窗口,只有出现了这个窗口的时候才会有那三个选项; Send ("{SPACE}") 的意思是按个空格 Send ("{TAB}") 意思是按个“tab”按键,Sleep ("200") 是等待0.2秒 防止出错用的,你可以自己做实验的啊  按个空格就会取消到这个选项 按tab是切换到下一个选项上 再按空格。。。。 我的意思应该是够明白了吧   自己汗一个先~~~~
 楼主| 发表于 2010-6-12 16:40:13 | 显示全部楼层
谢谢各位大大的帮助,非常感谢~学习了
发表于 2010-6-13 20:15:41 | 显示全部楼层
用controlclick可以解决
发表于 2011-2-24 14:10:27 | 显示全部楼层
如果屏幕的分辨率变了,或者显示器不同,那这坐标就不能通用了”有解?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-10-2 14:38 , Processed in 0.081985 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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