From 28a13449bd35259f13b49c409adf857bc37bf6cb Mon Sep 17 00:00:00 2001 From: GaboGG Date: Sun, 26 Jul 2026 13:26:19 -0400 Subject: [PATCH] v0.13.6 - Auto-execute on vitals observer (no hover required) - Added action execution to the vitals MutationObserver so the script fires on every round tick, not only when hovering a monster - This fixes buffs expiring and channeling being wasted when the user isn't actively hovering a monster during auto-battle - Removed unused STATE.battleRound --- scripts/hv-unified.user.js | 6 +++++- scripts/latest.user.js | 6 +++++- src/init.js | 5 +++++ src/state.js | 1 - 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index 63a85b3..2ab5c74 100644 --- a/scripts/hv-unified.user.js +++ b/scripts/hv-unified.user.js @@ -76,7 +76,6 @@ const STATE = { battleMode: '', inBattle: false, battleInitialized: false, - battleRound: 0, // Incremented each round for first-round logic hoverTarget: -1, interruptHover: false, @@ -3270,6 +3269,11 @@ function initializeBattle() { const vobs = new MutationObserver(() => { parseBattleState(); logRound(); // Also log on vitals changes (catches end-of-round) + // Auto-execute strategy even without hover — for auto-battle + if (CFG.hoverEnabled && !STATE.interruptHover && !STATE.interruptAlert) { + const a = getSmartAction(); + if (a) executeAction(a); + } refreshUI(); updateConfigButton(); // Check if battle ended (completion pane appeared) diff --git a/scripts/latest.user.js b/scripts/latest.user.js index 63a85b3..2ab5c74 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -76,7 +76,6 @@ const STATE = { battleMode: '', inBattle: false, battleInitialized: false, - battleRound: 0, // Incremented each round for first-round logic hoverTarget: -1, interruptHover: false, @@ -3270,6 +3269,11 @@ function initializeBattle() { const vobs = new MutationObserver(() => { parseBattleState(); logRound(); // Also log on vitals changes (catches end-of-round) + // Auto-execute strategy even without hover — for auto-battle + if (CFG.hoverEnabled && !STATE.interruptHover && !STATE.interruptAlert) { + const a = getSmartAction(); + if (a) executeAction(a); + } refreshUI(); updateConfigButton(); // Check if battle ended (completion pane appeared) diff --git a/src/init.js b/src/init.js index d87b1fb..633ba4c 100644 --- a/src/init.js +++ b/src/init.js @@ -85,6 +85,11 @@ function initializeBattle() { const vobs = new MutationObserver(() => { parseBattleState(); logRound(); // Also log on vitals changes (catches end-of-round) + // Auto-execute strategy even without hover — for auto-battle + if (CFG.hoverEnabled && !STATE.interruptHover && !STATE.interruptAlert) { + const a = getSmartAction(); + if (a) executeAction(a); + } refreshUI(); updateConfigButton(); // Check if battle ended (completion pane appeared) diff --git a/src/state.js b/src/state.js index 4b023ad..b6984b9 100644 --- a/src/state.js +++ b/src/state.js @@ -12,7 +12,6 @@ const STATE = { battleMode: '', inBattle: false, battleInitialized: false, - battleRound: 0, // Incremented each round for first-round logic hoverTarget: -1, interruptHover: false,