按键精灵通用子程序备份
Dim ret, Hwnd, new_start new_start = True MessageBox "123" ExitScript ///////////////////////////////////////////////////////////////////////main Call 初始化() Do Delay 1000 TracePrint "doing......" Call 查询重卡个案() Call 处理重卡个案信息() Loop ///////////////////////////////////////////////////////////////////////main Function 处理重卡个案信息() TracePrint "处理重卡个案信息" & ":start" TracePrint "处理重卡个案信息" & ":end" 处理重卡个案信息=1 End Function Function 查询重卡个案() TracePrint "查询重卡个案" & ":start" If new_start Then //只有首次点击开关 new_start=False Call yddj(705, 79)//首次点击 Else Call yddj(828,82)//非首次点击 End If Hwnd = Plugin.Window.Find("TEPIMessageForm", "注意")//类名 标题 If Hwnd > 0 Then sRect = Plugin.Window.GetWindowRect(Hwnd) MyArray = Split(sRect, "|") //下面这句将字符串转换成数值 W1 = Clng(MyArray(0)): H1 = Clng(MyArray(1)) W2 = Clng(MyArray(2)) : H2 = Clng(MyArray(3)) W = W2 - W1//窗口大小会根据系统变化 H = H2 - H1//窗口大小会根据系统变化 End If TracePrint "查询重卡个案"&":end" End Function Function 初始化() Delay 2000 ret = 0 TracePrint "初始化" & ":start" Call yddj(283,606)//点击激活窗口 TracePrint "初始化"&":end" End Function /////////////////////////////////////////////////////////////////////// Function xxx() TracePrint "xxx"&":start" TracePrint "xxx" & ":end" xxx=0 End Function Sub yddj(x, y) TracePrint "移动点击" & x & "," & y MoveTo x, y Delay 200 LeftClick 1 Delay 1000 End Sub Function find_color(x1,y1,x2,y2,color) FindColorEx x1,y1,x2,y2,color,0,0.9,intX,intY If intX > 0 And intY > 0 Then TracePrint "find_color:ok"& color find_color = 1 Else TracePrint "find_color:失败" & color find_color = 0 End If End Function Function find_color_click(x1,y1,x2,y2,color) FindColorEx x1,y1,x2,y2,color,0,0.9,intX,intY If intX > 0 And intY > 0 Then TracePrint "find_color_click:ok" & color Call yddj(intX,intY) find_color_click = 1 Else TracePrint "find_color_click:失败" & color find_color_click = 0 End If End Function Function wait_color(x1, y1, x2, y2, color,t) For t TracePrint "wait_color......" & color Delay 1000 FindColorEx x1,y1,x2,y2,color,0,0.9,intX,intY If intX > 0 And intY > 0 Then TracePrint "wait_color:ok"& color wait_color = 1 Exit Function End If Next TracePrint "wait_color:失败" & color wait_color = 0 End Function Function wait_color_disappear(x1, y1, x2, y2, color,t) For t TracePrint "wait_color_disappear......" & color Delay 1000 FindColorEx x1,y1,x2,y2,color,0,0.9,intX,intY If intX =-1 Then TracePrint "wait_color_disappear:ok"& color wait_color_disappear = 1 Exit Function End If Next TracePrint "wait_color_disappear:失败" & color wait_color_disappear = 0 End Function Function wait_color_click(x1, y1, x2, y2, color,t) For t TracePrint "wait_color_click......" & color Delay 1000 FindColorEx x1,y1,x2,y2,color,0,0.9,intX,intY If intX > 0 And intY > 0 Then TracePrint "wait_color:ok"& color Call yddj(intX, intY) wait_color_click = 1 Exit Function End If Next TracePrint "wait_color_click:失败" & color wait_color_click = 0 End Function Function find_pic(x1, y1, x2, y2,pic) FindPic x1, y1, x2, y2,"Attachment:\"&pic,0.90,intX,intY If intX > 0 And intY > 0 Then TracePrint "find_pic:ok"& pic find_pic = 1 Else TracePrint "find_pic:失败" & pic find_pic = 0 End If End Function Function find_pic_click(x1, y1, x2, y2,pic) FindPic x1, y1, x2, y2,"Attachment:\"&pic,0.90,intX,intY If intX > 0 And intY > 0 Then TracePrint "find_pic_click:ok" & pic Call yddj(intX,intY) find_pic_click = 1 Else TracePrint "find_pic_click:失败" & pic find_pic_click = 0 End If End Function Function wait_pic(x1, y1, x2, y2,pic,t) For t Delay 1000 TracePrint "wait_pic......"& pic FindPic x1, y1, x2, y2,"Attachment:\"&pic,0.9,intX,intY If intX > 0 And intY > 0 Then TracePrint "wait_pic:ok"& pic wait_pic = 1 Exit Function End If Next TracePrint "wait_pic:超时" & pic wait_pic = 0 End Function Function wait_pic_click(x1, y1, x2, y2,pic,t) For t Delay 1000 TracePrint "wait_pic_click......"& pic FindPic x1, y1, x2, y2,"Attachment:\"&pic,0.9,intX,intY If intX > 0 And intY > 0 Then TracePrint "wait_pic_click:ok" & pic Call yddj(intX,intY) wait_pic_click = 1 Exit Function End If Next TracePrint "wait_pic_click:超时" & pic wait_pic_click = 0 End Function Function wait_pic_disappear(x1, y1, x2, y2,pic,t) For t Delay 1000 TracePrint "wait_pic_disappear......"& pic FindPic x1, y1, x2, y2,"Attachment:\"&pic,0.9,intX,intY If intX > 0 And intY > 0 Then TracePrint "wait_pic_disappear:ok" & pic wait_pic_disappear = 1 Exit Function End If Next TracePrint "wait_pic_disappear:超时" & pic wait_pic_disappear = 0 End Function
讯享网

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/38692.html