chnzyx / auto_simulated_universe Goto Github PK
View Code? Open in Web Editor NEW崩坏:星穹铁道 模拟宇宙自动化 (Honkai Star Rail - Auto Simulated Universe)
License: MIT License
崩坏:星穹铁道 模拟宇宙自动化 (Honkai Star Rail - Auto Simulated Universe)
License: MIT License
The error when writing to a file, was solved by adding an encoding to all file opening functions.
Example:
with open('logs/notif.txt','w', encoding="gb2312") as fh:
建议在选不到对应命途祝福时,增加一个优先级选项。比如打第6世界,记忆是打boss完全没用的祝福,虚无(除了弱点击破)和欢愉如果没有对应角色,效果依然很低,存护/毁灭/丰饶比较通用。
结束程序重新运行,一识别到地图就报错。
手动打完后进入下一区域就正常了
INFO [2023-05-25 13:22:56,075] [admin.py:29] isUserAdmin - CheckTokenMembership returned: True
WARNING [2023-05-25 13:22:57,649] [utils.py:31] 等待游戏窗口
INFO [2023-05-25 13:23:00,954] [states.py:32] 加载地图
INFO [2023-05-25 13:23:01,333] [states.py:38] 加载地图完成,共 114 张
INFO [2023-05-25 13:23:03,831] [utils.py:584] 地图编号:92676 相似度:0.542528735632184
地图文件:
[ WARN:[email protected]] global loadsave.cpp:244 cv::findDecoder imread_(''): can't open/read file: check file path/integrity
E: 运行函数时出现错误
Traceback (most recent call last):
File "E:\Downloads\Compressed\CentOS-LLVM-Fork-main\gui.py", line 38, in run
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "E:\Downloads\Compressed\CentOS-LLVM-Fork-main\states.py", line 329, in start
self.route()
File "E:\Downloads\Compressed\CentOS-LLVM-Fork-main\states.py", line 75, in route
res = self.normal()
^^^^^^^^^^^^^
File "E:\Downloads\Compressed\CentOS-LLVM-Fork-main\states.py", line 172, in normal
self.now_loc = (4096 - int(xy[0]), 4096 - int(xy[1]))
~~^^^
IndexError: list index out of range
在遇到第11层虚构史学家事件时,会卡在丢弃祝福这一步中,忘截图了。
有时候挂机的时候弹出什么弹窗之类的会把游戏窗口的前台抢走,此时程序就停了;或者用一些远程桌面软件连接(比如向日葵)也可能抢前台。
强制前台和断点回复功能是冲突的,因此有些人不需要这个功能;但对于我外出或者晚上睡觉挂机这种场合是不需要断点回复的。
鉴于现在有 GUI 了,能否考虑在 GUI 或者配置文件里加个选项,或者某个快捷键来控制是否打开强制前台功能?
两种实现方式,一种是用快捷键开关是否强制前台,另一种是打开了强制前台后,如果检测到游戏没在前台,则每过一定时间(比如说 20 秒)把游戏切到前台
如下:
C:\Users\19492\DOWNLO1\AUTO_S3\AUTO_S~1>python align_angle.py
WARNING [2023-05-21 00:41:54,260] [utils.py:30] 等待游戏窗口
C:\Users\19492\DOWNLO1\AUTO_S3\AUTO_S~1>pause
人物有在动和转向,但是·很慢,最好显示的也是pause
如题,有时会跑到这俩玩意边上(当然也有下载装置,但是一般够下载一个人所以不会卡死),依旧会触发F,导致程序卡在复活选择页面或者沉浸领取页面
或许可以针对这几个的文本识别增添黑名单或者条件?
INFO [2023-06-12 23:51:18,625] [align_angle.py:76] 校准完成
WARNING [2023-06-12 23:51:25,685] [utils.py:77] 等待游戏窗口
INFO [2023-06-12 23:51:27,000] [states.py:62] 加载地图
INFO [2023-06-12 23:51:27,594] [states.py:68] 加载地图完成,共 47 张
INFO [2023-06-12 23:51:27,719] [utils.py:227] 匹配到图片 ./imgs/f.jpg 相似度 0.992240 阈值 0.970000
INFO [2023-06-12 23:51:28,538] [utils.py:227] 匹配到图片 ./imgs/f.jpg 相似度 0.992249 阈值 0.970000
0.8487523794174194
DEBUG [2023-06-12 23:51:28,545] [utils.py:115] 按下按钮 f,等待 0 秒后释放
INFO [2023-06-12 23:51:29,535] [states.py:512] 匹配不到任何图标
INFO [2023-06-12 23:51:30,607] [utils.py:227] 匹配到图片 ./imgs/init.jpg 相似度 0.996731 阈值 0.955000
INFO [2023-06-12 23:51:32,201] [utils.py:227] 匹配到图片 ./imgs/begin.jpg 相似度 0.996317 阈值 0.970000
INFO [2023-06-12 23:51:34,619] [utils.py:227] 匹配到图片 ./imgs/start.jpg 相似度 0.983151 阈值 0.970000
INFO [2023-06-12 23:51:36,212] [utils.py:227] 匹配到图片 ./imgs/yes.jpg 相似度 0.998937 阈值 0.970000
INFO [2023-06-12 23:51:37,811] [states.py:512] 匹配不到任何图标
INFO [2023-06-12 23:51:38,885] [utils.py:227] 匹配到图片 ./imgs/fate.jpg 相似度 0.983170 阈值 0.955000
INFO [2023-06-12 23:51:40,474] [utils.py:227] 匹配到图片 ./imgs/fate_2.jpg 相似度 0.994509 阈值 0.970000
INFO [2023-06-12 23:51:42,078] [states.py:512] 匹配不到任何图标
INFO [2023-06-12 23:51:43,156] [states.py:512] 匹配不到任何图标
INFO [2023-06-12 23:51:44,239] [states.py:512] 匹配不到任何图标
INFO [2023-06-12 23:51:48,446] [states.py:337] 地图编号:89201 相似度:0.546031746031746
E: 运行函数时出现错误
Traceback (most recent call last):
File "gui\choose.py", line 31, in run
File "states.py", line 698, in start
File "states.py", line 116, in route
File "states.py", line 346, in normal
FileNotFoundError: [Errno 2] No such file or directory: 'check0.txt'
校准后开始运行,但是在第二步就会卡住(选择宇宙的难度页面),无限返回“匹配不到任何图标”。
[states.py:418] 匹配不到任何图标
这里通过手动点击开始/手动选择角色,强行进入模拟宇宙关卡后,角色基本可以自动执行至第一个精英处,但是在打掉第一个精英后会有大概率卡在沉浸奖励的对话框那里,由于会先自动点击对话框,然后就在沉浸奖励的选择页面卡住,此时依然会无限返回“匹配不到任何图标”。
具体可见log文件
Traceback (most recent call last):
File "C:\Users\maiki\DOCUME~1\HONKAI~1\AUTO_S~1\states.py", line 253, in <module>
main()
File "C:\Users\maiki\DOCUME~1\HONKAI~1\AUTO_S~1\states.py", line 249, in main
su.route()
File "C:\Users\maiki\DOCUME~1\HONKAI~1\AUTO_S~1\states.py", line 57, in route
res=self.normal()
^^^^^^^^^^^^^
File "C:\Users\maiki\DOCUME~1\HONKAI~1\AUTO_S~1\states.py", line 155, in normal
self.get_direc()
File "C:\Users\maiki\DOCUME~1\HONKAI~1\AUTO_S~1\utils\utils.py", line 278, in get_direc
ang=math.atan2(loc[0]-self.real_loc[0],loc[1]-self.real_loc[1])/math.pi*180
~~~~~~^~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'tuple' and 'int'```
本地远程桌面开启gui
主桌面开启notif
notif不计数以下是日志
log_2023-06-09-17-35.txt
notif.txt
log.txt
可以弄成一个可选模式
如题,一号位是白露,有时会卡在墙角——由于画面左上角有敌人,但攻击不到,就会卡在墙角一直攻击
世界6难度2发现3个基本一定迷路循环到退出重开的地图。
目前均没有截图保留。
后面复现我再截图过来补充。
請問要如何後台運行
INFO [2023-06-08 10:00:18,557] [admin.py:29] isUserAdmin - CheckTokenMembership returned: True
WARNING [2023-06-08 10:00:25,003] [utils.py:76] 等待游戏窗口
E: 运行函数时出现错误
Traceback (most recent call last):
File "C:\Users\michael\Downloads\Auto_Simulated_Universe-main\Auto_Simulated_Universe-main\gui\choose.py", line 31, in run
res = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\michael\Downloads\Auto_Simulated_Universe-main\Auto_Simulated_Universe-main\states.py", line 57, in init
notif('开始运行',f'初始计数:{self.count}')
File "C:\Users\michael\Downloads\Auto_Simulated_Universe-main\Auto_Simulated_Universe-main\utils\utils.py", line 30, in notif
cnt=s[0].strip('\n')
~^^^
IndexError: list index out of range
Exception in thread Thread-13 (start):
Traceback (most recent call last):
File "C:\Users\michael\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "C:\Users\michael\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\michael\Downloads\Auto_Simulated_Universe-main\Auto_Simulated_Universe-main\gui\choose.py", line 65, in start
run(page.su.start)
^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'start'
事实上该项目已经录入了很完整的地图信息,大多情况下都可以正常使用
但部分情况下,无法匹配到高相似度的地图,这时候就需要手动录入地图信息(实际上,录入的过程也很方便)
然而这存在一个问题,手动录入的地图信息和原有地图信息并没有区分开。这不方便版本间、玩家间的地图信息迁移。
比如我在v4.08下录入的地图信息,难以方便的迁移至v4.3版本。而我们也难以方便的共享自己录入的地图信息以及导入别人录入的地图信息。
所以,也许在imgs\maps上添加分支,比如项目自带的地图信息放在origin,而手动录入的地图信息可以自定义一个tag,又或者简单的哈希一个值是个好主意。
或许可以参考隔壁,不主动攻击而是匹配感叹号等待被攻击?
“只支持1920*1080(窗口化或全屏幕),关闭HDR。”
不太清奇HDR具体指带什么,是设置中的某一项吗?
请求更多信息,
附日志
log.zip
已经确认通过update.bat更新到了最新版本
无论是python states.py --find=1
启动还是python gui.py
启动都会报错,已经使用了管理员权限,报错信息如下
❯ python states.py --find=1
INFO [2023-06-12 11:19:25,640] [states.py:706] find: 1, debug: 0, show_map: 0
WARNING [2023-06-12 11:19:25,645] [utils.py:77] 等待游戏窗口
Traceback (most recent call last):
File "D:\Download\github\Auto_Simulated_Universe-main\states.py", line 724, in <module>
main()
File "D:\Download\github\Auto_Simulated_Universe-main\states.py", line 707, in main
su = SimulatedUniverse(find, debug, show_map, speed, update)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Download\github\Auto_Simulated_Universe-main\states.py", line 56, in __init__
self.update_count()
File "D:\Download\github\Auto_Simulated_Universe-main\states.py", line 542, in update_count
s=fh.readlines()
^^^^^^^^^^^^^^
File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 3: invalid continuation byte
❯ python gui.py
INFO [2023-06-12 11:19:38,084] [admin.py:29] isUserAdmin - CheckTokenMembership returned: True
WARNING [2023-06-12 11:19:51,229] [utils.py:77] 等待游戏窗口
E: 运行函数时出现错误
Traceback (most recent call last):
File "D:\Download\github\Auto_Simulated_Universe-main\gui\choose.py", line 31, in run
res = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "D:\Download\github\Auto_Simulated_Universe-main\states.py", line 56, in __init__
self.update_count()
File "D:\Download\github\Auto_Simulated_Universe-main\states.py", line 542, in update_count
s=fh.readlines()
^^^^^^^^^^^^^^
File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 3: invalid continuation byte
Exception in thread Thread-28 (start):
Traceback (most recent call last):
File "E:\miniconda\envs\autosr\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "E:\miniconda\envs\autosr\Lib\threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "D:\Download\github\Auto_Simulated_Universe-main\gui\choose.py", line 73, in start
run(page.su.start)
^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'start'
您好,请问是对分辨率有何要求吗?进入模拟宇宙地图内后攻击两下乱走
Auto_Simulated_Universe\align_angle.py", line 55, in main win32gui.SetForegroundWindow(su.my_nd)
这里好像有点问题,没有这个属性。
50级后默认打开6模拟是2,但是打不过。。。能不能再info.txt中加一个参数来判断来选择 模拟6的第一个?
update.bat is not working properly
'git' is not recognized as an internal or external command, executable program or batch file.
INFO [2023-06-10 14:17:38,609] [utils.py:226] 匹配到图片 ./imgs/f.jpg 相似度 0.989913 阈值 0.970000
INFO [2023-06-10 14:17:39,330] [utils.py:226] 匹配到图片 ./imgs/f.jpg 相似度 0.988069 阈值 0.970000
INFO [2023-06-10 14:17:39,332] [utils.py:226] 匹配到图片 ./imgs/tele.jpg 相似度 0.984512 阈值 0.965000
INFO [2023-06-10 14:17:39,332] [states.py:254] 地图-1已完成,相似度-1,进入13层
DEBUG [2023-06-10 14:17:39,336] [utils.py:114] 按下按钮 f,等待 0 秒后释放
DEBUG [2023-06-10 14:17:40,343] [utils.py:114] 按下按钮 1,等待 0 秒后释放
DEBUG [2023-06-10 14:17:42,076] [utils.py:114] 按下按钮 esc,等待 0 秒后释放
F8 已被按下,尝试停止运行
INFO [2023-06-10 14:17:44,487] [states.py:606] 尝试停止运行
INFO [2023-06-10 14:17:45,132] [states.py:354] 通关!当前层数:1
INFO [2023-06-10 14:17:45,837] [states.py:130] 停止运行
大佬能不能给优化一下orz
关底BOSS前的黑塔能不能把主选祝福按高到低升级一下,不然练度低不大稳
大佬录的模拟6 难度1吗? 会不会难度等级不一样 地图不一样? 我这边难度2 连续试了三个地图 都对不上号
F:\Auto_Simulated_Universe>python align_angle.py
INFO [2023-06-12 13:31:47,430] [align_angle.py:30] 开始校准
WARNING [2023-06-12 13:31:47,436] [utils.py:77] 等待游戏窗口
[0]
F:\Auto_Simulated_Universe\align_angle.py:58: RuntimeWarning: divide by zero encountered in scalar divide
su.multi *= ax / ay
Traceback (most recent call last):
File "F:\Auto_Simulated_Universe\align_angle.py", line 81, in
main()
File "F:\Auto_Simulated_Universe\align_angle.py", line 42, in main
su.mouse_move(60)
File "F:\Auto_Simulated_Universe\utils\utils.py", line 903, in mouse_move
dx = int(9800 * y * 1295 / self.real_width / 180 * self.multi)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OverflowError: cannot convert float infinity to integer
报错时
x: 60
y: 30
self.real_width: 1920
dx: inf
显示器分辨率:2560x1440
游戏分辨率:1920x1080(窗口模式)
In states.py
function update_count(self,read=True)
The code
time_cnt = os.path.getmtime(file_name)
should be execute after if os.path.exists(file_name):
to prevent FileNotFoundError .
This is the code after fixed.
def update_count(self,read=True):
file_name = 'logs/notif.txt'
if read:
if os.path.exists(file_name):
time_cnt = os.path.getmtime(file_name)
with open(file_name,'r') as fh:
s=fh.readlines()
new_cnt = int(s[0].strip('\n'))
try:
time_cnt = float(s[3].strip('\n'))
except:
pass
else:
new_cnt = 0
os.makedirs('logs',exist_ok=1)
with open(file_name, 'w') as file:
file.write("0")
file.close()
time_cnt = os.path.getmtime(file_name)
#win32api.SetFileAttributes(file_name, win32con.FILE_ATTRIBUTE_HIDDEN)
else:
new_cnt = self.count + 1
time_cnt = self.count_tm
dt = datetime.datetime.fromtimestamp(time.time())
current_weekday = dt.weekday()
monday = dt + datetime.timedelta(days=-current_weekday)
target_datetime = datetime.datetime(monday.year, monday.month, monday.day, 4, 0, 0)
monday_ts = target_datetime.timestamp()
if dt.timestamp()>=monday_ts and time_cnt<monday_ts:
self.count=not read
else:
self.count=new_cnt
self.count_tm = time.time()
info.txt not included in the file?
现在的打法很容易到最后一层还凑不齐两个回响,希望能尽量多走战斗凑够回响。
以及希望能出奇物黑名单功能,例如在巡猎命途下不选其他命途的火漆。
提高电脑寿命(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.