-
Notifications
You must be signed in to change notification settings - Fork 67
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
DoctorReid
committed
Aug 18, 2024
1 parent
68f995b
commit 81057d2
Showing
19 changed files
with
150 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
- entry_name: "房屋残骸" | ||
event_name: "事件坍塌的房屋" | ||
event_name: "坍塌的房屋" | ||
lcs_percent: 0.5 | ||
options: | ||
- option_name: "强行拜访" | ||
|
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,5 +1,5 @@ | ||
- entry_name: "活化结晶" | ||
event_name: "事件活化结晶" | ||
event_name: "活化结晶" | ||
lcs_percent: 0.6 | ||
options: | ||
- option_name: "加工为战斗物资" | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
- entry_name: "精锐邦布助手" | ||
event_name: "武装升级" | ||
options: | ||
- option_name: "失去1枚A级鸣徽,获得1枚S级鸣徽" | ||
- option_name: "失去1 枚B级鸣徽,获得1枚A级鸣徽" | ||
- option_name: "用1枚S级鸣徽更换3个随机鸣徽" | ||
- option_name: "离开" | ||
|
||
- entry_name: "精锐邦布助手" | ||
event_name: "随机交换" | ||
options: | ||
- option_name: "离开" | ||
- option_name: "用所有鸣徽,交换等量鸣徽" | ||
|
||
- entry_name: "精锐邦布助手" | ||
event_name: "精锐邦布助手" | ||
lcs_percent: 0.8 | ||
options: | ||
- option_name: "我是法厄同,送我!" | ||
desc: "压力值+50,获得0~3枚鸣徽" | ||
- option_name: "获得基础礼包" | ||
desc: "获得1枚B级鸣徽" | ||
- option_name: "升级可购买物资礼包" | ||
desc: "花费300齿轮硬币" |
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
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
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import time | ||
|
||
from typing import List | ||
|
||
from cv2.typing import MatLike | ||
|
||
from one_dragon.base.matcher.match_result import MatchResultList, MatchResult | ||
from one_dragon.base.operation.operation_edge import node_from | ||
from one_dragon.base.operation.operation_node import operation_node | ||
from one_dragon.base.operation.operation_round_result import OperationRoundResult | ||
from one_dragon.utils import cv2_utils, str_utils | ||
from one_dragon.utils.i18_utils import gt | ||
from zzz_od.context.zzz_context import ZContext | ||
from zzz_od.operation.hollow_zero.event import resonium_utils | ||
from zzz_od.operation.zzz_operation import ZOperation | ||
|
||
|
||
class SwitchResonium(ZOperation): | ||
|
||
def __init__(self, ctx: ZContext): | ||
""" | ||
在选择鸣徽的画面了 选择一个 | ||
:param ctx: | ||
""" | ||
ZOperation.__init__( | ||
self, ctx, | ||
op_name=gt('交换鸣徽') | ||
) | ||
|
||
@operation_node(name='选择', is_start_node=True) | ||
def choose_one(self) -> OperationRoundResult: | ||
screen = self.screenshot() | ||
|
||
item_list = resonium_utils.get_to_choose_list(self.ctx, screen, '交换') | ||
if len(item_list) == 0: | ||
return self.round_retry(status='识别不到选项', wait=0.5) | ||
|
||
idx_list = resonium_utils.choose_resonium_by_priority([i.data for i in item_list], | ||
self.ctx.hollow_zero_challenge_config.resonium_priority) | ||
if len(idx_list) == 0: | ||
return self.round_retry(status='优先级无返回', wait=0.5) | ||
|
||
mr = item_list[idx_list[0]] | ||
self.ctx.controller.click(mr.center) | ||
time.sleep(0.1) | ||
return self.round_by_click_area('零号空洞-事件', '空白', success_wait=0.9) | ||
|
||
@node_from(from_name='选择', success=False) # 防止识别有问题 兜底随便选一个 | ||
@operation_node(name='兜底选择') | ||
def choose_default(self): | ||
screen = self.screenshot() | ||
area = self.ctx.screen_loader.get_area('零号空洞-事件', '底部-选择列表') | ||
return self.round_by_ocr_and_click(screen, '交换', area=area, | ||
success_wait=1, retry_wait=1, | ||
color_range=[(240, 240, 240), (255, 255, 255)]) | ||
|
||
|
||
|
||
|
||
|
||
|
||
def __debug(): | ||
ctx = ZContext() | ||
ctx.init_by_config() | ||
ctx.start_running() | ||
ctx.ocr.init_model() | ||
op = ChooseResonium(ctx) | ||
op.execute() | ||
|
||
|
||
if __name__ == '__main__': | ||
__debug() |
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