Skip to content

Commit

Permalink
Merge pull request #118 from sanmusen214/dev
Browse files Browse the repository at this point in the history
Fit: global server easy quest
  • Loading branch information
sanmusen214 authored Oct 22, 2024
2 parents 349cf79 + 7660474 commit 314b8a1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 21 deletions.
1 change: 0 additions & 1 deletion DATA/assets/PopupName.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ class PopupName:
POPUP_MOMOTALK = "POPUP_MOMOTALK"
POPUP_CAFE_REPLACE = "POPUP_CAFE_REPLACE"
POPUP_CHAPTER_INFO = "POPUP_CHAPTER_INFO"
POPUP_EASY_QUEST = "POPUP_EASY_QUEST"
11 changes: 3 additions & 8 deletions modules/AllTask/InQuest/HardQuest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,18 @@ def on_run(self) -> None:
"en_US": "Click on level {} from the top down ".format(level_ind+1)})
ScrollSelect(level_ind, 190, 306, 630, 1116,
lambda: not match_pixel(Page.MAGICPOINT, Page.COLOR_WHITE)).run()
if quest_has_easy_tab():
has_easy_tab = quest_has_easy_tab()
if has_easy_tab:
# 适配日服简易攻略
click((385, 183))
screenshot()
if not match(popup_pic(PopupName.POPUP_EASY_QUEST)):
# 匹配简易攻略弹窗失败
logging.warn({"zh_CN": "简易攻略:未能匹配到扫荡弹窗,跳过",
"en_US": "Easy Quest: Cannot match the raid popup, skip"})
break
else:
screenshot()
if not match(popup_pic(PopupName.POPUP_TASK_INFO)):
# 匹配弹窗失败
logging.warn({"zh_CN": "未能匹配到扫荡弹窗,跳过", "en_US": "Cannot match the raid popup, skip"})
break
# 扫荡
RaidQuest(repeat_times, has_easy_tab=config.userconfigdict["SERVER_TYPE"] == "JP").run()
RaidQuest(repeat_times, has_easy_tab=has_easy_tab).run()

# 关闭弹窗,直到看到hard按钮
close_popup_until_see(button_pic(ButtonName.BUTTON_HARD))
Expand Down
11 changes: 3 additions & 8 deletions modules/AllTask/InQuest/NormalQuest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,18 @@ def on_run(self) -> None:
click(Page.MAGICPOINT)
ScrollSelect(level_ind, 190, 288, 628, 1115, lambda: not match_pixel(Page.MAGICPOINT, Page.COLOR_WHITE)).run()
# 如果匹配到弹窗,看看是不是扫荡的弹窗,

if quest_has_easy_tab():
has_easy_tab = quest_has_easy_tab()
if has_easy_tab:
# 适配简易攻略
click((385, 183))
screenshot()
if not match(popup_pic(PopupName.POPUP_EASY_QUEST)):
# 匹配简易攻略弹窗失败
logging.warn({"zh_CN": "简易攻略:未能匹配到扫荡弹窗,跳过", "en_US":"Easy Quest: Cannot match the raid popup, skip"})
break
else:
screenshot()
if not match(popup_pic(PopupName.POPUP_TASK_INFO)):
# 匹配弹窗失败
logging.warn({"zh_CN": "未能匹配到扫荡弹窗,跳过", "en_US":"Cannot match the raid popup, skip"})
break
# 扫荡
RaidQuest(repeat_times, has_easy_tab=config.userconfigdict["SERVER_TYPE"]=="JP").run()
RaidQuest(repeat_times, has_easy_tab=has_easy_tab).run()
# 清除所有弹窗
close_popup_until_see(button_pic(ButtonName.BUTTON_NORMAL))
# 清除所有弹窗
Expand Down
2 changes: 1 addition & 1 deletion modules/AllTask/SubTask/RaidQuest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RaidQuest(Task):
recall_close:function
回调函数,用于后续关闭弹窗,通常建议将关闭操作放在此class外部
has_easy_tab: bool
是否有简易攻略tab,用于适配日服简易攻略扫荡弹窗
是否有简易攻略tab,用于适配简易攻略扫荡弹窗
"""

def __init__(self, raidtimes, recall_close=None, has_easy_tab=False, name="RaidQuest") -> None:
Expand Down
2 changes: 1 addition & 1 deletion modules/configs/MyConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MyConfigger:
"""
维护config字典,包含软件config,用户任务config,语言包
"""
NOWVERSION="1.6.7"
NOWVERSION="1.6.8"
USER_CONFIG_FOLDER="./BAAH_CONFIGS"
SOFTWARE_CONFIG_FOLDER="./DATA/CONFIGS"
LANGUAGE_PACKAGE_FOLDER="./DATA/i18n"
Expand Down
4 changes: 2 additions & 2 deletions modules/configs/defaultSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@

"AUTO_ASSAULT_LEVEL":{"d":4},

"RUN_UNTIL_TRY_TIMES":{"d":6},
"RUN_UNTIL_WAIT_TIME":{"d":1.5},
"RUN_UNTIL_TRY_TIMES":{"d":9},
"RUN_UNTIL_WAIT_TIME":{"d":0.6},

# 是否直接使用emulator-5554这种序列号
"ADB_DIRECT_USE_SERIAL_NUMBER":{"d":False},
Expand Down

0 comments on commit 314b8a1

Please sign in to comment.