|
@@ -24,12 +24,6 @@ class ScriptTask(OrochiScriptTask, TrueOrochiAssets):
|
|
|
|
|
|
|
|
conf = self.config.true_orochi.true_orochi_config
|
|
conf = self.config.true_orochi.true_orochi_config
|
|
|
|
|
|
|
|
- # 周一重置真蛇次数
|
|
|
|
|
- now = datetime.now()
|
|
|
|
|
- day_of_week = now.weekday()
|
|
|
|
|
- if day_of_week == 0:
|
|
|
|
|
- conf.current_success = 0
|
|
|
|
|
-
|
|
|
|
|
if conf.current_success >= 2:
|
|
if conf.current_success >= 2:
|
|
|
# 超过两次就说明这周打完了没有必要再打了
|
|
# 超过两次就说明这周打完了没有必要再打了
|
|
|
logger.warning('This week is full')
|
|
logger.warning('This week is full')
|
|
@@ -101,6 +95,13 @@ class ScriptTask(OrochiScriptTask, TrueOrochiAssets):
|
|
|
if self.appear_then_click(self.I_UI_CONFIRM, interval=1):
|
|
if self.appear_then_click(self.I_UI_CONFIRM, interval=1):
|
|
|
continue
|
|
continue
|
|
|
if self.appear_then_click(self.I_ST_FIRE, interval=4):
|
|
if self.appear_then_click(self.I_ST_FIRE, interval=4):
|
|
|
|
|
+ # 修正已经挑战的次数, 注意这个是战斗开始之前的次数
|
|
|
|
|
+ current, current_success, total = self.O_TIMES.ocr(self.device.image)
|
|
|
|
|
+ if current_success < 0 or current_success > 2:
|
|
|
|
|
+ continue
|
|
|
|
|
+ logger.info(f'current: {current}, current_success: {current_success}, total: {total}')
|
|
|
|
|
+ conf.current_success = current_success
|
|
|
|
|
+ self.config.save()
|
|
|
continue
|
|
continue
|
|
|
if self.appear_then_click(self.I_FIND_TS, interval=1):
|
|
if self.appear_then_click(self.I_FIND_TS, interval=1):
|
|
|
continue
|
|
continue
|
|
@@ -179,21 +180,25 @@ class ScriptTask(OrochiScriptTask, TrueOrochiAssets):
|
|
|
:param current_success: 这周的成功次数
|
|
:param current_success: 这周的成功次数
|
|
|
:return:
|
|
:return:
|
|
|
"""
|
|
"""
|
|
|
- # now = datetime.now()
|
|
|
|
|
- # now_year, now_week_number, now_weekday = now.isocalendar()
|
|
|
|
|
- # if battle:
|
|
|
|
|
- # next_run = now + self.config.true_orochi.scheduler.success_interval
|
|
|
|
|
- # else:
|
|
|
|
|
- # next_run = now + self.config.true_orochi.scheduler.failure_interval
|
|
|
|
|
- # next_run_year, next_run_week_number, next_run_weekday = next_run.isocalendar()
|
|
|
|
|
- # # 如果下次运行的时间是下一周,那么就重置成功次数
|
|
|
|
|
- # if now_week_number != next_run_week_number:
|
|
|
|
|
- # self.config.true_orochi.true_orochi_config.current_success = 0
|
|
|
|
|
- # else:
|
|
|
|
|
- # # 如果不是下一周,那么就加一
|
|
|
|
|
- # self.config.true_orochi.true_orochi_config.current_success += 1
|
|
|
|
|
- # self.set_next_run(task='TrueOrochi', target=next_run)
|
|
|
|
|
- self.set_next_run('TrueOrochi', finish=True, success=True)
|
|
|
|
|
|
|
+ now = datetime.now()
|
|
|
|
|
+ now_year, now_week_number, now_weekday = now.isocalendar()
|
|
|
|
|
+ if battle:
|
|
|
|
|
+ next_run = now + self.config.true_orochi.scheduler.success_interval
|
|
|
|
|
+ else:
|
|
|
|
|
+ next_run = now + self.config.true_orochi.scheduler.failure_interval
|
|
|
|
|
+ next_run_year, next_run_week_number, next_run_weekday = next_run.isocalendar()
|
|
|
|
|
+ # 如果下次运行的时间是下一周,那么就重置成功次数
|
|
|
|
|
+ if now_week_number != next_run_week_number:
|
|
|
|
|
+ logger.info('Reset current_success')
|
|
|
|
|
+ self.config.true_orochi.true_orochi_config.current_success = 0
|
|
|
|
|
+ else:
|
|
|
|
|
+ # 如果不是下一周,那么就加一
|
|
|
|
|
+ logger.info('Add current_success by 1')
|
|
|
|
|
+ self.config.true_orochi.true_orochi_config.current_success += 1
|
|
|
|
|
+ self.config.true_orochi.true_orochi_config.current_success = min(2, self.config.true_orochi.true_orochi_config.current_success)
|
|
|
|
|
+ self.config.save()
|
|
|
|
|
+ self.set_next_run(task='TrueOrochi', target=next_run)
|
|
|
|
|
+ # self.set_next_run('TrueOrochi', finish=True, success=True)
|
|
|
|
|
|
|
|
def run_true_orochi(self) -> bool:
|
|
def run_true_orochi(self) -> bool:
|
|
|
pass
|
|
pass
|