4.0.0 • Published 1 year ago

poe-log-events v4.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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.

NameDescriptionType
errorError occured-
lineNew line was parsedINFO
whisperReceivedA whisper was receivedINFO
whisperSentA whisper was sentINFO
sellItemWhisperReceivedA trade whisper for selling an item was receivedINFO
buyItemWhisperSentA trade whisper for buying an item was sentINFO
sellBulkWhisperReceivedA trade whisper for selling an item in bulk was receivedINFO
buyBulkWhisperSentA trade whisper for buying an item in bulk was sentINFO
areaEnteredA new area was enteredINFO
areaJoinedByThe current area was joined by another playerINFO
areaLeftByThe current area was left by another playerINFO
tradeAcceptedA trade was completedINFO
tradeCancelledA trade was cancelledINFO
connectedClient connected to the PoE serverINFO
afkAFK mode startedINFO
afkEndAFK mode endedINFO
dndDND mode startedINFO
dndEndDND mode endedINFO
loginClient logged inINFO
chatJoinedA chat channel was joinedINFO
deathCount/deaths command was executedINFO
remainingMonster/remaining command was executedINFO
slainPlayer was slainINFO
levelPlayer leveled up/downINFO
playedQuery/played command was executedINFO
createdQuery/age command was executedINFO
areaGeneratedA new area was generated and entered by the playerDEBUG
4.0.0

1 year ago

3.2.0

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago