作者b13b46o2 (买枪买装备)
看板EzHotKey
标题[其他] 按键精灵双层for
时间Thu Nov 22 09:00:12 2018
For 50
For 10
Next
Next
为什麽中间做完不会先执行十次才跳出外层继续动作呢?
我看他执行都是中间执行一次就去外面 求解
Rem 开始
Rem 打怪
For 30
KeyPress "Delete", 1
FindColor 0+X,28+Y,799+X,486+Y," C87C08",K,L
If K > 0 And L > 0 Then
MoveTo K + X, L + Y
LeftClick 1
Delay 1500
Goto 血1
Else
End If
For 10
Rem 血1
A = GetPixelColor(18 + X, 63 + Y)
If A = "00FF00" Then
Goto 血2
Delay 1
Else
MoveTo 165 + X, 532 + Y
A=""
LeftClick 1
Goto 还在打怪
End If
Rem 血2
B = GetPixelColor(17 + X, 62 + Y)
If B = "00FF00" Then
Goto 血3
Delay 1
Else
MoveTo 165 + X, 532 + Y
B=""
LeftClick 1
Goto 还在打怪
End If
Rem 血3
C = GetPixelColor(16 + X, 61 + Y)
If C = "00FF00" Then
Goto 血4
Delay 1
Else
MoveTo 165 + X, 532 + Y
C=""
LeftClick 1
Goto 还在打怪
End If
Rem 血4
D = GetPixelColor(16 + X, 60 + Y)
If D = "00FF00" Then
Goto 血5
Delay 1
Else
MoveTo 165 + X, 532 + Y
D=""
LeftClick 1
Goto 还在打怪
End If
Rem 血5
E = GetPixelColor(17 + X, 59 + Y)
If E = "00FF00" Then
Goto 血6
Delay 1
Else
MoveTo 165 + X, 532 + Y
E=""
LeftClick 1
Goto 还在打怪
End If
Rem 血6
F = GetPixelColor(17 + X, 58 + Y)
If F = "00FF00" Then
Goto 血7
Delay 1
Else
MoveTo 165 + X, 532 + Y
F=""
LeftClick 1
Goto 还在打怪
End If
Rem 血7
G = GetPixelColor(18 + X, 58 + Y)
If G = "00FF00" Then
Goto 血8
Delay 1
Else
MoveTo 165 + X, 532 + Y
G=""
LeftClick 1
Goto 还在打怪
End If
Rem 血8
H = GetPixelColor(19 + X, 61 + Y)
If H = "00FF00" Then
Goto 血9
Delay 1
Else
MoveTo 165 + X, 532 + Y
H=""
LeftClick 1
Goto 还在打怪
End If
Rem 血9
I = GetPixelColor(19 + X, 64 + Y)
If I = "00FF00" Then
Goto 血0
Delay 1
Else
MoveTo 165 + X, 532 + Y
I=""
LeftClick 1
Goto 还在打怪
End If
Rem 血0
J = GetPixelColor(19 + X, 64 + Y)
If J = "00FF00" Then
Goto 字1
Delay 1
Else
MoveTo 165 + X, 532 + Y
J=""
LeftClick 1
Goto 还在打怪
End If
Delay 500
Rem 还在打怪
Next
Rem 字1
GetColor = GetPixelColor(34 + X, 61 + Y)
If GetColor = "00FF00" Then
Goto 字2
Delay 1
Else
Goto 没找到字
End If
Rem 字2
GetColor = GetPixelColor(34 + X, 60 + Y)
If GetColor = "00FF00" Then
Goto 字3
Delay 1
Else
Goto 没找到字
End If
Rem 字3
GetColor = GetPixelColor(35 + X, 59 + Y)
If GetColor = "00FF00" Then
Goto 字4
Delay 1
Else
Goto 没找到字
End If
Rem 字4
GetColor = GetPixelColor(36 + X, 59 + Y)
If GetColor = "00FF00" Then
Goto 字5
Delay 1
Else
Goto 没找到字
End If
Rem 字5
GetColor = GetPixelColor(37 + X, 59 + Y)
If GetColor = "00FF00" Then
Goto 字6
Delay 1
Else
Goto 没找到字
End If
Rem 字6
GetColor = GetPixelColor(40 + X, 60 + Y)
If GetColor = "00FF00" Then
Goto 字7
Delay 1
Else
Goto 没找到字
End If
Rem 字7
GetColor = GetPixelColor(40 + X, 61 + Y)
If GetColor = "00FF00" Then
Goto 字8
Delay 1
Else
Goto 没找到字
End If
Rem 字8
GetColor = GetPixelColor(44 + X, 62 + Y)
If GetColor = "00FF00" Then
Goto 字9
Delay 1
Else
Goto 没找到字
End If
Rem 字9
GetColor = GetPixelColor(44 + X, 63 + Y)
If GetColor = "00FF00" Then
Goto 字0
Delay 1
Else
Goto 没找到字
End If
Rem 字0
GetColor = GetPixelColor(42 + X, 67 + Y)
If GetColor = "00FF00" Then
Goto 开始
Delay 1
Else
Goto 没找到字
End If
Rem 没找到字
Delay 1000
Next
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 180.217.216.255
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/EzHotKey/M.1542848414.A.E6B.html
※ 编辑: b13b46o2 (118.233.30.83), 11/22/2018 09:40:40
1F:→ s31364663: 变数有没有正常设定 11/27 15:15
2F:→ s31364663: 确定抓色有正常侦测吗? 11/27 15:15
3F:→ s31364663: 可以开测试和设定msgbox检查 11/27 15:15
4F:→ kobe8112: 不理解goto的情况下不建议用,一旦跳开就是跳开了 01/14 11:33