Open hwef opened 3 weeks ago
源码这里写的不是很好
# 切换御魂
for i in range(5):
sleep(0.8)
self.screenshot()
self.O_SS_TEAM_NAME.keyword = teamName
if self.ocr_appear_click_by_rule(self.O_SS_TEAM_NAME, self.I_SOU_CLICK_PRESENT, interval=1):
continue
if self.appear_then_click(self.I_SOU_SWITCH_SURE, interval=1):
break
logger.info(f'Switch soul_one group {groupName} team {teamName}')
改了
感觉还是会有问题 点击的时候会点到御魂预设的名称进入编辑界面然后就会跳出 我改了让它选中御魂后多点击几次 修改如下
为什么for k in range(4) 是为了多次兼容更换御魂时的确定和更换契灵的确定 `
for i in range(5):
sleep(1)
self.screenshot()
self.O_SS_TEAM_NAME.keyword = teamName
if not is_changed and self.ocr_appear_click_by_rule(self.O_SS_TEAM_NAME, self.I_SOU_CLICK_PRESENT, interval=1) :
for k in range(4):
sleep(0.5)
self.screenshot()
self.appear_then_click(self.I_SOU_SWITCH_SURE, interval=1)
is_changed = True
continue
_**def ocr_appear_click_by_rule(self,
target: RuleOcr,
action: Union[RuleClick, RuleLongClick] = None,
interval: float = None,
duration: float = None) -> bool:
"""
ocr识别目标,如果目标存在,则触发动作
:param target:
:param action:
:param interval:
:param duration:
:return:
"""
appear = self.ocr_appear(target, interval)
if not appear:
return False
x1, y1, w1, h1 = target.area
x, y, w, h = action.roi_back
for i in range(3):
self.device.click(x=x, y=y1, control_name=target.name)
sleep(0.5)
return True**_
`
没看懂你说的问题,要不录一个视频,
在提问之前...
描述你的问题
切换御魂中多次切换御魂导致界面卡死
如何复现
预期行为
No response
相关 Logs
截图
还有别的吗?
No response