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
1 change: 1 addition & 0 deletions config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
"card_rule": "auto",
"exchange_before": true,
"exchange_max": true,
"exchange_auto": true,
"exchange_smart": false,
"shikigami_class": "N"
}
Expand Down
Binary file added tasks/KekkaiActivation/a/a_a_auto_put.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions tasks/KekkaiActivation/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,7 @@ class KekkaiActivationAssets:
# description
I_CARDS_MOON_1 = RuleImage(roi_front=(190,430,93,74), roi_back=(173,156,123,492), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/cards/cards_cards_moon_1.png")

#auto_put_assets
i_AUTO_PUT = RuleImage(roi_front=(1149,509,44,42), roi_back=(1145,504,54,52), threshold=0.8, method="Template matching",file="./tasks/KekkaiActivation/a/a_a_auto_put.png")


4 changes: 1 addition & 3 deletions tasks/KekkaiActivation/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ class ActivationConfig(BaseModel):
card_type: CardType = Field(default=CardType.TAIKO, description='card_rule_help')
min_taiko_num: int = Field(default=8, description='挂卡太鼓每小时最少收益,低于则不挂卡')
min_fish_num: int = Field(default=16, description='挂卡斗鱼每小时最少收益,低于则不挂卡')
exchange_before: bool = Field(default=True, description='exchange_before_help')
exchange_max: bool = Field(default=True, description='exchange_max_help')
exchange_auto: bool = Field(default=True, description='是否使用智能放入')
shikigami_class: ShikigamiClass = Field(default=ShikigamiClass.N, description='shikigami_class_help')
card_not_found_count: int = Field(default=0, description='未发现卡次数')


class KekkaiActivation(ConfigBase):
scheduler: ActivationScheduler = Field(default_factory=ActivationScheduler)
activation_config: ActivationConfig = Field(default_factory=ActivationConfig)
26 changes: 8 additions & 18 deletions tasks/KekkaiActivation/script_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ def run(self):
# 进入寮结界
self.goto_realm()

if con.exchange_before:
self.check_max_lv(con.shikigami_class)
if con.exchange_auto:
self.check_max_lv()

# 收取经验
self.harvest_card()
# 开始挂卡
Expand All @@ -55,8 +56,9 @@ def run(self):
if self.appear_then_click(self.I_UI_BACK_RED, interval=1):
continue

if con.exchange_max:
self.check_max_lv(con.shikigami_class)
if con.exchange_auto:
self.check_max_lv()

# self.back_guild()
self.ui_get_current_page()
self.ui_goto(page_main)
Expand Down Expand Up @@ -363,23 +365,11 @@ def _card_not_found(self):

def check_max_lv(self, shikigami_class: ShikigamiClass = ShikigamiClass.N):
"""
在结界界面,进入式神育成,检查是否有满级的,如果有就换下一个

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: check_max_lvshikigami_class 参数现在已经未被使用,可以考虑移除。

由于 check_max_lv 已经不再使用 shikigami_class,并且调用方也不再传入该参数,继续在函数签名中保留它会具有误导性。请考虑移除该参数,或者为其引入一个有意义的用途(例如在智能放入不可用时作为回退方案),以保持 API 的清晰和准确。

建议的实现方式:

        if con.exchange_auto:
            self.check_max_lv()

        # self.back_guild()
        self.ui_get_current_page()
        self.ui_goto(page_main)

    def check_max_lv(self):
        """
        在结界界面,进入式神育成,如果显示了智能放入按钮,则使用
        :return:
        """
        self.realm_goto_grown()
  1. 在代码库中搜索所有 check_max_lv 的调用。如果仍有调用传入 shikigami_class(例如 self.check_max_lv(ShikigamiClass.N)),请移除该实参,使其改为调用 self.check_max_lv()
  2. 如果该参数在任何外部文档或注释中被提及,请更新相关内容以反映移除 shikigami_class 后的新函数签名。
Original comment in English

suggestion: The shikigami_class parameter of check_max_lv is now unused and could be removed.

Since check_max_lv no longer uses shikigami_class and callers no longer pass it, keeping the parameter in the signature is misleading. Please either remove it or introduce a meaningful use (e.g., as a fallback when auto-put is unavailable) to keep the API clear and accurate.

Suggested implementation:

        if con.exchange_auto:
            self.check_max_lv()

        # self.back_guild()
        self.ui_get_current_page()
        self.ui_goto(page_main)

    def check_max_lv(self):
        """
        在结界界面,进入式神育成,如果显示了智能放入按钮,则使用
        :return:
        """
        self.realm_goto_grown()
  1. Search for all other usages of check_max_lv in the codebase. If any calls still pass shikigami_class (e.g., self.check_max_lv(ShikigamiClass.N)), remove the argument so they call self.check_max_lv() instead.
  2. If the parameter was referenced in any external documentation or comments, update those to reflect the new signature without shikigami_class.

退出的时候还是结界界面
在结界界面,进入式神育成,如果显示了智能放入按钮,则使用
:return:
"""
self.realm_goto_grown()
if self.appear(self.I_RS_LEVEL_MAX):
# 存在满级的式神
logger.info('Exist max level shikigami and replace it')
self.unset_shikigami_max_lv()
self.switch_shikigami_class(shikigami_class)
self.set_shikigami(shikigami_order=7, stop_image=self.I_RS_NO_ADD)
else:
logger.info('No max level shikigami')
if self.detect_no_shikigami():
logger.warning('There are no any shikigami grow room')
self.switch_shikigami_class(shikigami_class)
self.set_shikigami(shikigami_order=7, stop_image=self.I_RS_NO_ADD)
self.appear_then_click(self.i_AUTO_PUT, interval=2)

# 回到结界界面
while 1:
Expand Down
Loading