按键精灵_检测画面变动信息

Function 画面卡屏(ms)
Rem begin
KeepCapture//只截图一次,优化运行效率,下同
Dim a = GetPixelColor(172,361)
Dim b = GetPixelColor(173,695)
Dim c = GetPixelColor(527,76)
Dim d = GetPixelColor(242,84)
Dim e = GetPixelColor(484,1157)
Dim f = GetPixelColor(242,1166)
ReleaseCapture
Call ShanHai.TimeSign(1)
While 1
KeepCapture
Dim same = 0
Dim a1 = GetPixelColor(172,361)
Dim b1 = GetPixelColor(173,695)
Dim c1 = GetPixelColor(527,76)
Dim d1 = GetPixelColor(242,84)
Dim e1 = GetPixelColor(484,1157)
Dim f1 = GetPixelColor(242,1166)
ReleaseCapture
If a1 = a Then
same = same + 1
End If
If b1 = b Then
same = same + 1
End If
If c1 = c Then
same = same + 1
End If
If d1 = d Then
same = same + 1
End If
If ShanHai.Timer(1,5) Then
TracePrint"5秒了还是没动静"
Dim MyValue
If (随机数(1, 3) <= 2) Then //通过随机数实现随机点击
Tap 45,213
Else
Tap 229,1111
End If
End If
If same < 4 Then //只要有三个点以上不同则判定画面没变化
TracePrint"图像变化了"
Goto begin
End If
Delay ms//判定时间,如果卡的话适当调高该参数
Wend
End Function
Function 画面卡屏(ms) Rem begin KeepCapture//只截图一次,优化运行效率,下同 Dim a = GetPixelColor(172,361) Dim b = GetPixelColor(173,695) Dim c = GetPixelColor(527,76) Dim d = GetPixelColor(242,84) Dim e = GetPixelColor(484,1157) Dim f = GetPixelColor(242,1166) ReleaseCapture Call ShanHai.TimeSign(1) While 1 KeepCapture Dim same = 0 Dim a1 = GetPixelColor(172,361) Dim b1 = GetPixelColor(173,695) Dim c1 = GetPixelColor(527,76) Dim d1 = GetPixelColor(242,84) Dim e1 = GetPixelColor(484,1157) Dim f1 = GetPixelColor(242,1166) ReleaseCapture If a1 = a Then same = same + 1 End If If b1 = b Then same = same + 1 End If If c1 = c Then same = same + 1 End If If d1 = d Then same = same + 1 End If If ShanHai.Timer(1,5) Then TracePrint"5秒了还是没动静" Dim MyValue If (随机数(1, 3) <= 2) Then //通过随机数实现随机点击 Tap 45,213 Else Tap 229,1111 End If End If If same < 4 Then //只要有三个点以上不同则判定画面没变化 TracePrint"图像变化了" Goto begin End If Delay ms//判定时间,如果卡的话适当调高该参数 Wend End Function
Function 画面卡屏(ms)
Rem begin
KeepCapture//只截图一次,优化运行效率,下同
Dim a = GetPixelColor(172,361)
Dim b = GetPixelColor(173,695)
Dim c = GetPixelColor(527,76)
Dim d = GetPixelColor(242,84)
Dim e = GetPixelColor(484,1157)
Dim f = GetPixelColor(242,1166)
ReleaseCapture
Call ShanHai.TimeSign(1)
While 1
    KeepCapture 
    Dim same = 0
    Dim a1 = GetPixelColor(172,361)
    Dim b1 = GetPixelColor(173,695)
    Dim c1 = GetPixelColor(527,76)
    Dim d1 = GetPixelColor(242,84)
    Dim e1 = GetPixelColor(484,1157)
    Dim f1 = GetPixelColor(242,1166)
    ReleaseCapture
    If a1 = a Then 
        same = same + 1
    End If
    If b1 = b Then 
        same = same + 1
    End If
    If c1 = c Then 
        same = same + 1
    End If
    If d1 = d Then 
        same = same + 1
    End If
    If ShanHai.Timer(1,5) Then
        TracePrint"5秒了还是没动静"
        Dim MyValue
        If (随机数(1, 3) <= 2) Then //通过随机数实现随机点击
            Tap 45,213
        Else 
            Tap 229,1111
        End If
    End If
    If same < 4 Then //只要有三个点以上不同则判定画面没变化
         TracePrint"图像变化了"
        Goto begin
    End If
    Delay ms//判定时间,如果卡的话适当调高该参数
Wend
End Function

赞 (0)