'---------------------后台找图B-------------------------------------

Function 找图B(pictname) // 后台找图 Dim icoord, Xy iCoord = Plugin.Bkgnd.FindPic(Hwnd, 0, 0,Lib.通用.getwindow_X(Hwnd) - 1,Lib.通用.getwindow_Y(Hwnd) - 1, bmp_path & pictname, 0, 0.6) XY = Split(iCoord,"|") 找图_intx= XY(0) 找图_inty= XY(1) If 找图_intx >= 0 and 找图_inty >= 0 Then 日志运行内容 = V_当前程序 & "B-------------->找到pict:" & pictname&"("&找图_intx&","&找图_inty&")" Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 找图B=1 Else 日志运行内容 = V_当前程序 & "B未找到pict:" & pictname Call Lib.通用.输出日志(日志运行内容) : TracePrint 日志运行内容 找图B=0 End IfEnd FunctionFunction 找图点击B(pictname, 偏移X, 偏移Y) Dim 返回值 找图点击B=0 返回值= 找图B(pictname) If 返回值 > 0 Then Call Plugin.Bkgnd.MoveTo(Hwnd, 找图_intX + cint(偏移X), 找图_intY + cint(偏移Y)) Delay 50 Call Plugin.Bkgnd.LeftClick(Hwnd, 找图_intX+cint(偏移X), 找图_intY+cint(偏移Y)) 日志运行内容 = V_当前程序 & "B---------->点击pict:" & pictname Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 找图点击B = 1 End IfEnd FunctionFunction 找多图B(pictname) Dim I,返回值,pict 找多图B = 0 找多图_intX = -1 找多图_intY = -1 pict = split(pictname, "|") For i = 0 To ubound(pict) 返回值=找图B (pict(i)) If 返回值 > 0 Then 日志运行内容 = V_当前程序&"找到:第" & cstr(i + 1) & "张pict:" & pict(i) Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 找多图_intX = 找图_intX 找多图_intY = 找图_intY 找多图B=i+1 Exit For End If NextEnd FunctionFunction 找多图点击B(pictname, 偏移X, 偏移Y) Dim 返回值 找多图点击B=0 返回值= 找多图B(pictname) If 返回值 > 0 Then Call Plugin.Bkgnd.MoveTo(Hwnd, 找多图_intX + cint(偏移X), 找多图_intY + cint(偏移Y)) Delay 50 Call Plugin.Bkgnd.LeftClick(Hwnd, 找多图_intX+cint(偏移X), 找多图_intY+cint(偏移Y)) 日志运行内容 = V_当前程序&"A------------->点击pict:"&pictname Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 找多图点击B = 返回值 End IfEnd FunctionFunction 等图B(pictname) Dim 返回值 日志运行内容 = V_当前程序&"B正在等待pict....:" & pictname Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 等图B=0 等图_intX = -1 等图_intY = -1 For 10000 返回值 = 找图B(pictname) If 返回值 > 0 Then 日志运行内容 = V_当前程序&"B------------->等到pict:" & pictname Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 等图_intX = 找图_intX 等图_intY = 找图_intY 等图B=1 Exit For End If Delay 500 NextEnd FunctionFunction 等图点击B(pictname, 偏移X, 偏移Y) Dim 返回值 日志运行内容 = V_当前程序&"正在等待点击pict....:" & pictname Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 等图点击B = 0 等图_intX = -1 等图_intY = -1 For 10000 返回值 = 找图B(pictname) If 返回值 > 0 Then 等图_intX = 找图_intX 等图_intY = 找图_intY Call Plugin.Bkgnd.MoveTo(Hwnd, 等图_intX + cint(偏移X), 等图_intY + cint(偏移Y)) Delay 50 Call Plugin.Bkgnd.LeftClick(Hwnd, 等图_intX+cint(偏移X), 等图_intY+cint(偏移Y)) 日志运行内容 = V_当前程序&"B-------------->点击pict:" & pictname Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 等图点击B=1 Exit For End If Delay 500 NextEnd FunctionFunction 等多图B(pictname) Dim 返回值 等多图B=0 等多图_intX = -1 等多图_intY = -1 For 10000 返回值=找多图B(pictname) If 返回值 > 0 Then 等多图B = 返回值 等多图_intX = 找多图_intX 等多图_intY = 找多图_intY Exit For End If 日志运行内容 = V_当前程序&"遍历一次,未等到所有pict" Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 Delay 500 NextEnd Function

'---------------------后台找图BC---带句柄-------------------------

Function 找图BC(句柄,pictname,基准起点X,基准起点Y,基准终点X,基准终点Y) // 后台找图,自带句柄 Dim icoord, Xy // TracePrint bmp_path iCoord = Plugin.Bkgnd.FindPic(句柄,基准起点X,基准起点Y,基准终点X,基准终点Y, bmp_path & pictname, 0, 0.6) XY = Split(iCoord,"|") 找图_intx= XY(0) 找图_inty= XY(1) If 找图_intx >= 0 and 找图_inty >= 0 Then 日志运行内容 = V_当前程序 & "C-------------->找到pict:" & pictname&"("&找图_intx&","&找图_inty&")" Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 找图BC=1 Else 日志运行内容 = V_当前程序 & "C未找到pict:" & pictname Call Lib.通用.输出日志(日志运行内容) : TracePrint 日志运行内容 找图BC=0 End IfEnd FunctionFunction 找图点击BC(句柄,pictname,基准起点X,基准起点Y,基准终点X,基准终点Y, 偏移X, 偏移Y) Dim 返回值 找图点击BC=0 返回值= 找图BC(句柄,pictname,基准起点X,基准起点Y,基准终点X,基准终点Y) If 返回值 > 0 Then Call Plugin.Bkgnd.MoveTo(句柄, 找图_intX + cint(偏移X), 找图_intY + cint(偏移Y)) Delay 50 Call Plugin.Bkgnd.LeftClick(句柄, 找图_intX+cint(偏移X), 找图_intY+cint(偏移Y)) 日志运行内容 = V_当前程序 & "C---------->点击pict:" & pictname Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 找图点击BC = 1 End IfEnd FunctionFunction 找多图BC(句柄,pictname,基准起点X,基准起点Y,基准终点X,基准终点Y) Dim I,返回值,pict 找多图BC = 0 找多图_intX = -1 找多图_intY = -1 pict = split(pictname, "|") For i = 0 To ubound(pict) 返回值=找图BC(句柄,pict(i),基准起点X,基准起点Y,基准终点X,基准终点Y) If 返回值 > 0 Then 日志运行内容 = V_当前程序&"C找到:第" & cstr(i + 1) & "张pict:" & pict(i) Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 找多图_intX = 找图_intX 找多图_intY = 找图_intY 找多图BC=i+1 Exit For End If NextEnd FunctionFunction 找多图点击BC(句柄,pictname,基准起点X,基准起点Y,基准终点X,基准终点Y, 偏移X, 偏移Y) Dim 返回值 找多图点击BC=0 返回值= 找多图BC(句柄,pictname,基准起点X,基准起点Y,基准终点X,基准终点Y) If 返回值 > 0 Then // Call Lib.窗口.弹出对话框(偏移X&"......", 1, "", 0) Call Plugin.Bkgnd.MoveTo(句柄, 找多图_intX + cint(偏移X), 找多图_intY + cint(偏移Y)) Delay 50 Call Plugin.Bkgnd.LeftClick(句柄, 找多图_intX + cint(偏移X), 找多图_intY + cint(偏移Y)) 日志运行内容 = V_当前程序&"A------------->点击pict:"&pictname Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 找多图点击BC = 返回值 End IfEnd FunctionFunction 等图BC(句柄,pictname,基准起点X,基准起点Y,基准终点X,基准终点Y) Dim 返回值 日志运行内容 = V_当前程序&"C正在等待pict....:" & pictname Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 等图BC=0 等图_intX = -1 等图_intY = -1 For 10000 返回值 = 找图BC(句柄,pictname,基准起点X,基准起点Y,基准终点X,基准终点Y) If 返回值 > 0 Then 日志运行内容 = V_当前程序&"C------------->等到pict:" & pictname Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 等图_intX = 找图_intX 等图_intY = 找图_intY 等图BC=1 Exit For End If Delay 500 NextEnd FunctionFunction 等多图BC(句柄,pictname,基准起点X,基准起点Y,基准终点X,基准终点Y) Dim 返回值 等多图BC=0 等多图_intX = -1 等多图_intY = -1 For 10000 返回值=找多图BC(句柄,pictname,基准起点X,基准起点Y,基准终点X,基准终点Y) If 返回值 > 0 Then 等多图BC = 返回值 等多图_intX = 找多图_intX 等多图_intY = 找多图_intY Exit For End If 日志运行内容 = V_当前程序&"遍历一次,未等到所有pict" Call Lib.通用.输出日志(日志运行内容):TracePrint 日志运行内容 Delay 500 NextEnd Function

'-------------------------------------------

//以下为全局变量:
/
Hwnd:句柄
bmp_path:图文件目录
找图_intx
找图_inty
等图_intX
等图_intY
找多图_intX
找多图_intY
等多图_intX
等多图_intY
/