From 5012d5f74fb3d4308c6f7fa18cdcdbf3d0a3ca9e Mon Sep 17 00:00:00 2001 From: GaboGG Date: Tue, 4 Aug 2026 17:06:50 -0400 Subject: [PATCH] v0.17.5 - jpx bridge: verify M keybind lands + log mob count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a probe after dispatching the synthetic M keydown: compares jpx's active state before/after 700ms and logs ✅ registered or ❌ keybind miss. This distinguishes 'M not reaching jpx' from 'jpx not chaining'. --- scripts/hv-unified.user.js | 16 +++++++++++++--- scripts/latest.user.js | 16 +++++++++++++--- src/config.js | 2 +- src/header.user.js | 2 +- src/jpx-bridge.js | 12 +++++++++++- 5 files changed, 39 insertions(+), 9 deletions(-) diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index eb87e01..81f955b 100644 --- a/scripts/hv-unified.user.js +++ b/scripts/hv-unified.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.17.4 +// @version 0.17.5 // @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils) // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* @@ -18,7 +18,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.17.4'; +const VERSION = '0.17.5'; const CFG = { // — Battle strategy advisory @@ -1606,7 +1606,17 @@ function jpxTriggerAuto() { bubbles: true, cancelable: true, }); + // Give jpx a moment to process, then verify via its own state event. + // If it didn't toggle, the keybind didn't reach jpx. + const before = jpxLastActive; document.dispatchEvent(evt); + setTimeout(() => { + if (jpxLastActive !== before) { + console.log(`%c[HV] ✅ M registered (active: ${before} → ${jpxLastActive})`, 'color:#0f0'); + } else { + console.log(`%c[HV] ❌ M ignored by jpx (still active: ${jpxLastActive}) — keybind miss`, 'color:#f44'); + } + }, 700); return true; } catch (e) { console.warn('[HV] jpxTriggerAuto failed:', e.message); @@ -1667,7 +1677,7 @@ function jpxChainOnState(detail) { clearInterval(timer); jpxChainWaiting = false; setTimeout(jpxTriggerAuto, 200); - console.log(`%c[HV] ⛓ chaining round ${jpxChainRounds}${CFG.chainMaxRounds ? '/' + CFG.chainMaxRounds : ''}`, 'color:#0f0'); + console.log(`%c[HV] ⛓ chaining round ${jpxChainRounds}${CFG.chainMaxRounds ? '/' + CFG.chainMaxRounds : ''} (${jpxMonstersPresent()} mobs)`, 'color:#0f0'); } else if (waited > 8000 || jpxBattleOver()) { clearInterval(timer); jpxChainWaiting = false; diff --git a/scripts/latest.user.js b/scripts/latest.user.js index eb87e01..81f955b 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.17.4 +// @version 0.17.5 // @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils) // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* @@ -18,7 +18,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.17.4'; +const VERSION = '0.17.5'; const CFG = { // — Battle strategy advisory @@ -1606,7 +1606,17 @@ function jpxTriggerAuto() { bubbles: true, cancelable: true, }); + // Give jpx a moment to process, then verify via its own state event. + // If it didn't toggle, the keybind didn't reach jpx. + const before = jpxLastActive; document.dispatchEvent(evt); + setTimeout(() => { + if (jpxLastActive !== before) { + console.log(`%c[HV] ✅ M registered (active: ${before} → ${jpxLastActive})`, 'color:#0f0'); + } else { + console.log(`%c[HV] ❌ M ignored by jpx (still active: ${jpxLastActive}) — keybind miss`, 'color:#f44'); + } + }, 700); return true; } catch (e) { console.warn('[HV] jpxTriggerAuto failed:', e.message); @@ -1667,7 +1677,7 @@ function jpxChainOnState(detail) { clearInterval(timer); jpxChainWaiting = false; setTimeout(jpxTriggerAuto, 200); - console.log(`%c[HV] ⛓ chaining round ${jpxChainRounds}${CFG.chainMaxRounds ? '/' + CFG.chainMaxRounds : ''}`, 'color:#0f0'); + console.log(`%c[HV] ⛓ chaining round ${jpxChainRounds}${CFG.chainMaxRounds ? '/' + CFG.chainMaxRounds : ''} (${jpxMonstersPresent()} mobs)`, 'color:#0f0'); } else if (waited > 8000 || jpxBattleOver()) { clearInterval(timer); jpxChainWaiting = false; diff --git a/src/config.js b/src/config.js index 91b8937..ca3f603 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.17.4'; +const VERSION = '0.17.5'; const CFG = { // — Battle strategy advisory diff --git a/src/header.user.js b/src/header.user.js index bebc25b..2d7e78f 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.17.4 +// @version 0.17.5 // @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils) // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* diff --git a/src/jpx-bridge.js b/src/jpx-bridge.js index b741ebb..528a88b 100644 --- a/src/jpx-bridge.js +++ b/src/jpx-bridge.js @@ -59,7 +59,17 @@ function jpxTriggerAuto() { bubbles: true, cancelable: true, }); + // Give jpx a moment to process, then verify via its own state event. + // If it didn't toggle, the keybind didn't reach jpx. + const before = jpxLastActive; document.dispatchEvent(evt); + setTimeout(() => { + if (jpxLastActive !== before) { + console.log(`%c[HV] ✅ M registered (active: ${before} → ${jpxLastActive})`, 'color:#0f0'); + } else { + console.log(`%c[HV] ❌ M ignored by jpx (still active: ${jpxLastActive}) — keybind miss`, 'color:#f44'); + } + }, 700); return true; } catch (e) { console.warn('[HV] jpxTriggerAuto failed:', e.message); @@ -120,7 +130,7 @@ function jpxChainOnState(detail) { clearInterval(timer); jpxChainWaiting = false; setTimeout(jpxTriggerAuto, 200); - console.log(`%c[HV] ⛓ chaining round ${jpxChainRounds}${CFG.chainMaxRounds ? '/' + CFG.chainMaxRounds : ''}`, 'color:#0f0'); + console.log(`%c[HV] ⛓ chaining round ${jpxChainRounds}${CFG.chainMaxRounds ? '/' + CFG.chainMaxRounds : ''} (${jpxMonstersPresent()} mobs)`, 'color:#0f0'); } else if (waited > 8000 || jpxBattleOver()) { clearInterval(timer); jpxChainWaiting = false;