Giter Site home page Giter Site logo

imo-tikuwa / th11-score-capture Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 4.87 MB

東方地霊殿のウィンドウをリアルタイムでキャプチャして、スコア、グレイズ、スペルカード等の情報を CSVファイルで出力するプログラム

Python 99.69% Batchfile 0.31%

th11-score-capture's Introduction

th11-score-capture

このプログラムについて

東方地霊殿のウィンドウをリアルタイムでキャプチャして、スコア、グレイズ、スペルカード等の情報を CSVファイルで出力するプログラムです。

開発環境について

バージョン等
OS Windows 10 Pro
Python 3.8.2
pip 19.2.3

インストール、起動

初回

git clone https://github.com/imo-tikuwa/th11-score-capture
cd th11-score-capture
python -m venv venv
.\venv\Scripts\activate.bat
pip install -r requirements.txt
python app.py

2回目以降

cd th11-score-capture
.\venv\Scripts\activate.bat
python app.py

venvを終了するときは以下

deactivate

実行ファイル化(備忘録)

初回

cd th11-score-capture
.\venv\Scripts\activate.bat
pyinstaller app.py --onefile

生成されたapp.spec修正

pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
+          Tree('resources',prefix='resources'),
          a.scripts,
          a.binaries,

2回目以降

cd th11-score-capture
.\venv\Scripts\activate.bat
pyinstaller app.spec

オプション

オプション名 内容
-dev, --development 開発モード(outputディレクトリに解析に使用した画像を保存)
--output 指定したときコンソールに暫定の解析結果の出力を行います
--capture-period 画面のキャプチャ間隔を指定してください(秒)、最低0~最大10.0
--print-exec-time 1回あたりのテンプレートマッチング処理全体の処理時間を出力します

使い方

  1. プログラムを実行する
python app.py --output --capture-period 0.3
  1. (初回のみ)th11.exeの場所を指定する
  2. プレイ画面を認識すると自動でスコア等のキャプチャおよび解析が開始します
  3. 解析を終了したくなったところでCtrl+Cでプログラムの処理を中断
  4. プログラムが終了します。解析した結果はoutputディレクトリに日付文字列付きのCSVファイルとして出力されます

サンプルデータについて

sample_data以下のファイルを更新した場合はnpzファイルを更新する必要がある。
具体的にはプロジェクト直下にあるgenerate_npz_data.pyを実行するだけ。
※サンプルデータのファイル自体を追加とかする場合はgenerate_npz_data.pyのrangeとかメンテナンスする必要あり。

履歴

2020/03/22
ざっくり完成した模様
めちゃくちゃ汚いコードなので直せるところは直したい

2020/03/23
サンプルデータについてnpz化
サンプルデータ周りは少し綺麗になったが他の部分はさらにコードが汚くなった

2020/03/28
venvとpyinstaller導入
実行ファイルを生成可能な形にプログラムを少し修正

th11-score-capture's People

Contributors

imo-tikuwa avatar

Stargazers

Ryotaro Onoue avatar den3606 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.