[按键精灵] 纯文本查看 复制代码
Import "zm.luae" //导入插件,只需执行一次
zm.Init //初始化插件,只需执行一次
If Not zm.OcrBaiDuInit("PXuveaHShU8lI1joPnObnjjS", "8twOpgqURAsCO1STweEPrI3WArZIfWpm") Then
TracePrint "初始化设置百度云识别失败"
EndScript
End If
Dim intX,intY,ret,intX1,intY1
Call 趣味解密()
Function 趣味解密()
Do
FindMultiColor 0,0,0,0,"5ABEFF","24|-319|47B4F7,26|-300|2671D9,114|-270|32E0B5",0,0.9,intX,intY //寻找打到第几关了
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
ret = zm.OcrBaiDuNumbers(intX-28, intY-865, intX+48, intY-602) //计算关卡,ret为关卡数
If ret then
TracePrint "数字", ret
Else
TracePrint "识别失败"
End If
Tap intX, intY
Delay 1400
elseIf CmpColorEx("120|612|5DBEFF,139|611|5BBEFF,157|620|5ABEFF,122|713|5ABEFF,156|724|4FB2FF", 0.9) = 1 Then
TracePrint "点击确定"
Delay 1000
Tap 149, 650
Delay 500
Exit Do
End If
//没找到需要往下翻页
Delay 500
zm.Swipe 110, 1000, 448, 1000
TracePrint "向下翻动"
Delay 500
FindMultiColor 96,1085,247,1184,"959695","-1|48|969698,45|5|949694,43|54|8C8A8C,123|13|979698,123|49|969696",0,0.9,intX1,intY1
If intX1 > -1 And intY1 > -1 Then
TracePrint "未解锁关卡"
ShowMessage "未解锁关卡"
Delay 2000
EndScript
End If
Loop
Do
if CmpColorEx("73|1281|FFFFFF,79|1277|FFFFFF,61|1274|FFFFFF,92|1271|FFFFFF",0.9) = 1 Then
TracePrint "进入关卡"
Exit Do
End if
Loop
Delay 1000
Delay 1000
Call 关卡()
End Function
Function 关卡()
TracePrint "开始第"&ret&"关"
Delay 1000
Dim x = ret
TracePrint x
Do
Select Case x
Case 1
TracePrint “这是1”
Case 2
TracePrint “这是2”
Case 3
TracePrint “这是3”
Case 4
TracePrint “这是4”
Case Else
TracePrint "出错了"
EndScript
End Select
Delay 500
TracePrint "完成滑动"
If CmpColorEx("686|629|FFF7E2,684|639|FFF5DE,720|652|5ECFFF", 0.9) = 1 Then
TracePrint "成功"
Delay 500
Tap 83, 670
ElseIf CmpColorEx("596|54|B5ACA0,609|76|B5ACA0,620|84|B5ACA1,591|680|FFFFFF", 0.9) = 1 Then
TracePrint "本关完成"
Exit Do
End If
Loop
End Function