/*  
 *@Fun   微锐代答
 *@arg   null
 *@retun null
 **/ 
Sub microRui()

    TID = "-1"
    While Len(TID) = 2
        //截图并发送,前台截取。 
        TID = Plugin.Microrui.SendImage(weiRui, 1046, judgeX, judgeY, 140, 65, 20)
        //参数说明(具体看插件压缩包里的说明):SendImage( 上传密码串,游戏ID,截图起点坐标X,Y,图片的长,宽,超时时间单位秒)
        
        //直接发送图片文件。
		//TID = Plugin.Microrui.SendFile("47|59659363F0D090484D356728BBBE9677", 1001, "图片路径", 300)
		//参数说明(具体看插件压缩包里的说明):SendFile(上传密码串,游戏ID,图片路径,超时时间单位秒)
        TracePrint TID 
        Delay 1500
    Wend
    
    Answer = "-1"
    While Answer = "-1"    	
        Delay 2500
        Answer = Plugin.Microrui.GetAnswer(TID)
        TracePrint Answer
    Wend
    
    If Answer <> "-1" Then 
    	If Answer = "-9" Then 
    	//-9:图片无法识别,请检查截取的图片是否正确	  		
    	ElseIf Answer = "-8" Then
    	//-8:答题超时
    	ElseIf Answer = "1" Then
    		//答案1
    		Call switchValidate()
    	ElseIf Answer = "2" Then
    		//答案2
    		Call switchValidate()
    	ElseIf Answer = "3" Then
    		//答案3
    		Call switchValidate()
    	ElseIf Answer = "4" Then
    		//答案4
    		Call switchValidate()
    	Else 
    		//其它返回值
    		Call inputValidate()
    	End If
    End If        
 
End Sub 


/*  
 *@Fun   判断是否有验证码
 *@arg   null
 *@retun null
 **/ 
  Function judgeHasValidate()
 	Dim intX, intY
	FindPic 650, 400, 1110, 780, "Attachment:\验证码.bmp", 1.0, intX, intY
	//MessageBox intX &" "& intY
	If intX > 0 and intY > 0 Then 
		judgeX = intX + 60
		judgeY = intY + 65
	 	judgeHasValidate = 1
	Else 
	    judgeHasValidate = 0
	End If
 End Function
 
 
 /*---------------------------判断有无验证码—————-----------*/
 Function judgeValidate()
 	Delay 3000	
	While validateFlag
		hasV = judgeHasValidate()
		//MessageBox judgeX &" "& judgeY
		If hasV = 1 Then 
			Call microRui()
			Delay 10000				
		Else 
			validateFlag = false
		End If
	Wend
	If Not  validateFlag  Then 
		Call selectChannel()
	End If	
 End Function
 
 
 /*  
 *@Fun   切换下一张验证码
 *@arg   null
 *@retun null
 **/ 
  Function switchValidate()
  	SetSimMode 2
 	Dim intX, intY
	FindPic 650, 400, 1110, 780, "Attachment:\切图.bmp", 1.0, intX, intY