added easyOCR
This commit is contained in:
parent
37d6678577
commit
9f208b0606
27 changed files with 1780 additions and 112 deletions
|
|
@ -19,6 +19,9 @@ export class ClientLogWatcher extends EventEmitter {
|
|||
private fileOffset: number = 0;
|
||||
private logPath: string;
|
||||
|
||||
/** Last area we transitioned into (from [SCENE] Set Source or "You have entered"). */
|
||||
currentArea: string = '';
|
||||
|
||||
constructor(logPath: string) {
|
||||
super();
|
||||
this.logPath = logPath;
|
||||
|
|
@ -71,10 +74,25 @@ export class ClientLogWatcher extends EventEmitter {
|
|||
private parseLine(line: string): void {
|
||||
this.emit('line', line);
|
||||
|
||||
// Area transition: "You have entered Hideout"
|
||||
// Area transition: "[SCENE] Set Source [Shoreline Hideout]"
|
||||
// POE2 uses this format instead of "You have entered ..."
|
||||
const sceneMatch = line.match(/\[SCENE\] Set Source \[(.+?)\]/);
|
||||
if (sceneMatch) {
|
||||
const area = sceneMatch[1];
|
||||
// Skip the "(null)" transition — it's an intermediate state before the real area loads
|
||||
if (area !== '(null)') {
|
||||
this.currentArea = area;
|
||||
logger.info({ area }, 'Area entered');
|
||||
this.emit('area-entered', area);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Legacy fallback: "You have entered Hideout"
|
||||
const areaMatch = line.match(/You have entered (.+?)\.?$/);
|
||||
if (areaMatch) {
|
||||
const area = areaMatch[1];
|
||||
this.currentArea = area;
|
||||
logger.info({ area }, 'Area entered');
|
||||
this.emit('area-entered', area);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue