按键精灵多个if语句套用 5
找到某个图片之后执行程序。不然的话继续找下一个图片,找到后执行另一个程序,没找到的话继续找下一个图片。。。需要四个if,但是具体的不知道怎么弄。求详细代码,或是有其他方法...
找到某个图片之后执行程序。不然的话继续找下一个图片,找到后执行另一个程序,没找到的话继续找下一个图片。。。需要四个if,但是具体的不知道怎么弄。
求详细代码,或是有其他方法实现这个效果也行。 展开
求详细代码,或是有其他方法实现这个效果也行。 展开
展开全部
//方法一:
FindPic 0,0,1024,768,"Attachment:\神盾1.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
call a()
End If
FindPic 0,0,1024,768,"Attachment:\神盾2.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
call a()
End If
FindPic 0,0,1024,768,"Attachment:\神盾3.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
call a()
End If
FindPic 0,0,1024,768,"Attachment:\神盾4.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
call a()
End If
//方法二:
For i=1 to 4
FindPic 0,0,1024,768,"Attachment:\神盾"&i&".bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
call a()
Exit For
End If
Next
Sub a()
End Sub
展开全部
FindPic 0,0,1024,768,"Attachment:\1.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
//执行命令
Else
FindPic 0, 0, 1024, 768, "Attachment:\2.bmp", 0.9, intX, intY
If intX > 0 Then
//执行命令
Else
FindPic 0, 0, 1024, 768, "Attachment:\3.bmp", 0.9, intX, intY
If intX > 0 Then
//执行命令
Else
FindPic 0, 0, 1024, 768, "Attachment:\4.bmp", 0.9, intX, intY
If intX > 0 Then
//执行命令
Else
//
End If
End If
End If
End If
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2020-03-08
展开全部
Do
FindColor 871, 695, 878, 708, "04177E", 0, 0.9, intX, intY
If intX > 0 And intY > 0 Then
TracePrint "是否最大血量"&intX,intY
FindPic 356, 633, 435, 706, "Attachment:无名强身.png", "505050", 0, 0.8, intX, intY
If intX > 0 And intY > 0 Then
TracePrint "是否无名强身"&intX,intY
Else
TracePrint "没有无名强身"&intX,intY
zm.SetTap {"t":zm.RndNum(100, 500), "mintouch":100, "maxtouch":400}
zm.Tap 1026, 565
zm.Delay 300, 1000
End If
Delay 300
If intX > 0 And intY > 0 Then
FindPic 606,263,674,371,"Attachment:人物1.png|Attachment:人物2.png|Attachment:人物3.png|Attachment:人物4.png|Attachment:人物5.png|Attachment:人物6.png|Attachment:人物7.png|Attachment:人物8.png","505050",0,0.7,intX,intY
TracePrint "是否找到人物"&intX,intY
If intX > 0 And intY >0 Then
zm.SetTap {"t":zm.RndNum(100, 500), "mintouch":100, "maxtouch":400}
zm.Tap 1245, 567
zm.Delay(300, 1000)
zm.Tap 1154, 611
zm.Delay 300, 1000
Else
TracePrint "没有找到人物"&intX,intY
End If
Delay 300
Else
End If
Delay 300
Else
FindPic 357,655,424,704, "Attachment:无名强身.png", "202020", 0, 0.8, intX, intY
TracePrint "是否无名强身"&intX,intY
If intX > 0 And intY > 0 Then
FindPic 356, 632, 428, 703, "Attachment:伏式气功.png", "000000", 0, 1.0, intX, intY
TracePrint "是否伏式气功"&intX,intY
If intX > 0 And intY > 0 Then
TracePrint "有伏式气功"&intX,intY
Else
FindColor 777,697,798,707,"232E36",0,0.95,intX,intY
TracePrint "是否低血量"&intX,intY
If intX > 0 And intY > 0 Then
zm.SetTap {"t":zm.RndNum(100, 300), "mintouch":10, "maxtouch":200}
zm.Tap 1006, 660
zm.Delay 300, 1000
Else
TracePrint "低血量"&intX,intY
End If
Delay 300
End If
Delay 300
Else
FindColor 790,695,815,708,"051371",0,1.0,intX,intY
TracePrint "是否血量低"&intX,intY
If intX > 0 And intY > 0 Then
FindPic 356, 632, 428, 703, "Attachment:伏式气功.png", "999999", 0, 0.7, intX, intY
TracePrint "是否伏式气功"&intX,intY
If intX > 0 And intY > 0 Then
TracePrint "伏式气功运行"&intX,intY
Else
zm.SetTap {"t":zm.RndNum(100, 300), "mintouch":10, "maxtouch":200}
zm.Tap 1006, 660
zm.Delay 300, 1000
End If
Delay 300
Else
TracePrint "伏式气功已经打开"&intX,intY
End If
Delay 300
End If
Delay 300
End If
Delay 300
Loop
FindColor 871, 695, 878, 708, "04177E", 0, 0.9, intX, intY
If intX > 0 And intY > 0 Then
TracePrint "是否最大血量"&intX,intY
FindPic 356, 633, 435, 706, "Attachment:无名强身.png", "505050", 0, 0.8, intX, intY
If intX > 0 And intY > 0 Then
TracePrint "是否无名强身"&intX,intY
Else
TracePrint "没有无名强身"&intX,intY
zm.SetTap {"t":zm.RndNum(100, 500), "mintouch":100, "maxtouch":400}
zm.Tap 1026, 565
zm.Delay 300, 1000
End If
Delay 300
If intX > 0 And intY > 0 Then
FindPic 606,263,674,371,"Attachment:人物1.png|Attachment:人物2.png|Attachment:人物3.png|Attachment:人物4.png|Attachment:人物5.png|Attachment:人物6.png|Attachment:人物7.png|Attachment:人物8.png","505050",0,0.7,intX,intY
TracePrint "是否找到人物"&intX,intY
If intX > 0 And intY >0 Then
zm.SetTap {"t":zm.RndNum(100, 500), "mintouch":100, "maxtouch":400}
zm.Tap 1245, 567
zm.Delay(300, 1000)
zm.Tap 1154, 611
zm.Delay 300, 1000
Else
TracePrint "没有找到人物"&intX,intY
End If
Delay 300
Else
End If
Delay 300
Else
FindPic 357,655,424,704, "Attachment:无名强身.png", "202020", 0, 0.8, intX, intY
TracePrint "是否无名强身"&intX,intY
If intX > 0 And intY > 0 Then
FindPic 356, 632, 428, 703, "Attachment:伏式气功.png", "000000", 0, 1.0, intX, intY
TracePrint "是否伏式气功"&intX,intY
If intX > 0 And intY > 0 Then
TracePrint "有伏式气功"&intX,intY
Else
FindColor 777,697,798,707,"232E36",0,0.95,intX,intY
TracePrint "是否低血量"&intX,intY
If intX > 0 And intY > 0 Then
zm.SetTap {"t":zm.RndNum(100, 300), "mintouch":10, "maxtouch":200}
zm.Tap 1006, 660
zm.Delay 300, 1000
Else
TracePrint "低血量"&intX,intY
End If
Delay 300
End If
Delay 300
Else
FindColor 790,695,815,708,"051371",0,1.0,intX,intY
TracePrint "是否血量低"&intX,intY
If intX > 0 And intY > 0 Then
FindPic 356, 632, 428, 703, "Attachment:伏式气功.png", "999999", 0, 0.7, intX, intY
TracePrint "是否伏式气功"&intX,intY
If intX > 0 And intY > 0 Then
TracePrint "伏式气功运行"&intX,intY
Else
zm.SetTap {"t":zm.RndNum(100, 300), "mintouch":10, "maxtouch":200}
zm.Tap 1006, 660
zm.Delay 300, 1000
End If
Delay 300
Else
TracePrint "伏式气功已经打开"&intX,intY
End If
Delay 300
End If
Delay 300
End If
Delay 300
Loop
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询