Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions tasks/AutoCheckinBigGod/script_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def run(self):

if not rewards:
logger.info('没有可领取的礼包')
self._cleanup()
self._cleanup(restore_game=True)
self.set_next_run('AutoCheckinBigGod', success=True, finish=True)
raise TaskEnd('AutoCheckinBigGod')

Expand All @@ -154,13 +154,13 @@ def run(self):
time.sleep(0.5)

logger.info(f'完成! 成功领取 {success_count}/{len(rewards)} 个礼包')
self._cleanup()
self._cleanup(restore_game=True)
self.set_next_run('AutoCheckinBigGod', success=True, finish=True)
raise TaskEnd('AutoCheckinBigGod')

# ======================== 清理 ========================

def _cleanup(self):
def _cleanup(self, restore_game=False):
logger.info('清理:关闭大神APP和Frida Server...')
try:
if self._frida_session is not None:
Expand All @@ -178,6 +178,13 @@ def _cleanup(self):
except Exception:
pass

if restore_game:
try:
self.device.app_start()
logger.info('已返回阴阳师前台')
except Exception as e:
logger.warning(f'返回阴阳师失败: {e}')

# ======================== ADB 操作 ========================

def _adb_cmd(self, args, timeout=10):
Expand Down
4 changes: 2 additions & 2 deletions tasks/GameUi/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ class GameUiAssets:
# description
I_MAIN_GOTO_FRIENDS = RuleImage(roi_front=(845,590,55,55), roi_back=(845,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_friends.png")
# 进入花合战
I_MAIN_GOTO_DAILY = RuleImage(roi_front=(765,616,63,38), roi_back=(735,590,120,100), threshold=0.6, method="Template matching", file="./tasks/GameUi/page/page_main_goto_daily.png")
I_MAIN_GOTO_DAILY = RuleImage(roi_front=(779,612,51,67), roi_back=(754,595,89,97), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_daily.png")
# description
I_MAIN_GOTO_MALL = RuleImage(roi_front=(663,623,33,42), roi_back=(620,590,120,100), threshold=0.5, method="Template matching", file="./tasks/GameUi/page/page_main_goto_mall.png")
I_MAIN_GOTO_MALL = RuleImage(roi_front=(663,661,41,22), roi_back=(644,613,81,78), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_mall.png")
# description
I_MAIN_GOTO_GUILD = RuleImage(roi_front=(495,590,50,22), roi_back=(495,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_guild.png")
# description
Expand Down
4 changes: 2 additions & 2 deletions tasks/GameUi/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def link(self, button, destination):
# ************************************* 庭院部分 *****************************************#
# 式神录 shikigami_records
page_shikigami_records = Page(G.I_CHECK_RECORDS)
page_shikigami_records.additional = [G.I_AD_DISAPPEAR, G.I_RECORDS_CLOSE]
page_shikigami_records.additional = [G.I_AD_DISAPPEAR, G.I_RECORDS_CLOSE, GGA.I_UI_CANCEL_SAMLL]
page_shikigami_records.link(button=G.I_BACK_Y, destination=page_main)
page_main.link(button=G.I_MAIN_GOTO_SHIKIGAMI_RECORDS, destination=page_shikigami_records)
# 阴阳术 onmyodo
Expand All @@ -171,7 +171,7 @@ def link(self, button, destination):

# 商店 mall
page_mall = Page(check_button=[G.I_CHECK_MALL, DailyTriflesAssets.I_ROOM_GIFT])
page_mall.additional = [G.I_AD_CLOSE_RED, G.I_BACK_Y, G.I_DLC_CLOSE]
page_mall.additional = [G.I_AD_CLOSE_RED, GGA.I_UI_CANCEL_SAMLL, G.I_BACK_Y]
page_mall.link(button=G.I_BACK_YOLLOW, destination=page_main)
page_main.link(button=G.I_MAIN_GOTO_MALL, destination=page_mall)
# 阴阳寮 guild
Expand Down
12 changes: 6 additions & 6 deletions tasks/GameUi/page/page_img_3.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
{
"itemName": "main_goto_daily",
"imageName": "page_main_goto_daily.png",
"roiFront": "765,616,63,38",
"roiBack": "735,590,120,100",
"roiFront": "779,612,51,67",
"roiBack": "754,595,89,97",
"method": "Template matching",
"threshold": 0.6,
"threshold": 0.7,
"description": "进入花合战"
},
{
"itemName": "main_goto_mall",
"imageName": "page_main_goto_mall.png",
"roiFront": "663,623,33,42",
"roiBack": "620,590,120,100",
"roiFront": "663,661,41,22",
"roiBack": "644,613,81,78",
"method": "Template matching",
"threshold": 0.5,
"threshold": 0.7,
"description": "description"
},
{
Expand Down
Binary file modified tasks/GameUi/page/page_main_goto_daily.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tasks/GameUi/page/page_main_goto_mall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tasks/GlobalGame/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class GlobalGameAssets:
# 短一点的确认
I_UI_CONFIRM_SAMLL = RuleImage(roi_front=(681,392,130,62), roi_back=(558,380,265,99), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_confirm_samll.png")
# 短一点的取消
I_UI_CANCEL_SAMLL = RuleImage(roi_front=(472,389,128,62), roi_back=(472,389,128,62), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_cancel_samll.png")
I_UI_CANCEL_SAMLL = RuleImage(roi_front=(472,389,128,62), roi_back=(360,377,272,185), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_cancel_samll.png")
# description
I_UI_UNCHECK = RuleImage(roi_front=(567,343,33,36), roi_back=(497,303,216,100), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_uncheck.png")
# 勾选
Expand Down
2 changes: 1 addition & 1 deletion tasks/GlobalGame/ui/image.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"itemName": "ui_cancel_samll",
"imageName": "ui_ui_cancel_samll.png",
"roiFront": "472,389,128,62",
"roiBack": "472,389,128,62",
"roiBack": "360,377,272,185",
"method": "Template matching",
"threshold": 0.8,
"description": "短一点的取消"
Expand Down