1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
| sx = Plugin.Sys.GetScRX() sy = Plugin.Sys.GetScRY()
Rem Loop1 Do NowTime = Time
SWTime = "02:30" If Hour(SWTime) = Hour(NowTime) and Minute(SWTime) = Minute(NowTime) Then Exit Do End If Loop
LogStart "C:\reboot_v3.log" TracePrint "-------" TracePrint "程序开始" Call Login() FindPic sx / 2, sy / 2, sx, sy, "Attachment:\2.bmp", 0.8, int4M, int4N TracePrint "任务栏登陆成功图片 X轴坐标" & int4M TracePrint "任务栏登陆成功图片 Y轴坐标" & int4N Delay 100 While int4M < 0 and int4N < 0 TracePrint "看来得重新登陆一遍" Call Lib.系统.结束进程("进程名") Delay 2000 RunApp "应用程序完整路径" Delay 5000 Call 子程序2() Delay 600 Call 子程序3() FindPic sx / 2, sy / 2, sx, sy, "Attachment:\2.bmp", 0.8, int4M, int4N Delay 1000 TracePrint "继续检查是否登录成功" Delay 100 TracePrint "任务栏登陆成功图片 X轴坐标" & int4M TracePrint "任务栏登陆成功图片 Y轴坐标" & int4N Wend TracePrint "登陆成功,执行完毕" TracePrint "等待下一次执行" TracePrint "-------" LogStop Goto Loop1
Sub Login() Call 子程序1() Delay 1000 Call 子程序2() Delay 600 Call 子程序3() End Sub
Sub 子程序1() FindPic 0, 0, sx, sy, "Attachment:\1.bmp", 0.9, intX, intY If intX < 0 And intY < 0 Then TracePrint "远程桌面似乎已关闭,终止运行" LogStop EndScript End If Hwnd = Plugin.Window.Find(0, "应用窗口名") Delay 2000 Call Plugin.Window.Close(Hwnd) Delay 2000 RunApp "应用程序完整路径" TracePrint "开始子程序1,应用程序已启动" End Sub
Sub 子程序2() TracePrint "开始子程序2,调出登陆框" Delay 1000
Delay 400 End If End Sub
Sub 子程序3() TracePrint "开始子程序3,输入密码并登陆" Delay 1000 FindPic 0, 0, sx, sy, "Attachment:\4.bmp", 0.9, int3X, int3Y TracePrint "输入框X轴坐标" & int3X TracePrint "输入框Y轴坐标" & int3Y Delay 100 If int3X > 0 And int3Y > 0 Then MoveTo int3X+110, int3Y+8 Delay 2000 LeftClick 1 Call Lib.键盘.KeyList("我是账号",0,20) Delay 100 KeyPress "Tab",1 Delay 2000 Call Lib.键盘.KeyList("我是密码",0,30) Delay 1000 KeyPress "Tab",1 Delay 2000 KeyPress "Enter", 1 TracePrint "登陆等待" TracePrint Time Delay 400000 TracePrint Time End If End Sub
|