Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

poe-log-events

moepmoep1217MIT4.0.0TypeScript support: included

Monitors the PoE log file and emits events

Typescript, Path of Exile, poe, log, eventEmitter

readme

Path of Exile Log Events

NPM Version LICENSE TOP LANGUAGE ISSUES TEST_WORKFLOW codecov

Table of Contents

Introduction

The purpose of this library is to provide an easy to use event emitter for the game Path of Exile (PoE) by Grinding Gear Games to be used by other applications listening to events. Therefore, this library monitors the log file of the PoE client and emits events when something interesting happens ingame.

Note: This product isn't affiliated with or endorsed by Grinding Gear Games in any way.

Overview

The key objectives of this library are:

  • Provide an event emitter for the PoE log file
  • Fire custom events with detailed event-specific data
  • Support all languages

Installation

Install the latest stable version of this library:

 npm install --save poe-log-events

Getting started

import { Language, LogOptions, PathOfExileLog } from "poe-log-events";

const logOptions: LogOptions = {
  // default path for windows
  logFilePath: "C:\\Program Files (x86)\\Grinding Gear Games\\Path of Exile\\logs\\Client.txt",
  // can be ignored by most applications
  ignoreDebug: true,
  language: Language.English,
};

const poeLog = new PathOfExileLog(logOptions);

// register event handlers

poeLog.on("areaChanged", (event) => {
  console.log(`Entered new area ${event.newArea} at ${event.date.toISOString()}`);
});

poeLog.on("buyItemWhisperSent", (event) => {
  console.log(
    `Sent buy request to buy ${event.item} for ${event.price} ${event.currency} from ${event.player}`
  );
});

poeLog.on("sellItemWhisperReceived", (event) => {
  console.log(
    `Received request to sell item ${event.item} for ${event.price} ${event.currency} to ${event.player}`
  );
});

poeLog.on("error", (err) => {
  console.error(err);
});

Handling errors

Errors are emitted in the error event. Hence, add a listener to the error event:

poeLog.on("error", (err) => {
  console.error(err);
});

Events

The available events are defined by the interface PathOfExileLogEvents. See below for a list.

Name Description Type
error Error occured -
line New line was parsed INFO
whisperReceived A whisper was received INFO
whisperSent A whisper was sent INFO
sellItemWhisperReceived A trade whisper for selling an item was received INFO
buyItemWhisperSent A trade whisper for buying an item was sent INFO
sellBulkWhisperReceived A trade whisper for selling an item in bulk was received INFO
buyBulkWhisperSent A trade whisper for buying an item in bulk was sent INFO
areaEntered A new area was entered INFO
areaJoinedBy The current area was joined by another player INFO
areaLeftBy The current area was left by another player INFO
tradeAccepted A trade was completed INFO
tradeCancelled A trade was cancelled INFO
connected Client connected to the PoE server INFO
afk AFK mode started INFO
afkEnd AFK mode ended INFO
dnd DND mode started INFO
dndEnd DND mode ended INFO
login Client logged in INFO
chatJoined A chat channel was joined INFO
deathCount /deaths command was executed INFO
remainingMonster /remaining command was executed INFO
slain Player was slain INFO
level Player leveled up/down INFO
playedQuery /played command was executed INFO
createdQuery /age command was executed INFO
areaGenerated A new area was generated and entered by the player DEBUG

changelog

4.0.0 (2022-11-20)

Code Refactoring

BREAKING CHANGES

  • Currencies have been reworked to better emphasize that these refer to the PoE Trade API.
  • The enum CurrencyGroup has been renamed to TradeCurrencyGroup
  • The type CurrencyId has been renamed to TradeCurrencyId
  • The interface CurrencyItem has been removed. It is replaced by the interfaces TradeCurrencyItem, LocalizedTradeCurrencyItem, and TradeBulkCurrencyItem which is used by events
  • The method getCurrencyItemByName has been renamed to getTradeCurrencyItemByName
  • The method getCurrencyItemById has been renamed to getTradeCurrencyItemByTradeId
  • The exports inside TradeCurrencyIds.ts are exported together as TradeCurrencyIds. Thus the enums are now longer listed when importing the library with import {} from 'poe-log-events'
  • The tests have been adjusted accordingly
  • The script updateCurrencies.ts has been reworked to use ts-morph
  • The Currency.json has been updated. GGG fixed bugs with localization
  • Added & improved JSDOCs

3.2.0 (2022-10-22)

Features

  • Add getCurrencyItemById (07e7773)

3.1.2 (2022-10-21)

Bug Fixes

3.1.1 (2022-10-21)

Bug Fixes

  • Add logLevel to test events (be4b261)

3.1.0 (2022-10-21)

Bug Fixes

Features

  • Improve tail & matching (67633e7)

3.0.1 (2022-10-21)

Bug Fixes

  • Add dependency tiny-typed-emitter (148c60c)

3.0.0 (2022-10-21)

Features

BREAKING CHANGES

    • Renamed 'areaChanged' event to 'areaEntered' to be in line with the event object & matcher
  • Add event 'areaGenerated' & static world area resources
  • Improved comments

2.0.0 (2022-10-18)

Features

BREAKING CHANGES

  • The trade whisper events now provide a CurrencyItem object instead of a string. The enums for currencies are generated via the poe-api-ts library.

1.0.0 (2022-10-16)

Bug Fixes