没有太多的时间和体力,一点点做到现在,感觉比较有成就感,继续学习
Dim t1, t2, t3
t1 = now()
t2 = now()
t3 = now()
t4 = now()
t5 = now()
t6 = now()
t7 = now()
t8 = now()
t9 = now()
TracePrint "开始运行"
Hwnd = Plugin.Window.Find("TianLongBaBu WndClass", "《醉江湖》 (醉江湖:无限元宝区双线)")
TracePrint hwnd
Call Plugin.Window.Move(Hwnd, 1, 1)
Call Plugin.Window.Top(Hwnd, 0)
Call Plugin.Window.Active(Hwnd)
Delay 500
For n=1 to 200
Call 找怪()
Call 打怪()
TracePrint "第"& n&"次打怪"
Next
Sub 找怪()
Do
Delay 1000
KeyDown 17, 1
KeyPress 49, 1
KeyUp 17, 1
IfColor 329,66,"0012EA",0 Then
//颜色一样
TracePrint "选着怪"
Exit Do
Else
//颜色不一样
TracePrint "还在找怪"
End If
Loop
End Sub
Sub 打怪()
Do
Call 技能释放()
Delay 1000
Delay Int((500 - 300 + 1) * Rnd +300)
IfColor 329,66,"0012EA",1 Then
//颜色不一样
TracePrint "怪死亡"
Exit Do
Else
//颜色一样
TracePrint "怪还没有死"
End If
IfColor 83,65,"3F51FF",1 Then
//颜色不一样
TracePrint "血量低,加血中"
Delay 1000
KeyPress "F10",1
Else
//颜色一样
TracePrint "血量够用,无需加血"
End If
Loop
End Sub
Sub 技能释放()
TracePrint"进入技能释放"
Delay 1000
TracePrint t2 - t1
差年=datediff("yyyy",t2,t1)
差1 = datediff("s", t1, now())
TracePrint 差
If 差1 >= 1 Then
TracePrint "差1是"&差1
TracePrint "已大于" & 差1 & "并释放第一个技能,八卦掌F1"
Delay 1000
KeyPress "F1", 1
t1 = now()
// Exit Do
End If
Delay 1000
差2 = datediff("s", t2, now())
TracePrint 差2
If 差2 >= 5 Then
TracePrint "差2是"&差2
TracePrint "已大于" & 差2 & "并释放第二个技能,天马飞瀑F2"
Delay 1000
KeyPress "F2", 1
t2 = now()
// Exit Do
End If
Delay 3000
差3 = datediff("s", t3, now())
TracePrint 差3
If 差3 >= 23 Then
TracePrint "差3是"&差3
TracePrint "已大于" & 差3 & "并释放第三个技能,玉女穿梭F3"
Delay 1000
KeyPress "F3", 1
t3 = now()
End If
Delay 1000
差4 = datediff("s", t4, now())
TracePrint 差4
If 差4 >= 20 Then
TracePrint "差4是"&差4
TracePrint "已大于" & 差4 & "并释放第四个技能,仙人指路F4"
Delay 1000
KeyPress "F4", 1
t4 = now()
End If
Delay 1000
差5 = datediff("s", t5, now())
TracePrint 差5
If 差5 >= 20 Then
TracePrint "差5是"&差5
TracePrint "已大于" & 差5 & "并释放第五个技能,太渊十三剑F5"
Delay 1000
KeyPress "F5", 1
t5 = now()
End If
Delay 1000
差6 = datediff("s", t6, now())
TracePrint 差6
If 差6 >= 20 Then
TracePrint "差6是"&差6
TracePrint "已大于" & 差6 & "并释放第六个技能,挑帘式F6"
Delay 5000
KeyPress "F6", 1
t6 = now()
End If
Delay 1000
差7 = datediff("s", t7, now())
TracePrint 差7
If 差7 >= 20 Then
TracePrint "差7是"&差7
TracePrint "已大于" & 差7 & "并释放第七个技能,三环套月F7"
Delay 1000
KeyPress "F7", 1
t7 = now()
End If
Delay 1000
差8 = datediff("s", t8, now())
TracePrint 差8
If 差8 >= 20 Then
TracePrint "差8是"&差8
TracePrint "已大于" & 差8 & "并释放第八个技能,真武七截阵F8"
Delay 1000
KeyPress "F8", 1
t8 = now()
End If
Delay 1000
差9 = datediff("s", t9, now())
TracePrint 差9
If 差9 >= 20 Then
TracePrint "差9是"&差9
TracePrint "已大于" & 差9 & "并释放第九个技能,揽雀尾F9"
Delay 1000
KeyPress "F9", 1
t9 = now()
End If
End Sub
Sub OnScriptExit()
MessageBox hwnd
Call Plugin.Window.Top(Hwnd, 1)
End Sub