maybe131420 发表于 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


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

wuweixian 发表于 2010-6-10 20:49:08

{:face (84):}

xxdahai 发表于 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代替了 原理都是一样滴

maybe131420 发表于 2010-6-10 21:06:51

初学,你说的有点不懂,能详细说下吗,谢谢

lsh127k 发表于 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("", "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", "")
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", "")

ControlClick("WinZip 14.5 Setup", "WinZip User Feedback", "")
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("")
WinClose("")
MsgBox(64, "", "Winzip已经安装完成。", 30)

xxdahai 发表于 2010-6-11 16:19:22

就是啥意思呢你要点的那三个选项除了用移动鼠标点击以外 还可以通过键盘来实现 你可以自己安装一下看看WinWaitActive ("安装 - 酷狗音乐","酷狗音乐 安装完毕") 这个意思是等待出现这个窗口,只有出现了这个窗口的时候才会有那三个选项; Send ("{SPACE}") 的意思是按个空格 Send ("{TAB}") 意思是按个“tab”按键,Sleep ("200") 是等待0.2秒 防止出错用的,你可以自己做实验的啊按个空格就会取消到这个选项 按tab是切换到下一个选项上 再按空格。。。。 我的意思应该是够明白了吧   自己汗一个先~~~~

maybe131420 发表于 2010-6-12 16:40:13

谢谢各位大大的帮助,非常感谢~学习了

haptap 发表于 2010-6-13 20:15:41

用controlclick可以解决

pdp320921 发表于 2011-2-24 14:10:27

“如果屏幕的分辨率变了,或者显示器不同,那这坐标就不能通用了”有解?
页: [1]
查看完整版本: [已解决]软件安装的鼠标坐标去勾怎么设置函数