|
@@ -2,6 +2,7 @@
|
|
|
# @author runhey
|
|
# @author runhey
|
|
|
# github https://github.com/runhey
|
|
# github https://github.com/runhey
|
|
|
import time
|
|
import time
|
|
|
|
|
+from datetime import timedelta, datetime
|
|
|
|
|
|
|
|
from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
|
|
from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
|
|
|
from tasks.Exploration.assets import ExplorationAssets
|
|
from tasks.Exploration.assets import ExplorationAssets
|
|
@@ -9,6 +10,7 @@ from tasks.Exploration.config import ChooseRarity, AutoRotate, AttackNumber
|
|
|
from tasks.Component.GeneralBattle.general_battle import GeneralBattle
|
|
from tasks.Component.GeneralBattle.general_battle import GeneralBattle
|
|
|
from tasks.GameUi.game_ui import GameUi
|
|
from tasks.GameUi.game_ui import GameUi
|
|
|
from tasks.GameUi.page import page_exploration, page_shikigami_records, page_main
|
|
from tasks.GameUi.page import page_exploration, page_shikigami_records, page_main
|
|
|
|
|
+from tasks.RealmRaid.script_task import ScriptTask as RealmRaidScriptTask
|
|
|
|
|
|
|
|
from module.logger import logger
|
|
from module.logger import logger
|
|
|
from module.exception import RequestHumanTakeover, TaskEnd
|
|
from module.exception import RequestHumanTakeover, TaskEnd
|
|
@@ -66,16 +68,49 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, ExplorationAssets):
|
|
|
f' Enter {explorationConfig.exploration_config.exploration_level} failed!')
|
|
f' Enter {explorationConfig.exploration_config.exploration_level} failed!')
|
|
|
raise RequestHumanTakeover
|
|
raise RequestHumanTakeover
|
|
|
|
|
|
|
|
- # 只探索7次
|
|
|
|
|
- if explorationConfig.exploration_config.attack_number == AttackNumber.SEVEN:
|
|
|
|
|
|
|
+ # 探索
|
|
|
|
|
+ exploration_count = explorationConfig.exploration_config.current_exploration_count
|
|
|
|
|
+ # logger.info("探索执行次数:" + str(exploration_count))
|
|
|
|
|
+ if exploration_count > 0:
|
|
|
count = 0
|
|
count = 0
|
|
|
- while count < 7:
|
|
|
|
|
|
|
+ while count < exploration_count:
|
|
|
if self.wait_until_appear(self.I_E_EXPLORATION_CLICK, wait_time=1):
|
|
if self.wait_until_appear(self.I_E_EXPLORATION_CLICK, wait_time=1):
|
|
|
|
|
+ # 如果突破卷超出设定数量,退出循环,去打个突
|
|
|
|
|
+ con_scrolls = self.config.exploration.scrolls
|
|
|
|
|
+ # 如果打开绘卷模式
|
|
|
|
|
+ if con_scrolls.scrolls_on:
|
|
|
|
|
+ if con_scrolls.scrolls_cd > 0:
|
|
|
|
|
+ self.screenshot()
|
|
|
|
|
+ cu, res, total = self.O_REALM_RAID_NUMBER1.ocr(self.device.image)
|
|
|
|
|
+ if cu >= con_scrolls.scrolls_number:
|
|
|
|
|
+ # 设定下次探索时间
|
|
|
|
|
+ next_run = datetime.now() + timedelta(minutes=con_scrolls.scrolls_cd)
|
|
|
|
|
+ self.set_next_run(task='Exploration', success=False, finish=False, target=next_run)
|
|
|
|
|
+
|
|
|
|
|
+ self.appear_then_click(self.I_RED_CLOSE)
|
|
|
|
|
+ self.ui_goto(page_main)
|
|
|
|
|
+ # 关闭 buff
|
|
|
|
|
+ if con.buff_gold_50_click or con.buff_gold_100_click or con.buff_exp_50_click or con.buff_exp_100_click:
|
|
|
|
|
+ self.open_buff()
|
|
|
|
|
+ self.gold_50(is_open=False)
|
|
|
|
|
+ self.gold_100(is_open=False)
|
|
|
|
|
+ self.exp_50(is_open=False)
|
|
|
|
|
+ self.exp_100(is_open=False)
|
|
|
|
|
+ self.close_buff()
|
|
|
|
|
+
|
|
|
|
|
+ # 去打个突
|
|
|
|
|
+ RealmRaidScriptTask(config=self.config, device=self.device).run()
|
|
|
|
|
+
|
|
|
self.click(self.I_E_EXPLORATION_CLICK)
|
|
self.click(self.I_E_EXPLORATION_CLICK)
|
|
|
count += 1
|
|
count += 1
|
|
|
|
|
+ logger.info("exploration count :" + str(count))
|
|
|
# 进入战斗环节
|
|
# 进入战斗环节
|
|
|
self.battle_process()
|
|
self.battle_process()
|
|
|
- if self.appear(self.I_EXPLORATION_TITLE):
|
|
|
|
|
|
|
+ # 判断宝箱
|
|
|
|
|
+ if self.appear_then_click(self.I_TREASURE_BOX_CLICK, interval=1.8):
|
|
|
|
|
+ self.open_expect_level()
|
|
|
|
|
+ # 判断妖气
|
|
|
|
|
+ elif self.appear(self.I_EXPLORATION_TITLE):
|
|
|
self.open_expect_level()
|
|
self.open_expect_level()
|
|
|
|
|
|
|
|
if self.wait_until_appear(self.I_RED_CLOSE, wait_time=2):
|
|
if self.wait_until_appear(self.I_RED_CLOSE, wait_time=2):
|