🐎🖥《赛马娘》(ウマ娘: Pretty Derby)辅助脚本

Overview

auto-derby

python

自动化养马

育成结果 Nurturing result

功能

  • 支持客户端
    • DMM (前台)
    • 实验性 安卓 ADB 连接(后台)开发基于 1080x1920 分辨率
  • 团队赛 (Team race)
    • 有胜利确定奖励时吃帕菲
  • 日常赛 (Daily race)
  • PvP 活动赛 (Champions meeting)
  • 传奇赛 (Legend race)
    • 自动领奖励
  • 活动抽奖转盘 (Roulette derby)
  • 遇到限时商店自动买空
  • 育成 (Nurturing)
    • 自动选择训练
      • 基于当前属性
      • 基于训练效果
      • 基于训练等级
      • 基于精确体力消耗
      • 基于羁绊值获取量
      • 暑期集训保留体力
      • 年末抽奖前消耗体力
    • 遇到新事件选项请求人工处理,后续相同事件使用相同选择
    • 自动参加比赛
      • 预估比赛结果,如果不能仅靠属性拿冠军则暂停请求人工确认
      • 自动选择比赛跑法
        • 基于属性和适性
        • 基于对手跑法选择跑法(倾向人数少的跑法)
    • 支持友人卡(在实现前可以带友人卡,就是外出时需要自己手动选)
  • 支持 python 插件

使用方法

需求 DMM 版 和 python3.8

安装依赖

py -3.8 -m pip install -r requirements.txt

双击 launcher.cmd 可通过一个简单的 GUI 进行启动

或者手动调用模块:

py -3.8 -m auto_derby 工作名称

工作名称随便输入错误的名字会提示当前支持的工作

问题反馈

通过 Github issues 提交反馈

启动器勾选 debug 时会在同目录下生成相关调试信息,反馈时请将相关信息一同附上

launcher.log

启动器日志,强制退出时不会包含运行日志

反馈前请手动清理敏感信息(例如用户名、机器名)

auto_derby.log

运行日志,.1 .2 .3 后缀的文件为之前日志的备份

last_screenshot.local.png

脚本的最后一次截图

ocr_images.local

文本识别时使用的图片

single_mode_event_images.local

育成事件选择时用于匹配的图片

Comments
  • Recognize new shop ui

    Recognize new shop ui

    The following implementation will likely need to be changed to recognize the new shop ui. https://github.com/NateScarlet/auto-derby/blob/8060c172411afc3bf283a093733869f6a48ba0f3/auto_derby/scenes/single_mode/shop.py#L141-L171

    logs:

    INFO  [2022-04-12 14:01:56]:auto_derby.template:183: match: tmpl=tmpl<single_mode_shop_item_price.png>, pos=(131, 549), similarity=0.97
    INFO  [2022-04-12 14:01:56]:auto_derby.template:183: match: tmpl=tmpl<single_mode_shop_item_price.png>, pos=(131, 657), similarity=0.97
    INFO  [2022-04-12 14:01:56]:auto_derby.template:183: match: tmpl=tmpl<single_mode_shop_item_price.png>, pos=(131, 441), similarity=0.97
    INFO  [2022-04-12 14:01:57]:auto_derby.jobs.nurturing:56: shop items
    INFO  [2022-04-12 14:01:57]:auto_derby.jobs.nurturing:72: score:	40.00/19.45:	Item<蹄鉄ハンマー・極#52@36>	<in cart>
    INFO  [2022-04-12 14:01:57]:auto_derby.jobs.nurturing:72: score:	32.65/19.45:	Item<にんじんBBQセット#25@36>	<in cart>
    INFO  [2022-04-12 14:01:57]:auto_derby.jobs.nurturing:72: score:	37.06/26.47:	Item<スパルタメガホン#44@49>	<in cart>
    INFO  [2022-04-12 14:01:57]:auto_derby.jobs.nurturing:72: score:	17.16/7.02:	Item<スピード戦術書#6@13>	<in cart>
    INFO  [2022-04-12 14:01:57]:auto_derby.jobs.nurturing:72: score:	0.00/4.86:	Item<スピードのメモ帳#1@9>	
    INFO  [2022-04-12 14:01:57]:auto_derby.jobs.nurturing:72: score:	0.00/14.59:	Item<プレーンカップケーキ#22@27>	
    INFO  [2022-04-12 14:01:57]:auto_derby.jobs.nurturing:72: score:	0.00/24.31:	Item<根性アンクルウェイト#49@45>	
    INFO  [2022-04-12 14:01:57]:auto_derby.jobs.nurturing:72: score:	8.00/72.94:	Item<効率練習のススメ#28@135>	<coin not enough>
    INFO  [2022-04-12 14:01:57]:auto_derby.template:183: match: tmpl=tmpl<single_mode_shop_item_price.png>, pos=(131, 549), similarity=0.97
    INFO  [2022-04-12 14:01:57]:auto_derby.template:183: match: tmpl=tmpl<single_mode_shop_item_price.png>, pos=(131, 657), similarity=0.97
    INFO  [2022-04-12 14:01:57]:auto_derby.template:183: match: tmpl=tmpl<single_mode_shop_item_price.png>, pos=(131, 441), similarity=0.97
    INFO  [2022-04-12 14:01:57]:auto_derby.scenes.single_mode.shop:150: exchange: Item<スパルタメガホン#44@49>
    INFO  [2022-04-12 14:01:58]:auto_derby.template:199: no match: tmpl=('single_mode_shop_use_confirm_button.png', 'close_button.png')
    INFO  [2022-04-12 14:01:58]:auto_derby.template:199: no match: tmpl=('single_mode_shop_use_confirm_button.png', 'close_button.png')
    INFO  [2022-04-12 14:01:58]:auto_derby.template:199: no match: tmpl=('single_mode_shop_use_confirm_button.png', 'close_button.png')
    

    new shop images: Since it is displayed in a reduced size, you can check the original size by clicking.

    others: Now that you can select multiple items and purchase them at the same time, you may be able to optimize the item selection scene.

    bug 
    opened by gentle-knight-13 27
  • 养成出现选项时,在终端选择时出错

    养成出现选项时,在终端选择时出错

    Choose event option(1/2/3/4/5):3 ERROR [12:55:28]:main:119: unexpected exception Traceback (most recent call last): File "C:\Users\WisdomDevil\Desktop\auto-derby-master\auto_derby_main_.py", line 115, in main() File "C:\Users\WisdomDevil\Desktop\auto-derby-master\auto_derby_main_.py", line 87, in main job() File "C:\Users\WisdomDevil\Desktop\auto-derby-master\auto_derby\jobs\nurturing.py", line 326, in nurturing _handle_option() File "C:\Users\WisdomDevil\Desktop\auto-derby-master\auto_derby\jobs\nurturing.py", line 241, in _handle_option ans = choice.get(template.screenshot()) File "C:\Users\WisdomDevil\Desktop\auto-derby-master\auto_derby\single_mode\choice.py", line 80, in get g.choices[event_id] = int(ans) TypeError: list indices must be integers or slices, not str

    以上为错误信息

    question 
    opened by WisdomDevils 19
  • [DEV]选择夏日合宿休息时发生错误

    [DEV]选择夏日合宿休息时发生错误

    卡在选择夏日合宿休息的选择上了,不是第一次出现。~忘记留截屏了,再出现的时候我把截屏发出来~

    DEBUG [2021-06-21 20:45:50]:auto_derby.template:180: not match: tmpl=tmpl<single_mode_rest.png>, pos=(45, 767), similarity=0.436
    DEBUG [2021-06-21 20:45:50]:auto_derby.template:180: not match: tmpl=tmpl<single_mode_command_summer_rest.png>, pos=(51, 753), similarity=0.889
    INFO  [2021-06-21 20:45:50]:auto_derby.template:200: no match: tmpl=('single_mode_rest.png', 'single_mode_command_summer_rest.png')
    DEBUG [2021-06-21 20:45:53]:auto_derby.template:48: screenshot
    DEBUG [2021-06-21 20:45:53]:auto_derby.template:180: not match: tmpl=tmpl<single_mode_rest.png>, pos=(45, 767), similarity=0.436
    DEBUG [2021-06-21 20:45:53]:auto_derby.template:180: not match: tmpl=tmpl<single_mode_command_summer_rest.png>, pos=(51, 753), similarity=0.889
    INFO  [2021-06-21 20:45:53]:auto_derby.template:200: no match: tmpl=('single_mode_rest.png', 'single_mode_command_summer_rest.png')
    DEBUG [2021-06-21 20:45:56]:auto_derby.template:48: screenshot
    
    
    opened by fatinghenji 19
  • OCR fails. It seems to often take the

    OCR fails. It seems to often take the "ジ" as "シ".

    Thanks for the response the other day. The program was working fine, but the current version is failing to OCR.

    OCR frequently mistakes "ジ" for "シ".

    Is there something wrong with my settings? I have not changed any settings in NVIDIA Control Panel -> Manage 3D Settings. (Factory default)

    Does the graphics board or Windows settings affect OCR?

    TEST VERSION fed9276f2a02a770a3116211a3ce42b7bde10c9b launcher.log

    screenshot_1622701278 screenshot_1622701289

    If you need any other logs or screenshots, please let me know.

    bug 
    opened by waraiotoko2501h 19
  • 青春杯選訓練項目時會卡住

    青春杯選訓練項目時會卡住

    MIP4{TQ~2 J2G0L7(6$SA2H FLU{N@ST~Q1KJ1CMJVV3 I2 File "C:\Users\sakurasou\AppData\Local\Programs\Python\Python38-32\lib\concurrent\futures_base.py", line 432, in result return self.__get_result() File "C:\Users\sakurasou\AppData\Local\Programs\Python\Python38-32\lib\concurrent\futures_base.py", line 388, in __get_result raise self._exception File "C:\Users\sakurasou\AppData\Local\Programs\Python\Python38-32\lib\concurrent\futures\thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "D:\软件\autoderby\ver3\auto-derby-master\auto_derby\single_mode\training\training.py", line 428, in from_training_scene_v2 self.skill = _ocr_training_effect(img.crop(bbox_group[5])) File "D:\软件\autoderby\ver3\auto-derby-master\auto_derby\single_mode\training\training.py", line 129, in _ocr_training_effect return int(text.lstrip("+")) ValueError: invalid literal for int() with base 10: ''

    作者你好,這邊情況是用了一年時間也沒遇到過這種,然後最近一週年更新後打算刷活動使用的時候就出現了選訓練項目的時候會卡住,日誌發了最新的一部分,要是發少了繼續補充,不太清楚要發多少。

    bug 
    opened by denpa910 18
  • 自动出门比赛因为找不到对应赛事而报错停止

    自动出门比赛因为找不到对应赛事而报错停止

    集中发生在第二年/第三年3月上下

    示例: INFO [2021-11-12 09:55:09]:auto_derby.template:180: match: tmpl=tmpl<single_mode_race_menu_fan_icon.png>, pos=(203, 586), similarity=0.95 ERROR [2021-11-12 09:55:09]:main:123: unexpected exception Traceback (most recent call last): File "C:\Downloads\auto-derby-master\auto-derby-master\auto_derby_main_.py", line 119, in main() File "C:\Downloads\auto-derby-master\auto-derby-master\auto_derby_main_.py", line 90, in main job() File "C:\Downloads\auto-derby-master\auto-derby-master\auto_derby\jobs\nurturing.py", line 225, in nurturing spec_spec_key(tmpl) File "C:\Downloads\auto-derby-master\auto-derby-master\auto_derby\jobs\nurturing.py", line 88, in _ac_handle_turn _handle_turn(ac.ctx) File "C:\Downloads\auto-derby-master\auto-derby-master\auto_derby\jobs\nurturing.py", line 52, in _handle_turn command_with_scores[0][0].execute(ctx) File "C:\Downloads\auto-derby-master\auto-derby-master\auto_derby\single_mode\commands\race.py", line 85, in execute scene.choose_race(ctx, self.race) File "C:\Downloads\auto-derby-master\auto-derby-master\auto_derby\scenes\single_mode\race_menu.py", line 82, in choose_race for race2, pos in find_by_race_menu_image(ctx, template.screenshot()): File "C:\Downloads\auto-derby-master\auto-derby-master\auto_derby\single_mode\race\game_data.py", line 263, in find_by_race_menu_image for i in _find_by_race_menu_item(ctx, screenshot.crop(bbox)): File "C:\Downloads\auto-derby-master\auto-derby-master\auto_derby\single_mode\race\game_data.py", line 248, in _find_by_race_menu_item raise ValueError("_find_by_race_menu_item: no race match spec: %s", full_spec) ValueError: ('_find_by_race_menu_item: no race match spec: %s', ((2, 5, 1), '中山', 1, 2000, 1, 2, 5400, (200,)))

    question 
    opened by debi-derby 18
  • 巅峰赛中,打开商店页面会唤起浏览器,但浏览器有报错,无限Loading中

    巅峰赛中,打开商店页面会唤起浏览器,但浏览器有报错,无限Loading中

    error JS的错误显示试图获取的Javascript文件被服务器识别为text/plain类型: Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.(assets/index.ac25b9a9.js)

    :8300/assets/vendor.1a7cc180.js:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.(assets/vendor.1a7cc180.js)

    bug 
    opened by cwbeta 17
  • 默认 ExecutionPolicy 下 launcher.cmd 无法运行

    默认 ExecutionPolicy 下 launcher.cmd 无法运行

    大佬好,请问下载好的文件应该放到哪个路径? 我输入py -3.8 -m pip install -r requirements.txt报错找不到文件,之后尝试在cmd里面cd到auto-derby-master所在路径再使用上面的语句会读条安装pip依赖,pip list里面也能看到opencv等依赖 现在双击launcher.cmd会闪一下命令提示符界面,但是没有GUI。 现在不知道该怎么弄了,希望大佬能指点一下我。

    bug 
    opened by loveliveao 16
  • 识别当前属性出错

    识别当前属性出错

    image 再次出现相同问题,这次应该不是字体的锅 重新启动后可以通过上图,但是会卡在新的图片上,比如下图: image

    Originally posted by @fatinghenji in https://github.com/NateScarlet/auto-derby/issues/16#issuecomment-854383348

    bug 
    opened by NateScarlet 15
  • 笔记本分辨率不够

    笔记本分辨率不够

    我是从launch.cmd启动的,这是点了powershell的输出文本 已启动脚本,输出文件为 D:\Program Files\auto-derby-1.27.1\launcher.log

    Job : nurturing Debug : True CheckUpdate : True PythonExecutablePath : D:\Program Files\Python\Python38\python.exe SingleModeChoicesDataPath : D:\Program Files\auto-derby-1.27.1\data\single_mode _choices.csv PauseIfRaceOrderGt : 4 Plugins : auto_crane,Medium_and_long_panhandle_races TargetTrainingLevels : 2,2,2,2, ADBAddress : Version : 1.27.1 Python Version : Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 1 1:48:03) [MSC v.1928 64 bit (AMD64)]

    command: title auto-derby: 1.27.1 cd /d "D:\Program Files\auto-derby-1.27.1" set "DEBUG=auto_derby" set "AUTO_DERBY_ADB_ADDRESS=" set "AUTO_DERBY_CHECK_UPDATE=true" set "AUTO_DERBY_LAST_SCREENSHOT_SAVE_PATH=debug/last_screenshot.png" set "AUTO_DERBY_OCR_IMAGE_PATH=debug/ocr_images" set "AUTO_DERBY_PAUSE_IF_RACE_ORDER_GT=4" set "AUTO_DERBY_PLUGINS=auto_crane,Medium_and_long_panhandle_races" set "AUTO_DERBY_SINGLE_MODE_CHOICE_PATH=D:\Program Files\auto-derby-1.27.1\data \single_mode_choices.csv" set "AUTO_DERBY_SINGLE_MODE_EVENT_IMAGE_PATH=debug/single_mode_event_images" set "AUTO_DERBY_SINGLE_MODE_TARGET_TRAINING_LEVELS=2,2,2,2," set "AUTO_DERBY_SINGLE_MODE_TRAINING_IMAGE_PATH=debug/single_mode_training_imag es" set "AUTO_DERBY_WEB_LOG_BUFFER_PATH=debug/log.jsonl" set "AUTO_DERBY_WEB_LOG_IMAGE_PATH=debug/images" "D:\Program Files\Python\Python38\python.exe" -m auto_derby nurturing start "auto-derby launcher" cmd.exe /c .\launcher.cmd exit 到这里之后就提示我说powershell已停止工作,自己关闭了 同时游戏的ui界面变成这样,不知道为什么变的非常大 TC{PR39D_{2C50FYF7 GXRD 然后这是debug文件里面log.jsonl的信息 %FJ)A55@_3C})Q0 CAZPOU7

    question 
    opened by aishangbiao 12
  • 在选择比赛的时候滑动事件会变成点击事件

    在选择比赛的时候滑动事件会变成点击事件

    报告一个新bug 在选择比赛的时候滑动事件会变成点击事件。log如下: auto_derby.log 手动adb执行adb shell input swipe 232 1391 232 1353 200同样为点击,应该不是触摸时间或者延迟的问题吧。 感觉依旧是超出了屏幕的最大值

    Originally posted by @fatinghenji in https://github.com/NateScarlet/auto-derby/issues/69#issuecomment-864555012

    bug 
    opened by NateScarlet 11
  • 支持自动学技能

    支持自动学技能

    现在的手动加技能点对我够用了 因为我不刷历战

    这个功能想要的人多了 (不要发 +1 回复而是右上角 😊 点 👍)再考虑实现

    其他人如果自己实现了也欢迎发 PR,不过从图片识别技能的那部分代码要求带测试。

    PS:

    这个功能在 @yourlies 的 fork 有实现

    不过还不支持插件配置 并且基于的版本比较老

    enhancement 
    opened by NateScarlet 0
Releases(v1.28.3)
Owner
NateScarlet
Nuke compositor; Manga translator; Painting hobbyist
NateScarlet
Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty UI based on Twitter Bootstrap.

Xadmin Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty UI based on Twitter Bootstrap. Liv

差沙 4.7k Dec 31, 2022
Pretty-print tabular data in Python, a library and a command-line utility. Repository migrated from bitbucket.org/astanin/python-tabulate.

python-tabulate Pretty-print tabular data in Python, a library and a command-line utility. The main use cases of the library are: printing small table

Sergey Astanin 1.5k Jan 6, 2023
Pretty and useful exceptions in Python, automatically.

better-exceptions Pretty and more helpful exceptions in Python, automatically. Usage Install better_exceptions via pip: $ pip install better_exception

Qix 4.3k Dec 29, 2022
A small utility to pretty-print Python tracebacks. ⛺

TBVaccine TBVaccine is a utility that pretty-prints Python tracebacks. It automatically highlights lines you care about and deemphasizes lines you don

Stavros Korokithakis 365 Nov 11, 2022
Module for converting 2D Python lists to fancy ASCII tables. Table2Ascii lets you display pretty tables in the terminal and on Discord.

table2ascii Module for converting 2D Python lists to a fancy ASCII/Unicode tables table2ascii ?? Installation ??‍?? Usage Convert lists to ASCII table

Jonah Lawrence 40 Jan 3, 2023
A pretty quick and simple interface to paramiko SFTP

A pretty quick and simple interface to paramiko SFTP. Provides multi-threaded routines with progress notifications for reliable, asynchronous transfers. This is a Python3 optimized fork of pysftp with additional features & improvements.

null 14 Dec 21, 2022
Pretty tornado wrapper for making lightweight REST API services

CleanAPI Pretty tornado wrapper for making lightweight REST API services Installation: pip install cleanapi Example: Project folders structure: . ├──

Vladimir Kirievskiy 26 Sep 11, 2022
Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty UI based on Twitter Bootstrap.

Xadmin Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty UI based on Twitter Bootstrap. Liv

差沙 4.7k Dec 31, 2022
Pretty Tensor - Fluent Neural Networks in TensorFlow

Pretty Tensor provides a high level builder API for TensorFlow. It provides thin wrappers on Tensors so that you can easily build multi-layer neural networks.

Google 1.2k Dec 29, 2022
This is a pretty basic but relatively nice looking Python Pomodoro Timer.

Python Pomodoro-Timer This is a pretty basic but relatively nice looking Pomodoro Timer. Currently its set to a very basic mode, but the funcationalit

EmmHarris 2 Oct 18, 2021
Tool for pretty printing and optimizing Lightning Network channels.

Suez Tool for pretty printing and optimizing Lightning Network channels. Installation Install poetry poetry install poetry run ./suez Channel fee poli

Pavol Rusnak 69 Nov 3, 2022
Pretty-doc - Composable text objects with python

pretty-doc from __future__ import annotations from dataclasses import dataclass

Taine Zhao 2 Jan 17, 2022
Shutdown Time - A pretty much useless application that allows you to shut your computer down in x time with a GUI.

A pretty much useless application that allows you to shut your computer down in x time with a GUI. Should eventually support Windows (all versions), Linux (v2.0+), MacOS (probably with Linux, idk)

null 1 Nov 8, 2022
Pretty Confusion Matrix

Pretty Confusion Matrix Why pretty confusion matrix? We can make confusion matrix by using matplotlib. However it is not so pretty. I want to make con

Junseo Ko 5 Nov 22, 2022
I got bored and wrote a wordle solver... Its pretty good though, just saying

Wordle Solver I got bored and wrote a wordle solver... Its pretty good though, just saying. Please go support Josh and have fun with Wordle on the off

Darrell Best 2 Jan 25, 2022