forked from XR-stb/DQN_WUKONG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
restart.py
208 lines (161 loc) · 4.96 KB
/
restart.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# coding=utf-8
import actions
from log import log
from getkeys import is_key_pressed
# 黑风大王处寻路
def heifeng_restart():
# actions.pause()
log.debug("已死亡,自动寻路训练开始")
# 等复活到土地庙先
wait = 30
for i in range(wait, 0, -1):
log.debug('%d秒后复活' % i)
actions.precise_sleep(1)
log.debug('向左ing')
actions.run_with_direct(0.7, 'A')
actions.precise_sleep(1) # 必须等一会儿,不然按键会没响应
log.debug('向前ing')
actions.run_with_direct(9, 'W')
actions.lock_view()
actions.pause()
# 虎先锋八字形寻路,比较稳定
def huxianfeng_restart_v1():
log.debug("已死亡,自动寻路训练开始")
# 等复活到土地庙先
wait = 25
for i in range(wait, 0, -1):
if is_key_pressed('B'):
return
log.debug('%d秒后复活' % i)
actions.precise_sleep(1)
# 用土地庙锁定初始视角
actions.press_E()
actions.precise_sleep(3)
actions.press_ESC()
actions.precise_sleep(3)
actions.go_back(2.5)
actions.precise_sleep(1) # 必须等一会儿,不然按键会没响应
actions.go_right(2)
actions.precise_sleep(1)
times = 4
while times > 0:
times -= 1
actions.run_with_direct(2, 'W')
actions.precise_sleep(1)
if times == 0:
actions.mouse_move(35)
actions.lock_view()
actions.precise_sleep(1)
break
actions.go_right(3)
actions.precise_sleep(1)
actions.run_with_direct(2, 'W')
actions.pause()
# 虎先锋转视角寻路,受到转鼠标视角精度影响,不稳定
def huxianfeng_restart_v2():
log.debug("已死亡,自动寻路训练开始")
# 等复活到土地庙先
wait = 25
for i in range(wait, 0, -1):
if is_key_pressed('B'):
return
log.debug('%d秒后复活' % i)
actions.precise_sleep(1)
# 用土地庙锁定初始视角
actions.press_E()
actions.precise_sleep(4)
actions.press_ESC()
actions.precise_sleep(3)
actions.go_back(2.5)
actions.precise_sleep(1) # 必须等一会儿,不然按键会没响应
actions.go_right(1.6)
actions.precise_sleep(1)
actions.mouse_move(35)
actions.precise_sleep(1)
actions.run_with_direct(11, 'W')
actions.precise_sleep(1)
actions.lock_view()
actions.pause()
actions.run_with_direct(1, 'W')
def yinhu_restart():
log.debug("已死亡,自动寻路训练开始")
# 等复活到土地庙先
wait = 18
for i in range(wait, 0, -1):
if is_key_pressed('B'):
return
log.debug('%d秒后复活' % i)
actions.precise_sleep(1)
actions.go_forward(1.5)
actions.precise_sleep(3) # 必须等一会儿,不然按键会没响应
actions.press_E()
actions.precise_sleep(5)
# 菜单会停留在上次选的那个项(鼠标不移动的情况喜爱)
# actions.press_down()
# actions.precise_sleep(1)
# actions.press_down()
# actions.precise_sleep(1)
actions.dodge()
actions.precise_sleep(5)
log.debug('长按e 跳过动画!')
actions.press_E(3)
actions.precise_sleep(10)
log.debug('ready!')
#开了自动锁定了
#actions.lock_view()
actions.run_with_direct(2, 'W')
actions.pause()
def yinhu_restart_V2():
log.debug("已死亡,自动寻路训练开始")
log.debug('长按e 跳过动画!')
actions.press_E(3)
# 等复活到土地庙先
wait = 8
for i in range(wait, 0, -1):
if is_key_pressed('B'):
return
log.debug('%d秒后复活' % i)
actions.precise_sleep(1)
actions.go_forward(1.5)
actions.precise_sleep(3) # 必须等一会儿,不然按键会没响应
# 交互
actions.press_E(0.5)
actions.precise_sleep(6)
# 上一次点击挑战按钮后,如果sub不在挑战按钮这里,那么就向下移动到挑战
actions.press_down()
actions.precise_sleep(0.2)
actions.press_down()
actions.precise_sleep(0.2)
actions.dodge()
actions.precise_sleep(2)
log.debug('长按e 跳过动画!')
actions.press_E(3)
actions.precise_sleep(9)
log.debug('ready!')
actions.run_with_direct(2, 'W')
actions.pause()
def youhun_restart():
# 等复活到土地庙先
wait = 5
for i in range(wait, 0, -1):
if is_key_pressed('B'):
return
log.debug('%d秒后复活' % i)
actions.precise_sleep(1)
actions.run_with_direct(3, 'W')
actions.precise_sleep(1)
def guangzhi_restart():
wait = 18
for i in range(wait, 0, -1):
if is_key_pressed('B'):
return
log.debug('%d秒后复活' % i)
actions.precise_sleep(1)
actions.run_with_direct(4, 'W')
actions.precise_sleep(4)
actions.lock_view()
actions.pause()
def restart():
yinhu_restart_V2()
if __name__ == "__main__":
restart()