按键精灵吧 关注:499,872贴子:1,020,021
  • 0回复贴,共1

麻烦大神帮忙看看这个脚本的问题在哪里,谢谢各位大神

只看楼主收藏回复

如题:我写了一个脚本,本来想按下3键的时候就执行,松开3键的时候就停下来,但实际情况是松开3键后总会执行到最后一行,然后再停下来,麻烦大神们帮忙看看如何解决,谢谢。
以下是我写的脚本:
Rem z
Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
Dim 返回值, key
key = 51
//3的按键码=51
返回值 = GetAsyncKeyState(key)
//返回值 = 0,3键无操作。
//返回值 = 1,3键按下一次。
//返回值 < 0,3键处在按下状态。
If 返回值 <> 0 Then
//红人
Do
Delay 100
IfColor 670, 1015, "FF7B00", 0 Then
KeyPress "5", 1
Else
Exit Do
End If
Loop
Else
End If
//杀戮
Do
Delay 100
IfColor 670, 1087, "FF0C", 0 Then
KeyPress "6", 1
Else
Exit Do
End If
Loop
Else
End If
//眼镜蛇
Do
Delay 100
IfColor 670, 1123, "FF6EF2", 0 Then
KeyPress "8", 1
Else
Exit Do
End If
Loop
Else
End If
//夺命射击
Do
Delay 100
IfColor 670, 980, "100FF", 0 Then
KeyDown 18, 1
KeyPress 54, 1
KeyUp 18, 1
Else
Exit Do
End If
Loop
Else
End If
//倒刺
Do
Delay 100
IfColor 670, 1052, "F3FF", 0 Then
KeyPress "7", 1
Else
Exit Do
End If
Loop
Else
End If
Goto z


IP属地:辽宁1楼2022-04-12 15:55回复