按键精灵_判断返回状态

办法1

//判断返回

Function 返回(arr)
    For 3
        Randelay()
        If 找图判断(arr) = true Then
            TracePrint "返回成功"           
            Exit For
        Else
            TracePrint "继续返回"
            KeyPress "back"
        End If
    next   	
End Function
//dim 返回=Array(140,83,838,236,"返回")
//判断 返回画面为对就停止判断

 

办法2

dim intx,inty
     FindMultiColor 0,0,0,0,"7CFFFF","1|0|7DFEFF", 0,0.9,intx,inty  //查找登陆按钮
     if intx >-1 and inty >-1
         tap intx, inty  //点击登陆按钮
     end if
     for 10  //10秒内等待出现登陆成功画面
          If CmpColorEx("224|367|EFAB56,232|364|C2A076",0.9)=1 Then //出现正确画面就退出循环
              exit for
          else
             delay 1000
          End If
     next
Function action(i) //打开指定界面并等待出现正确界面
    Dim item=items(i), ret = false, intx,inty
      FindMultiColor item(2),item(3),item(4),item(5),item(6),item(7),item(8),item(9),intX,intY
        If intx > -1 and inty > -1 Then 
            Tap intx, inty //点击该图标
            ret = waitaction(item(10)) //等待打开界面
        End If
  open = ret
End Function
Function waitaction(icon) //等待打开界面
    Dim ret = false
        For 10 //等待20秒
            If CmpColorEx(icon, 0.9) = 1 Then //如果出现正确图标就退出
                ret = true
                Exit For
            Else 
                Delay 1000
            End If
        Next
    End If
    waitaction = ret
End Function

Dim items(10) //定义各项任务
items(1) = Array(“login”,0,0,0,0,”7CFFFF”,”1|0|7DFEFF”, 0,0.9,”224|367|EFAB56,232|364|C2A076″)

赞 (0)