Starry-Wind / StarRailAssistant

崩坏:星穹铁道自动化 | 崩坏:星穹铁道自动锄大地 | 崩坏:星穹铁道锄大地 | 自动锄大地 | 基于模拟按键
GNU General Public License v3.0
2.8k stars 236 forks source link

[Bug] 1.5版本后,会出现加载地图识别过短问题导致漏怪 #763

Open jy02664402 opened 10 months ago

jy02664402 commented 10 months ago

问题描述

流云渡、迴星港、丹鼎司、鳞渊境,主要是这4个地方,会出现加载地图还未完成,就提前执行脚本,导致第一个脚本全部漏怪,加载时间通常识别为0.001秒。

预期行为

等待加载完地图再执行脚本

实际行为

还在加载地图就执行脚本

截图或录屏

image

自动锄大地脚本版本

StarRailAssistant-1.8.7

星穹铁道区服

国服

运行的客户端

PC

日志

日志文件.log

dConstantineb commented 10 months ago

我也是,就是传星球第一个图的时候绝对出现这个问题,然后换地图的时候偶尔出现这个问题,地图还没加载完就跑图导致漏一大堆怪。 我是改了utils文件夹里maps.py第202行的“time.sleep(2) # 加2s防止人物未加载”,然后我改成7勉强能用

稍微看了下源码,问题应该在calculated.py第821行的wait_join函数,不过不知道怎么改

jy02664402 commented 10 months ago

我是在容易出问题的地方,多加了个地图脚本,让他先发生bug1次再跑。不知道是不是作者有什么事,池子都要结束了,还没更新……

dConstantineb commented 10 months ago

我是在容易出问题的地方,多加了个地图脚本,让他先发生bug1次再跑。不知道是不是作者有什么事,池子都要结束了,还没更新…… 你试试在caculated.py搜索【log.info(_("已进入地图"))】,前面的if判断改为:self.compare_lists([0, 0, 222], self.get_pix_hsv(game_pos=(1766, 30))) and self.compare_lists(self.get_pix_hsv(game_pos=(1766, 30)), [0, 0, 240]) and self.compare_lists([20, 90, 80], self.get_pix_hsv(game_pos=(88, 979))) and self.compare_lists(self.get_pix_hsv(game_pos=(88, 979)), [25, 100, 90])

jy02664402 commented 10 months ago

我是在容易出问题的地方,多加了个地图脚本,让他先发生bug1次再跑。不知道是不是作者有什么事,池子都要结束了,还没更新…… 你试试在caculated.py搜索【log.info(_("已进入地图"))】,前面的if判断改为:self.compare_lists([0, 0, 222], self.get_pix_hsv(game_pos=(1766, 30))) and self.compare_lists(self.get_pix_hsv(game_pos=(1766, 30)), [0, 0, 240]) and self.compare_lists([20, 90, 80], self.get_pix_hsv(game_pos=(88, 979))) and self.compare_lists(self.get_pix_hsv(game_pos=(88, 979)), [25, 100, 90])

感谢回复!加了以后直接运行不了了,不太懂python,可能是我格式不对?