Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mthrok/tenhou-log-utils
Utility tools for tenhou.net log
https://github.com/mthrok/tenhou-log-utils
game mahjong tenhou
Last synced: 2 days ago
JSON representation
Utility tools for tenhou.net log
- Host: GitHub
- URL: https://github.com/mthrok/tenhou-log-utils
- Owner: mthrok
- License: mit
- Created: 2017-05-31T02:38:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-01-23T00:54:27.000Z (12 months ago)
- Last Synced: 2024-12-26T20:12:16.184Z (12 days ago)
- Topics: game, mahjong, tenhou
- Language: Python
- Size: 78.1 KB
- Stars: 28
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ Tenhou Log Command Line Utility ๐
## ๐ฆ What is this? / ใใฎใชใใธใใชใซใคใใฆ
Tenhou Log Utils is command line tools, written in Python, to analyze game log of online mahjong Tenhou.net.
ๅคฉ้ณณใญใฐใฆใผใใฃใชใใฃใฏใชใณใฉใคใณ้บป้ใตใคใ tenhou.net ใฎใฒใผใ ใญใฐใ่งฃๆใใใใใฎใณใใณใใฉใคใณใใผใซใงใใ
Tenhou Log Utils
ไปฅไธใฎใใจใใงใใพใใ
- Pick up IDs of the games you played form Flash player cache.
ใญใผใซใซใใฃในใฏใซไฟๅญใใใฆใใ Flash Player ใฎใญใฃใใทใฅใใใไปใพใงใซใใฌใคใใๅใฎใญใฐ ID ใใชในใใขใใใ
- Download `mjlog` file from tenhou.net.
`mjlog` ๅฝขๅผใใกใคใซใใใฆใณใญใผใใ
- View `mjlog` file in console.
`mjlog` ๅฝขๅผใใกใคใซใฎไธญ่บซใใณใณใฝใผใซใซ่กจ็คบใ
## ๐ง Usage / ไฝฟใๆน
Once it's installed, you should be able to use command `tlu` (stands for Tenhou Log Utilities).
You can use `--help` to see how to use.ใคใณในใใผใซใๅฎไบใใใจใ`tlu` ใณใใณใ (`T`enhou `L`og `U`tilities ใฎ็ฅใงใใ) ใไฝฟใใใฏใใงใใ
`--help` ใชใใทใงใณใงไฝฟใๆนใ่กจ็คบใใใพใใ๏ผ่ฑ่ชใฎใฟ๏ผ```bash
tlu --help
```This will print message like the following.
ไปฅไธใฎใใใชใกใใปใผใธใ่กจ็คบใใใพใใ
```
usage: tlu [-h] {view,list,download} ...Utility for tenhou.net log files.
positional arguments:
{view,list,download}optional arguments:
-h, --help show this help message and exit
```### ๐ List up your game history. / ใฒใผใ ๅฑฅๆญดใ่กจ็คบ
Using `list` sub command you can list up the information on your play history.
`list` ใตใใณใใณใใไฝฟใใจใญใผใซใซใใฃในใฏใซไฟๅญใใใใฒใผใ ใฎๅฑฅๆญดใ่กจ็คบใงใใพใใ
```bash
tlu list
``````
/Users/moto/Library/Preferences/Macromedia/Flash Player/#SharedObjects/XRF2TRTU/mjv.jp/mjinfo.sol:
file: 2017060503gm-0041-0000-da7fdf26
un0: jesse
un1: ใใ๏ผฟ
un2: Yakkuru
un3: ใฟใตใ
oya: 2
type: 65
sc: 143,-26.0,606,71.0,346,15.0,-95,-60.0/Users/moto/Library/Application Support/Google/Chrome/Default/Pepper Data/Shockwave Flash/WritableRoot/#SharedObjects/YSXJKZMQ/mjv.jp/mjinfo.sol:
file: 2017052413gm-0009-0000-2c57e05a
un0: jesse
un1: NoName
un2: toru.ysk
un3: ใใปใใ
oya: 1
type: 9
sc: 340,14.0,131,-27.0,80,-42.0,449,55.0
...
```You can use `--id-only` option to only show log IDs. You need these IDs to download play log from tenhou.net.
`--id-only` ใชใใทใงใณใไฝฟใใใจใง ID ใฎใฟใ่กจ็คบใใใใจใใงใใพใใใใใใไฝฟใฃใฆ tenhou.net ใใใฒใผใ ใฎใญใฐใใใฆใณใญใผใใใใฎใซๅฟ ่ฆใซใชใใพใใ
```bash
tlu list --id-only
``````
2017060503gm-0041-0000-da7fdf26
2017052413gm-0009-0000-2c57e05a
2017052414gm-0009-0000-b0b25432
2017052514gm-0009-0000-df77ea6e
2017052514gm-0009-0000-e9f23937
2017052514gm-0009-0000-69a2af52
2017052515gm-0001-0000-42e80591
2017052612gm-0009-0000-815ed634
2017053113gm-0009-0000-6a4d36ba
2017053114gm-0009-0000-2294be5f
2017060213gm-0009-0000-a0c95a8f
2017060314gm-0009-0000-3b2aa4ca
2017060409gm-0001-0000-87fec10c
2017060409gm-0001-0000-f9ade363
2017060413gm-0009-0000-1508d27d
```### ๐ Download mjlog file / mjlog ใใกใคใซใฎใใฆใณใญใผใ
With `download` sub command, you can download play log (`mjlog` file). You need the log ID of the game you want to download.
`download` ใตใใณใใณใใไฝฟใฃใฆใฒใผใ ใฎใใฌใคใญใฐ๏ผ`mjlog` ๅฝขๅผ๏ผใใใฆใณใญใผใใใใใจใใงใใพใใใใฆใณใญใผใใใใใฒใผใ ใฎ ID ใๅฟ ่ฆใซใชใใพใใ
Example)
The following command will download the play log with ID `2017060314gm-0009-0000-3b2aa4ca` to `2017060314gm-0009-0000-3b2aa4ca.mjlog` in the local storage.
ไปฅไธใฎใณใใณใใฏ ID `2017060314gm-0009-0000-3b2aa4ca` ใฎใฒใผใ ใญใฐใ `2017060314gm-0009-0000-3b2aa4ca.mjlog` ใซใใฆใณใญใผใใใพใใ
```bash
tlu download 2017060314gm-0009-0000-3b2aa4ca 2017060314gm-0009-0000-3b2aa4ca.mjlog
```### ๐ View downloaded mjlog file.
You can use `view` command to see the content of a `mjlog` file.
`view` ใณใใณใใไฝฟใฃใฆ `mjlog` ใใกใคใซใฎไธญ่บซใ่กจ็คบใงใใพใใ
```bash
tlu view 2017060314gm-0009-0000-3b2aa4ca.mjlog
``````
Lobby 0:
test: False
red: True
kui: True
ton-nan: True
sanma: False
tokujou: False
soku: False
joukyu: False
Players:
Index: Dan, Rate, Sex, Name
0: 7, 1601.97, M, AlyBBBMe
1: 3, 1558.81, M, jesse
2: 0, 1484.34, M, ใใฃใฝใ3ๅท
3: 0, 1500.00, M, NoName
Dealer: 0
========================================
Initial Game State:
Round: 0
Combo: 0
Reach: 0
Dice 1: 3
Dice 2: 3
Dora Indicator: ๐ 0
Initial Scores:
0: 25000
1: 25000
2: 25000
3: 25000
Dealer: 0
Initial Hands:
0: ๐ 2 ๐ 2 ๐ 1 ๐ 0 ๐ 3 ๐ก 0 ๐ 0 ๐ 3 ๐ 3 ๐ 3 ๐ 3 ๐ 1 ๐ 3
1: ๐ 2 ๐ 3 ๐ 3 ๐ 3 ๐ 2 ๐ 2 ๐ 3 ๐ 3 ๐ 3 ๐ 1 ๐ 0 ๐ 2 ๐ 3
2: ๐ 0 ๐ 0 ๐ 3 ๐ 2 ๐ 1 ๐ 1 ๐ 2 ๐ 3 ๐ 0 ๐ 1 ๐ 0 ๐ 3 ๐ 1
3: ๐ 3 ๐ 1 ๐ 3 ๐ 1 ๐ 0 ๐ 3 ๐ 1 ๐ 1 ๐ 0 ๐ 2 ๐ 2 ๐ 1 ๐ 1
Player 0: Draw ๐ 2
Player 0: Discard ๐ 2
Player 1: Draw ๐ 0...
Player 3: ChanKan from player 1: ๐ 2๐ 1๐ 0๐ 3
Player 3: Draw ๐ 2
New Dora Indicator: ๐ 1
Player 3: Discard ๐ 1
Player 0: Chi from player 3: ๐ 1๐ 3๐ 0
Player 0: Discard ๐ 3
Player 1: Draw ๐ 1
Player 1: Discard ๐ 1
Player 2: Draw ๐ 0
Player 2: Discard ๐ 0
Player 3: Chi from player 2: ๐ 0๐ 0๐ 0
Player 3: Discard ๐ 3
Player 0: Draw ๐ 3
Player 0: Discard ๐ 3
Player 1: Draw ๐ 0
Player 1 wins.
Tsumo.
Hand: ๐ 2 ๐ 3 ๐ 2 ๐ 3 ๐ 2 ๐ 3 ๐ 0 ๐ 1 ๐ 3 ๐ 0 ๐ 1 ๐ 3 ๐ 3 ๐ก 3
Machi: ๐ 0
Dora Indicator: ๐ 1 ๐ 1
Ura Dora: ๐ 3 ๐ 0
Yaku:
Reach ( 1): 1 [Han]
Tsumo ( 0): 1 [Han]
Pin-fu ( 7): 1 [Han]
Ii-pei-ko ( 9): 1 [Han]
Ikki-tsuukan (24): 2 [Han]
Chin-itsu (35): 6 [Han]
Ura-dora (53): 0 [Han]
Fu: 20
Score: 36000
- Sanbaiman
Ten-bou:
Combo: 0
Riichi: 1
Scores:
35700: -120
6800: 370
55700: -120
800: -120
Final scores:
23700: -16.0
43800: 53.0
43700: 24.0
-11200: -61.0```
## ๐จ Installation / ใคใณในใใผใซ
### ๐ Normal Installation / ้ๅธธใคใณในใใผใซ
Use the following command to install TLU.
ไปฅไธใฎใณใใณใใงใคใณในใใผใซใงใใพใใ
```bash
pip install git+git://github.com/mthrok/tenhou-log-utils.git
```### ๐ Development Installation / ้็บ็ใคใณในใใผใซ
If you want to modify the command line, you can install in editable mode.
#### 1. Clone the repository / ใชใใธใใชใใฏใญใผใณ
```bash
git clone http://github.com/mthrok/tenhou-log-utils
cd tenhou-log-utils
```#### 2. Install with `-e` option. / `-e` ใชใใทใงใณไปใใงใคใณในใใผใซ
```bash
pip install -e .
```This will install the utility from the local repo, and you can change the behavior by modifying the content of `tenhou_log_utils` directory.
ใใใงใณใใณใใใฏใญใผใณใใใฌใใธใใชใๅ็ งใใใใใซใคใณในใใผใซใใใพใใ`tenhou_log_utils` ใฎไธญใฎในใฏใชใใใ็ทจ้ใใใใจใงใใณใใณใใฎๆๅใๅคๆดใงใใพใใ
## ๐ฉ Bug Report / ใใฐใฎๅ ฑๅ
Please file a bug report at [issues page](https://github.com/mthrok/tenhou-log-utils/issues). Ideas and suggestions are also welcome.
ใใฐใ็บ่ฆใใๅ ดๅใฏ [ใใกใ](https://github.com/mthrok/tenhou-log-utils/issues)ใซๅ ฑๅใใ้กใใใพใใๆฉ่ฝๆนๅ่ฆๆใใฉใใใๆฅๆฌ่ชใงใkใ