Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
CHNZYX committed Jul 14, 2024
1 parent 9aea090 commit f498b9c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 deletions.
19 changes: 19 additions & 0 deletions actions/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,25 @@
}
]
},
{
"name": "确认界面",
"trigger":{
"text": "确认",
"box": [1111, 1225, 750, 792],
"redundancy": 30
},
"actions":
[
{
"text": "确认",
"box": [1111, 1225, 750, 792],
"redundancy": 30
},
{
"sleep": 1
}
]
},
{
"name": "确认界面",
"trigger":{
Expand Down
2 changes: 1 addition & 1 deletion actions/event.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
�¼�����,��ˢѡ��,����ѡ��,�ر�ѡ��
ռ��,����ܷ���,�����Σ��,�ó̻�˳��
ռ,����ܷ���,�����Σ��,�ó̻�˳��
�泲,��Ҫ����Ѻע,,����泲
����,"����-���","����-���",ս��
��������,�Ҽ�������-����Ƭ,�Ҽ�������-����Ƭ,
Expand Down
44 changes: 26 additions & 18 deletions diver.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,24 @@ def loop(self):
# exit()
res = self.run_static()
if res == '':
text = self.merge_text(self.ts.find_with_box([400, 1920, 100, 600], redundancy=0))
if self.speed and '转化' in text and '继续战斗' not in text and ('数据' in text or '过量' in text):
print('ready to stop')
time.sleep(6)
tm = time.time()
while time.time() - tm < 15:
print('trying to stop')
self.press('esc')
time.sleep(2)
self.ts.forward(self.get_screen())
static_res = self.run_static(action_list=['过量转化'])
if static_res != '':
print(static_res)
break
area_text = self.clean_text(self.ts.ocr_one_row(self.screen, [50, 350, 3, 35]), char=0)
if '位面' in area_text or '区域' in area_text or '第' in area_text:
self.area()
else:
text = self.merge_text(self.ts.find_with_box([400, 1920, 100, 600], redundancy=0))
if self.speed and '转化' in text and '继续战斗' not in text and ('数据' in text or '过量' in text):
print('ready to stop')
time.sleep(6)
tm = time.time()
while time.time() - tm < 15:
print('trying to stop')
self.press('esc')
time.sleep(2)
self.ts.forward(self.get_screen())
static_res = self.run_static(action_list=['过量转化'])
if static_res != '':
print(static_res)
break
if self.end and res == '加载界面':
self.press('esc')
time.sleep(2)
Expand Down Expand Up @@ -406,7 +410,7 @@ def portal_opening_days(self, aimed=0, static=0, deep=0):
if portal['score'] == 0:
portal = self.find_portal()
else:
if self.forward_until([portal['type'] if portal['score'] else '区域'], timeout=3, moving=moving):
if self.forward_until([portal['type']] if portal['score'] else ['区域','结束','退出'], timeout=3, moving=moving):
self.init_floor()
return
else:
Expand Down Expand Up @@ -450,7 +454,7 @@ def event(self):
self.event_solved = 1
tm = time.time()
while time.time() - tm < 20:
title_text = self.merge_text(self.ts.find_with_box([170, 850, 900, 1020], redundancy=0), char=0)
title_text = self.clean_text(self.ts.ocr_one_row(self.screen, [185, 820, 945, 1005]), char=0)
print(title_text)
if event_id[0] == -1:
for i, e in enumerate(self.event_prior):
Expand Down Expand Up @@ -711,8 +715,9 @@ def area(self):
keyops.keyDown('w')
self.press('a', 0.3)
time.sleep(3)
self.press('d', 0.3)
self.press('d', 0.2)
keyops.keyUp('w')
time.sleep(0.25)
self.portal_opening_days(aimed=1)
elif area_now == '商店':
pyautogui.click()
Expand All @@ -725,7 +730,10 @@ def area(self):
self.portal_opening_days(static=1)
elif area_now == '首领':
if self.floor == 13 and self.area_state > 0:
self.close_and_exit()
if config.weekly_mode:
self.portal_opening_days(aimed=1)
else:
self.close_and_exit()
self.end_of_uni()
return
if self.area_state == 0:
Expand Down

0 comments on commit f498b9c

Please sign in to comment.