v0.17.5 - jpx bridge: verify M keybind lands + log mob count
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'.
This commit is contained in:
parent
4d29215e71
commit
5012d5f74f
5 changed files with 39 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// CONFIG — default settings
|
||||
// ═══════════════════════════════════════════════════════════════════════
|
||||
|
||||
const VERSION = '0.17.4';
|
||||
const VERSION = '0.17.5';
|
||||
|
||||
const CFG = {
|
||||
// — Battle strategy advisory
|
||||
|
|
|
|||
|
|
@ -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/*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue