|
|
@@ -67,26 +67,30 @@ class ScriptTask(GameUi, GeneralBattle, GeneralInvite, SwitchSoul, HuntAssets):
|
|
|
self.tomorrow_kirin_day = True
|
|
|
|
|
|
now = datetime.now()
|
|
|
- # 如果时间在00:00-19:00 之间则设定时间为当天的自定义时间,返回False
|
|
|
- if now.time() < time(19, 0):
|
|
|
- if self.kirin_day:
|
|
|
- logger.info('Today is the Kirin day')
|
|
|
+ # 如果时间在可执行时间(麒麟日6:00、阴界日19:00)之前则设定时间为当天的自定义时间,返回False
|
|
|
+ # 如果是在可执行时间则返回True
|
|
|
+ if self.kirin_day:
|
|
|
+ logger.info('Today is the Kirin day')
|
|
|
+ if now.time() < time(6, 0):
|
|
|
self.custom_next_run(task='Hunt', custom_time=self.con_time.kirin_time, time_delta=0)
|
|
|
+ raise TaskEnd('Hunt')
|
|
|
+ # 如果是麒麟日在23:00-23:59之间则设定时间为明天的自定义时间,返回False
|
|
|
+ elif now.time() > time(23, 0):
|
|
|
+ self.plan_tomorrow_hunt()
|
|
|
+ raise TaskEnd('Hunt')
|
|
|
else:
|
|
|
- logger.info('Today is the Netherworld day')
|
|
|
- self.custom_next_run(task='Hunt', custom_time=self.con_time.netherworld_time, time_delta=0)
|
|
|
- raise TaskEnd('Hunt')
|
|
|
- # 如果是麒麟日在21:00-23:59之间则设定时间为明天的自定义时间,返回False
|
|
|
- elif now.time() > time(21, 0) and self.kirin_day:
|
|
|
- self.plan_tomorrow_hunt()
|
|
|
- raise TaskEnd('Hunt')
|
|
|
- # 如果是阴界日在23:00-23:59之间则设定时间为明天的自定义时间,返回False
|
|
|
- elif now.time() > time(23, 0) and not self.kirin_day:
|
|
|
- self.plan_tomorrow_hunt()
|
|
|
- raise TaskEnd('Hunt')
|
|
|
- # 如果是在19:00-21:00之间则返回True
|
|
|
+ return True
|
|
|
else:
|
|
|
- return True
|
|
|
+ logger.info('Today is the Netherworld day')
|
|
|
+ if now.time() < time(19, 0):
|
|
|
+ self.custom_next_run(task='Hunt', custom_time=self.con_time.netherworld_time, time_delta=0)
|
|
|
+ raise TaskEnd('Hunt')
|
|
|
+ # 如果是阴界日在23:00-23:59之间则设定时间为明天的自定义时间,返回False
|
|
|
+ elif now.time() > time(23, 0):
|
|
|
+ self.plan_tomorrow_hunt()
|
|
|
+ raise TaskEnd('Hunt')
|
|
|
+ else:
|
|
|
+ return True
|
|
|
|
|
|
def plan_tomorrow_hunt(self):
|
|
|
# 安排次日狩猎战,便于复用
|
|
|
@@ -99,29 +103,22 @@ class ScriptTask(GameUi, GeneralBattle, GeneralInvite, SwitchSoul, HuntAssets):
|
|
|
|
|
|
def kirin(self):
|
|
|
logger.hr('kirin', 2)
|
|
|
- # TODO: 没有碰到:(1)麒麟未开 (2)麒麟已经挑战完毕
|
|
|
while 1:
|
|
|
self.screenshot()
|
|
|
-
|
|
|
- if self.appear(self.I_KIRIN_END):
|
|
|
- # 你的阴阳寮已经打过的麒麟了
|
|
|
- logger.warning('Your guild have already challenged the Kirin')
|
|
|
- self.plan_tomorrow_hunt()
|
|
|
- raise TaskEnd('Hunt')
|
|
|
- if self.appear_then_click(self.I_KIRIN_CHALLAGE, interval=0.9):
|
|
|
+ if self.appear(self.I_FIRE):
|
|
|
+ self.click_fire()
|
|
|
break
|
|
|
- if self.click(self.C_HUNT_ENTER, interval=2.9):
|
|
|
+ if self.appear_then_click(self.I_UI_CONFIRM, interval=0.9):
|
|
|
continue
|
|
|
- logger.info('Arrive the Kirin')
|
|
|
- self.ui_click(self.I_KIRIN_CHALLAGE, self.I_KIRIN_GATHER)
|
|
|
- # 等待进入战斗
|
|
|
- # 等待挑战, 5秒也是等
|
|
|
- sleep(5)
|
|
|
- self.device.stuck_record_add('BATTLE_STATUS_S')
|
|
|
- self.wait_until_disappear(self.I_KIRIN_GATHER)
|
|
|
- self.device.stuck_record_clear()
|
|
|
- self.device.stuck_record_add('BATTLE_STATUS_S')
|
|
|
- self.run_general_battle()
|
|
|
+ if self.appear_then_click(self.I_KIRIN_CHALLAGE, interval=1.5):
|
|
|
+ continue
|
|
|
+ if self.appear(self.I_KIRIN_END):
|
|
|
+ # 今日已挑战
|
|
|
+ logger.warning('Today have already challenged the Kirin')
|
|
|
+ self.ui_click_until_disappear(self.I_UI_BACK_YELLOW)
|
|
|
+ return
|
|
|
+ logger.info('Start battle')
|
|
|
+ self.run_general_battle()
|
|
|
|
|
|
|
|
|
def netherworld(self):
|