求大神帮忙看下按键精灵找图程序,3个位置分别找固定的14张图,14张图分别表示+-7这14个数字 5
3个位置分别找固定的14张图,14张图分别表示+-7这14个数字,我需要的是找到的3个图表示的数字的和,用以做后面的判断,求大神帮忙修改下,谢谢Dimstr1,str2,...
3个位置分别找固定的14张图,14张图分别表示+-7这14个数字,我需要的是找到的3个图表示的数字的和,用以做后面的判断,求大神帮忙修改下,谢谢
Dim str1,str2,str3,str4,str5,str6
Dim a(13)
a(0)="Attachment:\-7.bmp"
a(1)="Attachment:\-6.bmp"
a(2)="Attachment:\-5.bmp"
a(3)="Attachment:\-4.bmp"
a(4)="Attachment:\-3.bmp"
a(5)="Attachment:\-2.bmp"
a(6)="Attachment:\-1.bmp"
a(7)="Attachment:\1.bmp"
a(8)="Attachment:\-2.bmp"
a(9)="Attachment:\-3.bmp"
a(10)="Attachment:\-4.bmp"
a(11)="Attachment:\-5.bmp"
a(12)="Attachment:\-6.bmp"
a(13)="Attachment:\-7.bmp"
KeyPress "W", 1
Delay 1200
Sub 返还数字
If i = 0 Then
str1=-7
ElseIf i = 1 Then
str1 = -6
ElseIf i = 2 Then
str1 = -5
ElseIf i = 3 Then
str1 = -4
ElseIf i = 4 Then
str1 = -3
ElseIf i = 5 Then
str1 = -2
ElseIf i = 6 Then
str1 = -1
ElseIf i = 7 Then
str1 = 1
ElseIf i = 8 Then
str1 = 2
ElseIf i = 9 Then
str1 = 3
ElseIf i = 10 Then
str1 = 4
ElseIf i = 11 Then
str1 =5
ElseIf i = 12 Then
str1 =6
ElseIf i = 13 Then
str1 = 7
End If
End Sub
For i=0 to 13
FindPic 1087,589,1184,629,a(i),0.8,x,y
If x>0 and y>0 Then
Call 返还数字()
str2=str1
Exit For
End If
next
For i=0 to 13
FindPic 1083,641,1178,682,a(i),0.8,x,y
If x>0 and y>0 Then
Call 返还数字()
str3=str1
Exit For
End If
Next
For i=0 to 13
FindPic 1084,479,1182,520,a(i),0.8,x,y
If x>0 and y>0 Then
Call 返还数字()
str4=str1
Exit For
End If
Next
str6=str3+str4
str5 = str2 + str3 + str4
If str5 > 0 Then
KeyPress "D", 1
Delay 200
ElseIf str2 > str6 Then
KeyPress "D", 1
Delay 200
Else
KeyPress "A", 1
Delay 200
End If 展开
Dim str1,str2,str3,str4,str5,str6
Dim a(13)
a(0)="Attachment:\-7.bmp"
a(1)="Attachment:\-6.bmp"
a(2)="Attachment:\-5.bmp"
a(3)="Attachment:\-4.bmp"
a(4)="Attachment:\-3.bmp"
a(5)="Attachment:\-2.bmp"
a(6)="Attachment:\-1.bmp"
a(7)="Attachment:\1.bmp"
a(8)="Attachment:\-2.bmp"
a(9)="Attachment:\-3.bmp"
a(10)="Attachment:\-4.bmp"
a(11)="Attachment:\-5.bmp"
a(12)="Attachment:\-6.bmp"
a(13)="Attachment:\-7.bmp"
KeyPress "W", 1
Delay 1200
Sub 返还数字
If i = 0 Then
str1=-7
ElseIf i = 1 Then
str1 = -6
ElseIf i = 2 Then
str1 = -5
ElseIf i = 3 Then
str1 = -4
ElseIf i = 4 Then
str1 = -3
ElseIf i = 5 Then
str1 = -2
ElseIf i = 6 Then
str1 = -1
ElseIf i = 7 Then
str1 = 1
ElseIf i = 8 Then
str1 = 2
ElseIf i = 9 Then
str1 = 3
ElseIf i = 10 Then
str1 = 4
ElseIf i = 11 Then
str1 =5
ElseIf i = 12 Then
str1 =6
ElseIf i = 13 Then
str1 = 7
End If
End Sub
For i=0 to 13
FindPic 1087,589,1184,629,a(i),0.8,x,y
If x>0 and y>0 Then
Call 返还数字()
str2=str1
Exit For
End If
next
For i=0 to 13
FindPic 1083,641,1178,682,a(i),0.8,x,y
If x>0 and y>0 Then
Call 返还数字()
str3=str1
Exit For
End If
Next
For i=0 to 13
FindPic 1084,479,1182,520,a(i),0.8,x,y
If x>0 and y>0 Then
Call 返还数字()
str4=str1
Exit For
End If
Next
str6=str3+str4
str5 = str2 + str3 + str4
If str5 > 0 Then
KeyPress "D", 1
Delay 200
ElseIf str2 > str6 Then
KeyPress "D", 1
Delay 200
Else
KeyPress "A", 1
Delay 200
End If 展开
2个回答
展开全部
//14张图分别表示+-7,你的数组却只有负数....其实可以不用数组的.
For i = - 7 To 7
If i <> 0 Then
FindPic 1087, 589, 1184, 629, "Attachment:\" & i & ".bmp", 0.8, x, y
If x > 0 Then
a1 = i//a1用来保存找出来的第一数字
Exit For
End If
End If
Next
For i = - 7 To 7
If i <> 0 Then
FindPic 1083, 641, 1178, 682, "Attachment:\" & i & ".bmp", 0.8, x, y
If x > 0 Then
a2 = i//a2用来保存找出来的第2数字
Exit For
End If
End If
Next
For i = - 7 To 7
If i <> 0 Then
FindPic 1084, 479, 1182, 520, "Attachment:\" & i & ".bmp", 0.8, x, y
If x > 0 Then
a3 = i//a3用来保存找出来的第3数字
Exit For
End If
End If
Next
//都找出来了,下面你知道怎么计算了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询