@scriptstone/parser
v0.2.2
Published
Hearthstone Power Log Parser
Downloads
3
Readme
Scriptstone Parser
A regex-based parser for extracting game state from Hearthstone's
Power.log
file and emitting game events in real-time using Node Events.
Install
npm i @scriptstone/parser
Enable Logging
Before the parser can be used, the Power.log
must be enabled. This can be done by creating a log.config
file in one of the following locations:
C:\Users\{USERNAME}\AppData\Local\Blizzard\Hearthstone
(Windows)%LOCALAPPDATA%/Blizzard/Hearthstone
(Windows)~/Library/Preferences/Blizzard/Hearthstone
(macOS)
Then, put the following text in the file:
[Power]
LogLevel=1
FilePrinting=true
ConsolePrinting=true
ScreenPrinting=false
Usage
const Parser = require('scriptstone-parser');
// Emits 'gameStart' event at the beginning
// of a new Hearthstone game.
parser.on('gameStart', function () {
// Output the game state.
console.log(Parser.state);
});
See source/test.js
to see more examples.
Emitters
List of implemented events: gameStart
, mulligan
, turnChange
, powerEvent
, tagChange
.