AU3代碼含義
有哪位高手幫忙解釋下下面的含義,謝謝!if FileExists ("c:\Program Files\Futuremark\3DMark03\3DMark03.exe") then
$PID=RUN ("c:\Program Files\Futuremark\3DMark03\3DMark03.exe")
Else
if FileExists ("d:\Program Files\Futuremark\3DMark03\3DMark03.exe") then
$PID=RUN ("d:\Program Files\Futuremark\3DMark03\3DMark03.exe")
Else
MsgBox(33,"","Don't find <d:\Program Files\Futuremark\3DMark03\3DMark03.exe!>Do you want to install the 3DMARK to D:\ ?")
$var=FileOpenDialog("Installation of 3DMARK 2003","D:","EXE(3D*.EXE)",1+2)
If @error Then
MsgBox(4096,"","Not find, 3DMark03 installation files!")
Exit
Else
$PID=RUN( $VAR)
WinWaitActive("3DMark03 - InstallShield Wizard","Welcome to the InstallShield Wizard for 3DMark03 (version 3.6.0)")
send("!n")
WinWaitActive("3DMark03 - InstallShield Wizard","3DMark03 - S O F T W A R E L I C E N C E A G R E E M E")
send("!a")
Sleep(10)
send("!n")
WinWaitActive("3DMark03 - InstallShield Wizard","C:\Program Files\Futuremark\3DMark03")
send("!r")
WinWaitActive("Choose Folder","Please select the installation folder.")
ControlSend("Choose Folder","Please select the installation folder.","Edit1","d:\Program Files\Futuremark\3DMark03")
WinWaitActive("Choose Folder","d:\Program Files\Futuremark\3DMark03")
ControlClick("Choose Folder","Please select the installation folder.","Button1")
WinWaitActive("3DMark03 - InstallShield Wizard","d:\Program Files\Futuremark\3DMark03")
send("!n")
WinWaitActive("3DMark03 - InstallShield Wizard","Click Install to begin the installation")
Send("!I")
AdlibEnable ("sn")
WinWaitActive("3DMark03 - InstallShield Wizard","The InstallShield Wizard has successfully installed 3DMark03")
AdlibDisable()
ControlClick("3DMark03 - InstallShield Wizard","The InstallShield Wizard has successfully installed 3DMark03","Button1")
ControlClick("3DMark03 - InstallShield Wizard","The InstallShield Wizard has successfully installed 3DMark03","Button2")
Sleep(10)
ControlClick("3DMark03 - InstallShield Wizard","The InstallShield Wizard has successfully installed 3DMark03","Button4")
$PID=RUN ("d:\Program Files\Futuremark\3DMark03\3DMark03.exe")
EndIf
EndIf
AdlibEnable("Tip")
WinWaitActive("3DMark03 - Professional Edition","Game Test 1")
ControlClick("3DMark03 - Professional Edition","Game Test 1","Button6")
AdlibDisable()
WinWaitActive("Benchmark Settings","Post-processing")
ControlCommand("Benchmark Settings","Post-processing","ComboBox1","selectstring","1024 x 768")
ControlClick("Benchmark Settings","","Button8")
Sleep(100)
ControlClick("3DMark03 - Professional Edition","","Button1")
ProcessWaitClose($PID)
$3D=MsgBox(4097,"3D TEST","3DMark03 Test OK ?")
If 1 = $3D Then
Exit(0)
Else
Exit(1)
EndIf
EndIf
Func sn()
if WinActive("3DMark03 - InstallShield Wizard","Purchase Online") Then
ControlSend("3DMark03 - InstallShield Wizard","Registration Code","Edit1","UZCMS-0FCVE-R3N6L-6U1JN")
WinActive("3DMark03 - InstallShield Wizard","UZCMS-0FCVE-R3N6L-6U1JN")
send("!n")
if WinActive("Congratulations!","")Then
ControlClick("Congratulations!","","Button1")
EndIf
EndIf
EndFunc
Func tip()
if WinActive("Tip Of The Day","Do not show this dialog again")Then
ControlClick("Tip Of The Day","Do not show this dialog again","Button3")
sleep(10)
ControlClick("Tip Of The Day","Do not show this dialog again","Button1")
sleep(10)
EndIf
if WinActive("3DMark03 - Free Version","") Then
ControlClick("3DMark03 - Free Version","","Button9")
WinWaitActive("Register 3DMark03","")
ControlSend("Register 3DMark03","","Edit1","UZCMS-0FCVE-R3N6L-6U1JN")
WinActive("Register 3DMark03","UZCMS-0FCVE-R3N6L-6U1JN")
;send("!n")
ControlClick("Register 3DMark03","","Button1")
WinWaitActive("3DMark03","Thank you for registering 3DMark03")
ControlClick("3DMark03","","Button1")
EndIf
EndFunc 发错地方了吧?! 本帖最后由 17911 于 2009-6-4 14:35 编辑
看帮助,粗略看一下,首先判断c:\Program Files\Futuremark\3DMark03\3DMark03.exe是否存在,如果不存在则运行d:\Program Files\Futuremark\3DMark03\3DMark03.exe,还不存在信息提示,下面是自动安装3DMark03.exe脚本,具体看帮助的函数注释很容易理解,楼主去学习一下软件自动安装教程,资料区有 WinActive
--------------------------------------------------------------------------------
检查指定的窗口是否存在且当前被激活.
WinActive ( "窗口标题" [, "窗口文本"] )
ControlClick
--------------------------------------------------------------------------------
向指定控件发送鼠标点击命令.
ControlClick ( "标题", "文本", 控件ID [, 按键 [, 点击次数 [, X坐标 [, Y坐标 ]]]] )
参数
标题 目标窗口标题.
文本 目标窗口文本.
控件ID 目标控件. 参照 控件.
按键 [可选参数] 要点击的按钮, 可以是"left"(左), "right"(右), "middle"(中), "main", "menu", "primary", "secondary". 默认为left(左键).
点击次数 [可选参数] 要点击鼠标按钮的次数. 默认值为 1.
x坐标 [可选参数] 要点击控件的位置(X坐标). 默认为控件中心.
y坐标 [可选参数] 要点击控件的位置(Y坐标). 默认为控件中心. 学习了
... 學習中.................. autoit的基本语句和应用 看看:face (12)::face (12): 高强度大规模学习中…… 建议转移或删除此贴
页:
[1]