# Deep-Structural Analysis of jpx HentaiVerse Auto-Battler Userscript **File:** `/home/gabogg/Downloads/jpx20260706.txt` **Version:** 2026.07.06 **Size:** 270,752 bytes, 6,215 lines **Language:** Vanilla JavaScript (no framework), single-file userscript --- ## 1. ARCHITECTURE ### 1.1 Initialization Flow The entire script is a single-file userscript with a declarative bootstrap: 1. **Userscript Header** (lines 1-11): `@run-at document-end`, matches `*.hentaiverse.org/*`, excludes `/equip/*` and `/isekai/equip/*`. No GM_ grants needed — works purely via DOM. 2. **Module Bootstrap** (lines 463-465): Three singleton-style modules are immediately invoked: - `jpxPanelManager()` — creates/configures the control widget overlay - `jpxMarket()` — market price fetcher/cacher - `jpxUtils()` — utility library Each follows the pattern `function jpxThing() { const ns = jpxThing; if (ns._init) return ns; ... ns._init = true; return ns; }` — single-init guard via `_init` flag on the function object itself. 3. **Entry Point** (line 6215): `initDo()` is called at file's end. 4. **`initDo()`** (line 1242): The router function that: - Injects CSS via `