1.5.0 • Published 8 years ago

hearthstone-log-parser v1.5.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

hearthstone-log-parser

Extract information from hearthstone log file, parsing log entries in good shape objects. It's easy to use, enjoy!

Instalation

npm install hearthstone-log-parser

Usage

###Defining and initializing

var HsLogParser = require('hearthstone-log-parser');
var hsParser = new HsLogParser();

Extracting actions

When some card goes to some zone to another this event will be triggered.

hsParser.on('action', function(data) {
	console.log(data);
});

data example:

{ name: 'Mind Control Tech',
 id: 16,
 cardId: 'EX1_085',
 player: 1,
 fromTeam: 'FRIENDLY',
 fromZone: 'DECK',
 toTeam: 'FRIENDLY',
 toZone: 'HAND' }

Game start

Event is triggered at the moment that the match start. Return players information.

hsParser.on('match-start', function(data) {
	console.log(data);
});

data example:

[{
  hero: "Uther Lightbringer",
  class: "paladin",
  name: "Agent47",
  side: "OPPOSING",
  team: 1
}, {
  hero: "Garrosh Hellscream",
  class: "warrior",
  name: "Player457",
  side: "FRIENDLY",
  team: 2
}]

Game over

Event is triggered when game is over, you can get detailed players information and who won.

hsParser.on('match-over', function(data) {
	console.log(data);
});

data example:

[{
  hero: "Uther Lightbringer",

class: "paladin", name: "Agent47", side: "OPPOSING", status: "LOST", team: 1 }, { hero: "Garrosh Hellscream", class: "warrior", name: "Player457", side: "FRIENDLY", status: "WON", team: 2 }]

Notes

This project is under MIT license.

1.5.0

8 years ago

1.4.5

8 years ago

1.4.3

8 years ago

1.4.2

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.2

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago