自己用按键精灵编写的昆特赛季平局代码,感觉功能不连贯,求大佬帮助
本帖最后由 sj940 于 2020-4-2 19:06 编辑一开始用按键精灵编写写的代码是这样的,感觉遇到突发状况,如掉线啊,对面突然投降啊,就不能使用了
For 100
i = 0
While i=0
FindPic 0,0,800,500,"Attachment:\赛季.bmp",0.6,intX,intY
If intX > 0 And intY > 0 Then
i = 1
MoveTo 377, 353
Delay 100
LeftDoubleClick 3
End If
Delay 500
Wend
Delay 10000
While i=1
FindPic 250,400,800,600,"Attachment:\手牌调度完毕.bmp",0.6,intX,intY
If intX > 0 And intY > 0 Then
i = 2
MoveTo 579, 711
LeftDoubleClick 2
Delay 1000
KeyPress "Enter", 1
Delay 500
FindPic 1000,300,1400,500,"Attachment:\我方放弃跟牌.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
i = 3
KeyDown "Space", 1
Delay 3000
KeyUp "Space", 1
End If
End If
Wend
Delay 2000
While i=2
FindPic 1000,300,1400,500,"Attachment:\我方放弃跟牌.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
i = 3
KeyDown "Space", 1
Delay 3000
KeyUp "Space", 1
End If
Wend
Delay 5000
While i=3
FindPic 1000,300,1400,500,"Attachment:\我方放弃跟牌.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
i = 4
KeyDown "Space", 1
Delay 3000
KeyUp "Space", 1
End If
Wend
Delay 3000
While i=4
FindPic 300,300,800,800,"Attachment:\继续.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
i=5
KeyPress "Enter", 1
Delay 3000
KeyUp "Enter", 1
Delay 3000
KeyPress "Esc", 1
End If
Delay 1000
Wend
Next
于是想写成那种前半部分分析界面状态,后半部分决定反应的程序,但是苦于自己是小白,不会弄,求大佬帮忙解惑
While i=0
FindPic 0,0,800,500,"Attachment:\赛季.bmp",0.6,intX,intY
If intX > 0 And intY > 0 Then
i = 1
MoveTo 377, 353
Delay 500
LeftDoubleClick 3
Delay 500
End If
Wend
FindPic 250,400,800,600,"Attachment:\手牌调度完毕.bmp",0.6,intX,intY
If intX > 0 And intY > 0 Then
i=2
End If
FindPic 1000,300,1400,500,"Attachment:\我方放弃跟牌.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
i=3
End If
FindPic 300,300,800,800,"Attachment:\继续.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
i=5
End If
if i = 2 then
MoveTo 579, 711
LeftDoubleClick 2
Delay 1000
KeyPress "Enter", 1
Delay 500
End If
if i = 3 then
KeyDown "Space", 1
Delay 3000
KeyUp "Space", 1
End If
if i = 4 then
KeyDown "Space", 1
Delay 3000
KeyUp "Space", 1
End If
if i = 5 then
KeyPress "Enter", 1
Delay 3000
KeyUp "Enter", 1
End If 本帖最后由 Abcde 于 2020-4-2 19:57 编辑
你这个脚本好短啊, Abcde 发表于 2020-4-2 19:55
你这个脚本好短啊,
因为他只需要这一个功能{:1_907:}哈哈,今天赛季更替,逻辑正在大改,嘿嘿 如掉线啊,对面突然投降啊
有什么特征吗照写对应方案就行吧愚见{:1_918:}
页:
[1]