diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index e3a8bba..d444f87 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.13.24 +// @version 0.13.25 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* @@ -17,7 +17,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.13.24'; +const VERSION = '0.13.25'; const CFG = { // — Battle automation @@ -1549,6 +1549,8 @@ function setupHover() { // ═══════════════════════════════════════════════════════════════════════ let keybindingsSetup = false; +let _lastQTime = 0; +const Q_DEBOUNCE_MS = 300; // Ignore Q repeats faster than this function setupKeybindings() { if (keybindingsSetup) return; @@ -1559,6 +1561,7 @@ function setupKeybindings() { if (e.keyCode === KEYS.COMMA) { if (isBattlePage()) { e.preventDefault(); + STATE.settingsVisible = !STATE.settingsVisible; toggleSettings(); return; } @@ -1567,6 +1570,11 @@ function setupKeybindings() { // Main action hotkey (default: Q) if (e.code === CFG.hotkey && !e.ctrlKey && !e.altKey && !e.metaKey) { if (!isInputFocused() && isBattlePage()) { + // Debounce: ignore key-repeats until game processes the action + const now = Date.now(); + if (now - _lastQTime < Q_DEBOUNCE_MS) return; + _lastQTime = now; + console.log('%c[HV] Q pressed — checking action...', 'color:#888'); parseBattleState(); // Debug: show active buffs and channeling status diff --git a/scripts/latest.user.js b/scripts/latest.user.js index e3a8bba..d444f87 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.24 +// @version 0.13.25 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* @@ -17,7 +17,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.13.24'; +const VERSION = '0.13.25'; const CFG = { // — Battle automation @@ -1549,6 +1549,8 @@ function setupHover() { // ═══════════════════════════════════════════════════════════════════════ let keybindingsSetup = false; +let _lastQTime = 0; +const Q_DEBOUNCE_MS = 300; // Ignore Q repeats faster than this function setupKeybindings() { if (keybindingsSetup) return; @@ -1559,6 +1561,7 @@ function setupKeybindings() { if (e.keyCode === KEYS.COMMA) { if (isBattlePage()) { e.preventDefault(); + STATE.settingsVisible = !STATE.settingsVisible; toggleSettings(); return; } @@ -1567,6 +1570,11 @@ function setupKeybindings() { // Main action hotkey (default: Q) if (e.code === CFG.hotkey && !e.ctrlKey && !e.altKey && !e.metaKey) { if (!isInputFocused() && isBattlePage()) { + // Debounce: ignore key-repeats until game processes the action + const now = Date.now(); + if (now - _lastQTime < Q_DEBOUNCE_MS) return; + _lastQTime = now; + console.log('%c[HV] Q pressed — checking action...', 'color:#888'); parseBattleState(); // Debug: show active buffs and channeling status diff --git a/src/config.js b/src/config.js index b829d83..75ad03b 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.13.24'; +const VERSION = '0.13.25'; const CFG = { // — Battle automation diff --git a/src/header.user.js b/src/header.user.js index 1bd55c6..bdfda2b 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.24 +// @version 0.13.25 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* diff --git a/src/keybindings.js b/src/keybindings.js index 6024979..2ab4da5 100644 --- a/src/keybindings.js +++ b/src/keybindings.js @@ -3,6 +3,8 @@ // ═══════════════════════════════════════════════════════════════════════ let keybindingsSetup = false; +let _lastQTime = 0; +const Q_DEBOUNCE_MS = 300; // Ignore Q repeats faster than this function setupKeybindings() { if (keybindingsSetup) return; @@ -13,6 +15,7 @@ function setupKeybindings() { if (e.keyCode === KEYS.COMMA) { if (isBattlePage()) { e.preventDefault(); + STATE.settingsVisible = !STATE.settingsVisible; toggleSettings(); return; } @@ -21,6 +24,11 @@ function setupKeybindings() { // Main action hotkey (default: Q) if (e.code === CFG.hotkey && !e.ctrlKey && !e.altKey && !e.metaKey) { if (!isInputFocused() && isBattlePage()) { + // Debounce: ignore key-repeats until game processes the action + const now = Date.now(); + if (now - _lastQTime < Q_DEBOUNCE_MS) return; + _lastQTime = now; + console.log('%c[HV] Q pressed — checking action...', 'color:#888'); parseBattleState(); // Debug: show active buffs and channeling status