Skip to content

Commit 1017a52

Browse files
authored
Merge pull request #842 from runhey/dev
Automated PR 2025.05.01
2 parents 006e11e + 8632592 commit 1017a52

File tree

8 files changed

+18
-8
lines changed

8 files changed

+18
-8
lines changed

module/atom/animate.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ def __init__(self,
4747
def name(self) -> str:
4848
return self._name.upper()
4949

50-
def stable(self, image) -> bool:
50+
def stable(self, image, refresh_after_stable: bool = False) -> bool:
5151
"""
5252
用于判断连续的两张截图,的目标区域是否一致
5353
@param image:
54+
@param refresh_after_stable:
5455
@return:
5556
"""
5657
if self._last_image is None:
@@ -62,10 +63,15 @@ def stable(self, image) -> bool:
6263
self._last_image = self.corp(image, self.roi_front)
6364

6465
if matched:
66+
if refresh_after_stable:
67+
self.refresh()
6568
logger.info(f'Animation Stable @ {self.name}')
6669
return True
6770
return False
6871

72+
def refresh(self):
73+
self._last_image = None
74+
6975

7076
if __name__ == '__main__':
7177
from module.base.utils import load_image

tasks/Exploration/solo.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ def run_solo(self):
8080
# 向后拉,寻找怪
8181
if search_fail_cnt >= 4:
8282
search_fail_cnt = 0
83-
if (self._config.exploration_config.exploration_level == ExplorationLevel.EXPLORATION_28 and self.appear(self.I_SWIPE_END)) or self._match_end.stable(self.device.image):
83+
if (self._config.exploration_config.exploration_level == ExplorationLevel.EXPLORATION_28\
84+
and self.appear(self.I_SWIPE_END))\
85+
or self._match_end.stable(self.device.image, refresh_after_stable=True):
8486
self.quit_explore()
8587
continue
8688
if self.swipe(self.S_SWIPE_BACKGROUND_RIGHT, interval=3):
@@ -210,7 +212,9 @@ def run_leader(self):
210212
# 向后拉,寻找怪
211213
if search_fail_cnt >= 4:
212214
search_fail_cnt = 0
213-
if (self._config.exploration_config.exploration_level == ExplorationLevel.EXPLORATION_28 and self.appear(self.I_SWIPE_END)) or self._match_end.stable(self.device.image):
215+
if (self._config.exploration_config.exploration_level == ExplorationLevel.EXPLORATION_28\
216+
and self.appear(self.I_SWIPE_END))\
217+
or self._match_end.stable(self.device.image, refresh_after_stable=True):
214218
self.quit_explore()
215219
continue
216220
if self.swipe(self.S_SWIPE_BACKGROUND_RIGHT, interval=4.5):

tasks/GameUi/assets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class GameUiAssets:
9090

9191
# Image Rule Assets
9292
# description
93-
I_MAIN_GOTO_TOWN = RuleImage(roi_front=(706,249,61,57), roi_back=(200,120,951,298), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_town.png")
93+
I_MAIN_GOTO_TOWN = RuleImage(roi_front=(706,249,61,57), roi_back=(200,120,951,298), threshold=0.6, method="Template matching", file="./tasks/GameUi/page/page_main_goto_town.png")
9494
# description
9595
I_CHECK_TOWN = RuleImage(roi_front=(1026,106,68,82), roi_back=(765,98,402,96), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_town.png")
9696
# description

tasks/GameUi/page/page_img_2.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"roiFront": "706,249,61,57",
66
"roiBack": "200,120,951,298",
77
"method": "Template matching",
8-
"threshold": 0.8,
8+
"threshold": 0.6,
99
"description": "description"
1010
},
1111
{
8.42 KB
Loading

tasks/WeeklyTrifles/assets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class WeeklyTriflesAssets:
7474
# 微信
7575
I_WT_SE_WECHAT = RuleImage(roi_front=(786,627,45,37), roi_back=(786,627,45,37), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/secret/secret_wt_se_wechat.png")
7676
# 勾玉
77-
I_WT_SE_JADE = RuleImage(roi_front=(1123,532,35,39), roi_back=(1123,532,35,39), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/secret/secret_wt_se_jade.png")
77+
I_WT_SE_JADE = RuleImage(roi_front=(1129,527,35,39), roi_back=(1129,527,35,39), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/secret/secret_wt_se_jade.png")
7878
# 排行
7979
I_WT_SE_RANK = RuleImage(roi_front=(1017,572,45,44), roi_back=(989,556,103,81), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/secret/secret_wt_se_rank.png")
8080

tasks/WeeklyTrifles/secret/image.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
{
3030
"itemName": "wt_se_jade",
3131
"imageName": "secret_wt_se_jade.png",
32-
"roiFront": "1123,532,35,39",
33-
"roiBack": "1123,532,35,39",
32+
"roiFront": "1129,527,35,39",
33+
"roiBack": "1129,527,35,39",
3434
"method": "Template matching",
3535
"threshold": 0.8,
3636
"description": "勾玉"
-11 Bytes
Loading

0 commit comments

Comments
 (0)