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,