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;