参考代码如下//0000ff为16进制颜色,0,0为屏幕左上角坐标。200,200为屏幕右下角坐标。intX,intY为找到的颜色的坐标FindColor 0,0,200,200,"0000FF",intX,intY'========第一次找色//获取屏幕左上角,0,0坐标到200,200区域0000FF的颜色信息,把找到的颜色坐标,储存到intX,intYFindColor 0,0,200,200,"0000FF",intX2,intY2'========第二次找色If intX >0 And intY >0 Then‘当确定找色颜色0000FF就鼠标移动到intX,intY左键点击MoveTo intX, intYLeftClick 1else If intX >0 And intY >0 Then‘当确定找色颜色0000FF就鼠标移动到intX2,intY2左键点击MoveTo intX2, intY2LeftClick 1End IfXY=Plugin.Color.FindMutiColorEx(0,0,1024,768,"D2CABF","1|1|D2CABF,3|5|D2CABF,3|6|D2CABF",1,0)
//多点找色A
ZB = InStr(XY,"|")
X = Clng(Left(XY, ZB - 1)): Y = Clng(Right(XY, Len(XY) - ZB))
If X >0 and Y >0 Then
Call A
//如果多点A找到则执行操作A,否则找多点B
Else
XY=Plugin.Color.FindMutiColorEx(0,0,1024,768,"D2CABF","1|1|D2CABF,3|5|D2CABF,3|6|D2CABF",1,0)
//多点找色B
ZB = InStr(XY,"|")
X = Clng(Left(XY, ZB - 1)) : Y = Clng(Right(XY, Len(XY) - ZB))
If X >0 and Y >0 Then
Call B
End if
End If
Sub A
LeftClick 1
End Sub
Sub b
RightClick 1
End Sub