NateScarlet / auto-derby

🐎🖥《赛马娘》(ウマ娘: Pretty Derby)辅助脚本
MIT License
466 stars 106 forks source link

Does not work in nurturing. #7

Closed waraiotoko2501h closed 3 years ago

waraiotoko2501h commented 3 years ago

The training job does not work. I thought I saw the word "級", so I typed it in. But then it stops working. screenshot (I wrote a bat to make it easier to run, but don't worry about it)

log:

INFO [2021-05-31 17:41:15]:auto_derby.window:58: width=466 height=828 INFO [2021-05-31 17:41:15]:auto_derby.window:60: already in wanted size INFO [2021-05-31 17:41:15]:main:52: game window: 8787092 INFO [2021-05-31 17:41:15]:auto_derby.template:168: match: tmpl=tmpl, pos=(172, 655), similarity=0.94 Corresponding text for current displaying image: INFO [2021-05-31 17:43:18]:auto_derby.ocr:82: labeled: hash=001e0c3ffe3f3e3f1e271c273e673e67fe27fe3ffc3ffe3ffe7f9e7f1c260000, value=級 Traceback (most recent call last): File "C:\Users\UserName\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\UserName\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\Users\UserName\umamusume\auto-derby\auto-derby\auto_derby__main__.py", line 80, in main() File "D:\Users\UserName\umamusume\auto-derby\auto-derby\auto_derby__main__.py", line 53, in main job() File "D:\Users\UserName\umamusume\auto-derby\auto-derby\auto_derby\jobs\nurturing.py", line 560, in nurturing ctx.update_by_command_scene(template.screenshot()) File "D:\Users\UserName\umamusume\auto-derby\auto-derby\auto_derby\jobs\nurturing.py", line 297, in update_by_command_scene self.date = _ocr_date(screnshot.crop(date_bbox)) File "D:\Users\UserName\umamusume\auto-derby\auto-derby\auto_derby\jobs\nurturing.py", line 245, in _ocr_date month_end = year_end + text[year_end:].index("月") + 1 ValueError: substring not found

NateScarlet commented 3 years ago

Seems ocr result is not correct for match:

https://github.com/NateScarlet/auto-derby/blob/2d3955b912120dc57518d78445f7aafd7c51e568/auto_derby/jobs/nurturing.py#L240

Please set environment variable DEBUG to auto_derby or auto_derby.ocr and post a more detailed log here

waraiotoko2501h commented 3 years ago

Sorry. I'm not an engineer. I didn't know how to set environment variables. I tried, but I'm not sure if this is correct. added Screenshot

I don't know how to provide any more logs. Please let me know how to do this if necessary.

I am running cmd in a Japanese environment (Shift-JIS (chcp 932)). Is it possible that this is affecting the results?

NateScarlet commented 3 years ago

just add this line at top of your bat script

set "DEBUG=auto_derby"
NateScarlet commented 3 years ago

I'am home now, trying to reproduce you issue base on given screenshot

NateScarlet commented 3 years ago

I can reproduce this issue, seems because you are using high graphic quality, result more anti-alias on text Switch to low graphic quality should work for you

I will try to support high graphic quality now

waraiotoko2501h commented 3 years ago

Thanks for your help.

set "DEBUG=auto_derby"

I see. I've added a new screenshot.

NateScarlet commented 3 years ago

Text recognized to シュニア級デビュー前 which シ should be ジ

NateScarlet commented 3 years ago

Fixed in https://github.com/NateScarlet/auto-derby/commit/aaeaa860dd170c1c482f5ced2c29c6afbcda6eec

NateScarlet commented 3 years ago

Ops, forgot to remove debug code.

Fixed in https://github.com/NateScarlet/auto-derby/commit/a10a15bafaadc584194355cf2c82d05b73b2f8f8