Initial commit: POE2 automated trade bot

Monitors pathofexile.com/trade2 for new listings, travels to seller
hideouts, buys items from public stash tabs, and stores them.

Includes persistent C# OCR daemon for fast screen capture + Windows
native OCR, web dashboard for managing trade links and settings,
and full game automation via Win32 SendInput.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Boki 2026-02-10 14:03:47 -05:00
commit 41d174195e
28 changed files with 6449 additions and 0 deletions

38
src/config.ts Normal file
View file

@ -0,0 +1,38 @@
import dotenv from 'dotenv';
import type { Config } from './types.js';
dotenv.config();
function env(key: string, fallback?: string): string {
const val = process.env[key];
if (val !== undefined) return val;
if (fallback !== undefined) return fallback;
throw new Error(`Missing required environment variable: ${key}`);
}
function envInt(key: string, fallback: number): number {
const val = process.env[key];
return val ? parseInt(val, 10) : fallback;
}
export function loadConfig(cliUrls?: string[]): Config {
const envUrls = process.env['TRADE_URLS']
? process.env['TRADE_URLS'].split(',').map((u) => u.trim())
: [];
const tradeUrls = cliUrls && cliUrls.length > 0 ? cliUrls : envUrls;
return {
tradeUrls,
poe2LogPath: env(
'POE2_LOG_PATH',
'C:\\Program Files (x86)\\Steam\\steamapps\\common\\Path of Exile 2\\logs\\Client.txt',
),
poe2WindowTitle: env('POE2_WINDOW_TITLE', 'Path of Exile 2'),
browserUserDataDir: env('BROWSER_USER_DATA_DIR', './browser-data'),
travelTimeoutMs: envInt('TRAVEL_TIMEOUT_MS', 15000),
stashScanTimeoutMs: envInt('STASH_SCAN_TIMEOUT_MS', 10000),
waitForMoreItemsMs: envInt('WAIT_FOR_MORE_ITEMS_MS', 20000),
betweenTradesDelayMs: envInt('BETWEEN_TRADES_DELAY_MS', 5000),
};
}