Mahjong Tools Part 2: Tenhou Log Collectors

In this article I’ll cover two tools for collecting Tenhou log files. This will feed into the next article in the series, where I’ll cover the Tenhou desktop client’s built-in log analyser tool that makes use of the log files.

What are they?

The web-based Tenhou Flash client quite helpfully keeps a history of your games, available to view on the 4th tab along the top within the client. However, the client only keeps a record of your last 40 games, meaning that over time you lose the ability to go back and find the links for older games. This history is also only stored locally in your browser’s flash cache, meaning that if you switch computers or even just web browser, it won’t transfer over. These tools scan your game history and download the .mjlog files so that you can have them stored indefinitely on your computer.

For Windows users, the simplest one to use is probably Benawii’s Log Collector. This is a standalone executable file that can be downloaded from this page. When run it will automatically download any logs in your browser history and store them in a folder called mjlog by default. It will also create a logs.csv file, in which it stores the key info from each log such as the player names, final scores/points, and your rank and rate (R).

For non-Windows users, there is another tool available, as a Python script, which has support for the Flash client on OS X (if using Chrome) and Linux.

If you use the Tenhou Windows desktop client, then it will also only retain a 40 match history by default, although there is a checkbox in the options to automatically download and store log files. More details can be found on the desktop client settings guide on the forum. Neither of the tools are compatible with downloading logs for games played in the HTML client, unfortunately.

Obviously either tool has to be run at least once every 40 games that you play, if you want to ensure that every single game you play on Tenhou gets captured and downloaded.

So why download mjlog files?

Having the log files downloaded allows you to open them with the Tenhou Windows desktop client (you can download the installer here). Whilst using the desktop client for playing games requires you to be on a paid account, it’s still possible to spectate games, open log replays, and use the built-in log analyser (Logana) on a free account.

Opening log files as replays in the desktop client gives a few more features that you don’t get on the Flash version, namely that you can display all of the tiles in the wall, and people’s winning tiles and your own draws are displayed in a highlighted colour. Replay files can be opened directly within the client (4th option from the left-hand drop-down menu button), or by opening them in Windows explorer when the desktop Tenhou client is already running and logged in.

Once you have log files downloaded, you can also use the filename to create a link to view the replay in a web browser. By taking the url ‘http://tenhou.net/0/?log=’ and adding the log file name (e.g. ‘2017051417gm-0089-0000-97bb7fb1’) after the equals sign, the link will then direct to the usual replay page in a web browser.

The other main benefit is that the log files can be run through the Logana analyser to give a large number of statistics such as a breakdown of your scored yaku, along with the ability to look at things like your win/feed/riichi/call rates for localised sections of games rather than the stats for your entire account history that you get in the client. This is the second option from the left-hand drop-down menu button. For replays to be read by the analyser, they need to be moved to the ‘…/Documents/My Tenhou/log’ folder. The Logana tool is entirely in Japanese, so takes a bit of detective work if you’re not fully familiar with reading mahjong terms, but we’ll cover it in more detail in the next article in this series!

Leave a Reply

Your email address will not be published. Required fields are marked *