Skip to content

Commit

Permalink
fix 黄泉不出祝福bug
Browse files Browse the repository at this point in the history
fix 无法移除目录弹窗
  • Loading branch information
CHNZYX committed Aug 29, 2024
1 parent f498b9c commit 8c8d32c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def clean_temp_files():
if 'ppocr_keys_v1.txt' not in models_list or 'v3_det.onnx' not in models_list or 'v4_rec.onnx' not in models_list:
continue
try:
shutil.rmtree(file_path)
shutil.rmtree(file_path, ignore_errors=True)
except:
pass

Expand Down
3 changes: 2 additions & 1 deletion simul.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ def normal(self):
if self.speed and not self.quan and self.check("huangquan", 0.0578,0.7083):
self.quan = 1
if self.floor_init == 0:
self.get_level()
if self.get_level() == -1:
return 1
self.floor_init = 1
self.lst_changed = bk_lst_changed
self.battle = 0
Expand Down
6 changes: 5 additions & 1 deletion utils/simul/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,12 @@ def get_now_direc(self, loc_scr):
return ang

def get_level(self):
while not self.isrun():
tm = time.time()
while not self.isrun() and time.time() - tm < 8:
time.sleep(0.1)
self.get_screen()
if time.time() - tm >= 8:
return -1
time.sleep(max(0, (self.fail_count - 1) * 10))
time.sleep(1)
self.press("m", 0.2)
Expand All @@ -639,6 +642,7 @@ def get_level(self):
break
self.press("m", 0.2)
time.sleep(1)
return 0

def goodf(self):
if not self.check("f", 0.4443, 0.4417, mask="mask_f1", threshold=0.96):
Expand Down

0 comments on commit 8c8d32c

Please sign in to comment.