-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,64 @@ | ||
from tasks.power.power import Power | ||
from .doubleactivity import DoubleActivity | ||
from module.screen import screen | ||
from module.automation import auto | ||
from module.logger import log | ||
from tasks.power.instance import Instance | ||
from tasks.weekly.universe import Universe | ||
import time | ||
|
||
|
||
class PlanarFissure(DoubleActivity): | ||
def __init__(self, name, enabled, instance_names): | ||
super().__init__(name, enabled) | ||
self.instance_names = instance_names | ||
|
||
def _run_instances(self, reward_count): | ||
# 暂未支持自动刷取模拟宇宙领取奖励 | ||
Power.merge("immersifier") | ||
if reward_count == 0: | ||
return True | ||
|
||
instance_type = "饰品提取" | ||
instance_name = self.instance_names[instance_type] | ||
|
||
power = Power.get() | ||
full_runs = power // 40 | ||
|
||
screen.change_to('guide3') | ||
instance_type_crop = (262.0 / 1920, 289.0 / 1080, 422.0 / 1920, 624.0 / 1080) | ||
|
||
auto.click_element(instance_type, "text", crop=instance_type_crop) | ||
# 等待界面完全停止 | ||
time.sleep(1) | ||
|
||
# 需要判断是否有可用存档 | ||
if auto.find_element("无可用存档", "text", crop=(688.0 / 1920, 289.0 / 1080, 972.0 / 1920, 369.0 / 1080), include=True): | ||
# 刷差分宇宙存档 | ||
if Universe.start(nums=1, save=False, category="divergent"): | ||
# 验证存档 | ||
screen.change_to('guide3') | ||
auto.click_element(instance_type, "text", crop=instance_type_crop) | ||
# 等待界面完全停止 | ||
time.sleep(1) | ||
if auto.find_element("无可用存档", "text", crop=(688.0 / 1920, 289.0 / 1080, 972.0 / 1920, 369.0 / 1080), include=True): | ||
log.error("暂无可用存档") | ||
return True | ||
else: | ||
return True | ||
|
||
screen.change_to("guide3") | ||
|
||
immersifier_crop = (1623.0 / 1920, 40.0 / 1080, 162.0 / 1920, 52.0 / 1080) | ||
text = auto.get_single_line_text(crop=immersifier_crop, blacklist=['+', '米'], max_retries=3) | ||
if "/8" not in text: | ||
log.error("沉浸器数量识别失败") | ||
return True | ||
|
||
immersifier_count = int(text.split("/")[0]) | ||
log.info(f"🟣沉浸器: {immersifier_count}/8") | ||
|
||
count = min(immersifier_count + full_runs, reward_count) | ||
|
||
if count > 0: | ||
Instance.run("饰品提取", instance_name, 40, count) | ||
|
||
return True |