747929791 / MajsoulAI

以JianYangAI作后端,进行在线雀魂对局
MIT License
274 stars 59 forks source link

请问一直无法识别窗口可能是什么问题呢 #5

Open TGDXAT opened 4 years ago

TGDXAT commented 4 years ago

雀魂已经进入对局,处于屏幕最前端,大小为75%窗口大小,分辨率1920*1080,放缩125%,一直显示如下log

PS H:\majsoul\majsoul_wrapper-master> python3 main.py waiting to calibrate the browser location Number of good matches: 9 Not enough matches are found - 9/50 majsoul menu not found, calibrate again Number of good matches: 11 Not enough matches are found - 11/50 majsoul menu not found, calibrate again Number of good matches: 11 Not enough matches are found - 11/50 majsoul menu not found, calibrate again Number of good matches: 12 Not enough matches are found - 12/50 majsoul menu not found, calibrate again Number of good matches: 3 Not enough matches are found - 3/50 majsoul menu not found, calibrate again Number of good matches: 3 Not enough matches are found - 3/50 majsoul menu not found, calibrate again Number of good matches: 5 Not enough matches are found - 5/50 majsoul menu not found, calibrate again Number of good matches: 5 Not enough matches are found - 5/50 majsoul menu not found, calibrate again Number of good matches: 3 Not enough matches are found - 3/50 majsoul menu not found, calibrate again Number of good matches: 8 Not enough matches are found - 8/50 majsoul menu not found, calibrate again Number of good matches: 10 Not enough matches are found - 10/50 majsoul menu not found, calibrate again Number of good matches: 12 Not enough matches are found - 12/50 majsoul menu not found, calibrate again Number of good matches: 12 Not enough matches are found - 12/50 majsoul menu not found, calibrate again Number of good matches: 5 Not enough matches are found - 5/50 majsoul menu not found, calibrate again Number of good matches: 6 Not enough matches are found - 6/50 majsoul menu not found, calibrate again Number of good matches: 9 Not enough matches are found - 9/50 majsoul menu not found, calibrate again Number of good matches: 10 Not enough matches are found - 10/50 majsoul menu not found, calibrate again Number of good matches: 7

此处以下进入对局

Not enough matches are found - 7/50 majsoul menu not found, calibrate again Number of good matches: 5 Not enough matches are found - 5/50 majsoul menu not found, calibrate again Number of good matches: 2 Not enough matches are found - 2/50 majsoul menu not found, calibrate again Number of good matches: 6 Not enough matches are found - 6/50 majsoul menu not found, calibrate again Number of good matches: 7 Not enough matches are found - 7/50 majsoul menu not found, calibrate again Number of good matches: 16 Not enough matches are found - 16/50 majsoul menu not found, calibrate again Number of good matches: 5 Not enough matches are found - 5/50 majsoul menu not found, calibrate again Number of good matches: 17 Not enough matches are found - 17/50 majsoul menu not found, calibrate again Number of good matches: 10 Not enough matches are found - 10/50 majsoul menu not found, calibrate again Number of good matches: 10 Not enough matches are found - 10/50 majsoul menu not found, calibrate again Number of good matches: 13 Not enough matches are found - 13/50 majsoul menu not found, calibrate again Number of good matches: 8 Not enough matches are found - 8/50 majsoul menu not found, calibrate again Number of good matches: 9 Not enough matches are found - 9/50 majsoul menu not found, calibrate again Number of good matches: 5 Not enough matches are found - 5/50 majsoul menu not found, calibrate again Number of good matches: 7 Not enough matches are found - 7/50 majsoul menu not found, calibrate again Number of good matches: 5 Not enough matches are found - 5/50 majsoul menu not found, calibrate again

按下ctrl+c

Traceback (most recent call last): File "main.py", line 742, in MainLoop(level=level) File "main.py", line 669, in MainLoop time.sleep(3) KeyboardInterrupt PS H:\majsoul\majsoul_wrapper-master>

747929791 commented 4 years ago

可以试试把自己的主页图片全屏截图替换掉majsoul_wrapper\action\template\menu.png,然后浏览器在主界面处等待校准。

TGDXAT commented 4 years ago

噢是这样,要在主界面校准吗,我以为是进入对局之后再打开脚本,今天停服维护,晚上我再试一下

TGDXAT commented 4 years ago

这个办法有效,但是报错发生了改变,校准之后一个黑色窗口闪过几行代码之后就没有下一步动作了,进入对局后也没有下一步动作,power shell一直显示 waiting for the AI ,log如下

PS C:\Users\Voidx20> cd H:\majsoul\majsoul_wrapper-master PS H:\majsoul\majsoul_wrapper-master> python main.py waiting to calibrate the browser location Number of good matches: 2193 Homography Matrix: [[9.91732494e-01 1.81944791e-03 5.29704153e+02] [2.39041922e-04 9.91711160e-01 2.66788804e+02] [4.35788285e-07 1.43637102e-06 1.00000000e+00]] Similarity: 0.9960364687155834 create AI subprocess locally starting up on 127.0.0.1 port 7479 waiting for the AI

TGDXAT commented 4 years ago

黑色窗口log如下 ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg', 'player'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['data', 'meld'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['data', 'meld'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['data', 'meld'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['data', 'meld'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['msg', 'attr_name'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['auth_code'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'ai_obj', 'opponent_class', 'user_id', 'user_name', 'lobby_type', 'game_type', 'logger_obj', 'drawer'], varargs=None, keywords=None, defaults=(None,)) ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'success'], varargs=None, keywords=None, defaults=(True,)) ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=('',)) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg', 'meld_tile'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'game_type'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self', 'msg'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None) ArgSpec(args=['ai_obj', 'opponent_class', 'user', 'username', 'lobbytype', 'gametype', 'logger_obj', 'drawer'], varargs=None, keywords=None, defaults=(None,)) ArgSpec(args=[], varargs=None, keywords=None, defaults=None) ArgSpec(args=['drawer'], varargs=None, keywords=None, defaults=(None,)) ArgSpec(args=[], varargs=None, keywords=None, defaults=None)

747929791 commented 4 years ago

看来是AI不明原因崩溃了= =

TGDXAT commented 4 years ago

能定位问题或者有解决方案嘛

747929791 commented 4 years ago

感觉像是python环境的问题,试试开两个终端用“远程AI模式”运行一下?

TGDXAT commented 4 years ago

感觉也像,VS调试报错No module named 'sklearn' pip install中 早知道不在辣鸡WIN10 应用商店装python了,老是缺胳膊少腿

TGDXAT commented 4 years ago

最后到这里,解决不了了,powershell提示Successfully installed analysis-0.1.7 但是仍旧报错No module named 'analysis.analyzer'

TGDXAT commented 4 years ago

大佬要不用pip freeze --all > requirements.txt 把你已经安装的库版本信息发一份呗,让我看看缺了啥

747929791 commented 4 years ago

感觉像是路径的问题,analysis.analyzer是JianYangAI/analysis.py,没啥用可以把里面的代码注释掉,我怀疑是remote.py调用AI子进程的代码和系统不太兼容,可以试试把remote.py移动到JianYangAI里然后把cwd='JianYangAI'去掉试试?

TGDXAT commented 4 years ago

如果是main.py怎么处理呢,我不太会用remote.py

TGDXAT commented 4 years ago

算了算了,我感觉接下来的复杂度可能会远超我的想象,所以我选择放弃 :-(