按键精灵9 条件语句判断

FindColorEx 233,201,516,406,"000FD",1,0.9,intX,intY
If intX > 0 And intY > 0 Then

KeyPress "E", 1
Delay 1200
KeyPress "2", 1
Delay 1500
KeyPress "4", 1
Delay 1500
KeyPress "3", 1
Delay 1000
KeyPress "`", 1
Delay 500
LeftClick 1
Delay 4000
KeyPress "F1", 1

end if

FindCenterColor 182,730,213,762,"2A4260",intX,intY
If intX > 0 And intY > 0 Then
Delay 1000
KeyPress "1", 1
Delay 1000
KeyPress "1", 1
Delay 1000
KeyPress "1", 1
Delay 1500

end if
FindColorEx 621,48,752,76,"000001",0,0.9,intX,intY
If intX > 0 And intY > 0 Then
KeyPress "Q", 1
Delay 1000
KeyPress "R", 1
Delay 2000
KeyPress "5", 1
LeftClick 1
Delay 1300
KeyPress "5", 1
LeftClick 1
Delay 1300
KeyPress "5", 1
LeftClick 1

Delay 1300
KeyPress "5", 1
LeftClick 1
Delay 2000
KeyPress "V", 1
Delay 2000
KeyPress "T", 1
Delay 2000
KeyPress "F", 1
Delay 2000
KeyPress "8", 1

END IF
请教一下,只有在第一个if执行的情况下,第二个if才会执行,否则第二个if是不会执行的,请问这个语句该如何修改,跪谢!!!

FindColorEx 233,201,516,406,"000FD",1,0.9,intX,intY
If intX > 0 And intY > 0 Then

KeyPress "E", 1
Delay 1200
KeyPress "2", 1
Delay 1500
KeyPress "4", 1
Delay 1500
KeyPress "3", 1
Delay 1000
KeyPress "`", 1
Delay 500
LeftClick 1
Delay 4000
KeyPress "F1", 1
elseIf intX > 0 And intY > 0 Then
KeyPress "Q", 1
Delay 1000
KeyPress "R", 1
Delay 2000
KeyPress "5", 1
LeftClick 1
Delay 1300
KeyPress "5", 1
LeftClick 1
Delay 1300
KeyPress "5", 1
LeftClick 1

Delay 1300
KeyPress "5", 1
LeftClick 1
Delay 2000
KeyPress "V", 1
Delay 2000
KeyPress "T", 1
Delay 2000
KeyPress "F", 1
Delay 2000
KeyPress "8", 1
end if
end if

(
if(如果)
else(否则)

至于你的要求,还有其他方法可以实现,04年学的VB太久没用,不能给你提供太多参考了,你这是那个游戏的脚本啊?
)追问

自己写的魔兽打怪脚本 呵呵 不行啊 有报错 能加QQ细说吗 517438603

温馨提示:内容为网友见解,仅供参考
第1个回答  2011-11-21
if 判断1 then
’只有当判断1执行,才进行判断2
if 判断2 then
'判断2代码
end 判断2
end 判断1

按键精灵9 条件语句判断
FindColorEx 233,201,516,406,"000FD",1,0.9,intX,intY If intX > 0 And intY > 0 Then KeyPress "E", 1 Delay 1200 KeyPress "2", 1 Delay 1500 KeyPress "4", 1 Delay 1500 KeyPress "3", 1 Delay 1000 KeyPress "`", 1 Delay 500 LeftClick 1 Delay 4000 KeyPress "F1...

按键精灵9 判断键盘动作脚本
按键9 分太少了吧~ ~

谁知道按键精灵9有多少种循环以及他们的用途。
条件循环,条件满足才进入循环,不满足则跳过该循环 Do 循环 单独的用就是无限循环。加While和Until就成了条件循环。While是条件满足执行循环,Until是条件满足不执行循环,意思相反。加在循环头,比如:i=0 Do While i=0 loop 就和While循环是一样的道理,先判断后执行。加在循环尾,比如:Do i=0...

按键精灵怎么设置条件判断?
你第一个图找到后。找图哪个函数会有返回值。你直接判断返回值。如果反回的值是找到的值。你再找第二个图。用if语句来判断

按键精灵---判断条件语句,不满足则循环到满足,满足了继续下一个条件
刚刚回答了一个同样的问题,实现你要的功能,设置循环条件,代码如下:当i=0时循环,找到图之后让i不等于0 就跳出这个循环\\x0d\\x0ai=0 \\x0d\\x0aWhile i=0\\x0d\\x0a\/\/此处方式延时代码。\\x0d\\x0a\/\/下边这句是找图代码。如需找色。自行替换。\\x0d\\x0aFindPic 0,0,1024,768,...

按键精灵怎么同时判断几个条件
亲。在按键精灵中,你可以使用“与”语句来同时判断多个条件。以下是一个示例脚本,该脚本会判断变量a和b是否都大于10,如果都满足条件,则输出“条件满足”,否则输出“条件不满足”:vbscript 复制 Dim a = 15 Dim b = 20 If a > 10 And b > 10 Then MsgBox "条件满足"Else MsgBox "条件不...

按键精灵。。我想用条件语句判断当前窗口是否存在,不存在则进行下条语句...
dim MyArray MyArray = Split(HwndEx, "|")If UBound(MyArray)>=0 Then s1 = Plugin.Window.GetText(MyArray(0))Rem q Hwnd = Plugin.Window.Foreground()s2 = Plugin.Window.GetText(Hwnd)If s1=s2 Then \/\/操作源码 Else \/\/等待 Delay 1000 End If Goto q Else MessageBox "没有发现你...

按键精灵9否则如果则什么意思?怎么用?
if 1<2 then messagebox "1真的小于2"else mseeagebox "按键精灵出错了"endif 如果则就是如果后面的等式成立 则运行then下面的语句,如果不成立,则运行else下面的语句.

求一个按键精灵简单的判断语句
B = "2,5,0,8,9" \/\/逗号是英文输入法的逗号 Bm = Split(B, ",")For i = 0 To UBound(Bm)If Clng(Bm(i)) = 2 Then KeyPress 112, 1 Exit For End If Next If i > UBound(Bm) Then ExitScript End If

怎么用按键精灵的命令判断指定窗口是否存在?
用条件语句判断If Hwnd>0 Else EndIf

相似回答