|
@@ -290,6 +290,8 @@ class ScriptTask(GameUi, GeneralInvite, GeneralRoom, BondlingBattle, SwitchSoul,
|
|
|
elif bondling_config.bondling_search_enable and bondling_config.user_status == UserStatus.ALONE:
|
|
elif bondling_config.bondling_search_enable and bondling_config.user_status == UserStatus.ALONE:
|
|
|
if self.run_search(bondling_config, limit_cnt=random.randint(5, 20)):
|
|
if self.run_search(bondling_config, limit_cnt=random.randint(5, 20)):
|
|
|
logger.info('Bondling search finish, try to run catch')
|
|
logger.info('Bondling search finish, try to run catch')
|
|
|
|
|
+ # 切御魂
|
|
|
|
|
+ self._switch_soul_capture()
|
|
|
continue
|
|
continue
|
|
|
else:
|
|
else:
|
|
|
break # 时间到了或次数到了直接退出
|
|
break # 时间到了或次数到了直接退出
|
|
@@ -368,6 +370,7 @@ class ScriptTask(GameUi, GeneralInvite, GeneralRoom, BondlingBattle, SwitchSoul,
|
|
|
(4) 打满对应limit_cnt次, (探查界面)返回True
|
|
(4) 打满对应limit_cnt次, (探查界面)返回True
|
|
|
"""
|
|
"""
|
|
|
self.lock_team()
|
|
self.lock_team()
|
|
|
|
|
+ self._switch_soul_search()
|
|
|
while 1:
|
|
while 1:
|
|
|
# 检查是不是在探查界面,
|
|
# 检查是不是在探查界面,
|
|
|
if not self.in_search_ui(screenshot=True):
|
|
if not self.in_search_ui(screenshot=True):
|
|
@@ -816,6 +819,37 @@ class ScriptTask(GameUi, GeneralInvite, GeneralRoom, BondlingBattle, SwitchSoul,
|
|
|
type_str, (group, team) = bondling_switch_soul.get_switch_by_name('search_switch')
|
|
type_str, (group, team) = bondling_switch_soul.get_switch_by_name('search_switch')
|
|
|
do_switch_soul(type_str, group, team)
|
|
do_switch_soul(type_str, group, team)
|
|
|
|
|
|
|
|
|
|
+ def _switch_soul_to(self, ts, g, te):
|
|
|
|
|
+ def _do_switch_soul(ts: str, g: str | int, te: str | int):
|
|
|
|
|
+ if ts is None:
|
|
|
|
|
+ raise ValueError(f'Invalid switch soul config on {self.config.bondling_fairyland.bondling_config.bondling_stone_class.value}')
|
|
|
|
|
+ if ts == 'int':
|
|
|
|
|
+ self.run_switch_soul((g, te))
|
|
|
|
|
+ if ts == 'str':
|
|
|
|
|
+ self.run_switch_soul_by_name(g, te)
|
|
|
|
|
+
|
|
|
|
|
+ if ts is None:
|
|
|
|
|
+ logger.warning('Switch soul preset not configured, skip')
|
|
|
|
|
+ return
|
|
|
|
|
+
|
|
|
|
|
+ self.goto_shikigami_records(self.I_GOTO_SHIKIGAMI_COMMON)
|
|
|
|
|
+ _do_switch_soul(ts, g, te)
|
|
|
|
|
+ self.exit_shikigami_records()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ def _switch_soul_search(self):
|
|
|
|
|
+ logger.info("切换御魂-探查")
|
|
|
|
|
+ if not self.config.bondling_fairyland.bondling_switch_soul.enable: return
|
|
|
|
|
+ ts, (g, te) = self.config.bondling_fairyland.bondling_switch_soul.get_switch_by_name('search_switch')
|
|
|
|
|
+ self._switch_soul_to(ts, g, te)
|
|
|
|
|
+
|
|
|
|
|
+ def _switch_soul_capture(self):
|
|
|
|
|
+ logger.info("切换御魂-捕获")
|
|
|
|
|
+ cong = self.config.bondling_fairyland
|
|
|
|
|
+ if not cong.bondling_switch_soul.enable: return
|
|
|
|
|
+ ts, (g, te) = cong.bondling_switch_soul.get_switch_by_enum(cong.bondling_config.bondling_stone_class)
|
|
|
|
|
+ self._switch_soul_to(ts, g, te)
|
|
|
|
|
+
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
|
from module.config.config import Config
|
|
from module.config.config import Config
|
|
@@ -824,7 +858,7 @@ if __name__ == '__main__':
|
|
|
config = Config('oas1')
|
|
config = Config('oas1')
|
|
|
device = Device(config)
|
|
device = Device(config)
|
|
|
t = ScriptTask(config, device)
|
|
t = ScriptTask(config, device)
|
|
|
- # t.run()
|
|
|
|
|
|
|
+ t.run()
|
|
|
t.ui_get_current_page()
|
|
t.ui_get_current_page()
|
|
|
t.ui_goto(page_bondling_fairyland)
|
|
t.ui_goto(page_bondling_fairyland)
|
|
|
# image = task.screenshot()
|
|
# image = task.screenshot()
|