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
This commit is contained in:
GaboGG 2026-07-26 13:26:19 -04:00
parent ee9bba90fc
commit 28a13449bd
4 changed files with 15 additions and 3 deletions

View file

@ -76,7 +76,6 @@ const STATE = {
battleMode: '', battleMode: '',
inBattle: false, inBattle: false,
battleInitialized: false, battleInitialized: false,
battleRound: 0, // Incremented each round for first-round logic
hoverTarget: -1, hoverTarget: -1,
interruptHover: false, interruptHover: false,
@ -3270,6 +3269,11 @@ function initializeBattle() {
const vobs = new MutationObserver(() => { const vobs = new MutationObserver(() => {
parseBattleState(); parseBattleState();
logRound(); // Also log on vitals changes (catches end-of-round) 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(); refreshUI();
updateConfigButton(); updateConfigButton();
// Check if battle ended (completion pane appeared) // Check if battle ended (completion pane appeared)

View file

@ -76,7 +76,6 @@ const STATE = {
battleMode: '', battleMode: '',
inBattle: false, inBattle: false,
battleInitialized: false, battleInitialized: false,
battleRound: 0, // Incremented each round for first-round logic
hoverTarget: -1, hoverTarget: -1,
interruptHover: false, interruptHover: false,
@ -3270,6 +3269,11 @@ function initializeBattle() {
const vobs = new MutationObserver(() => { const vobs = new MutationObserver(() => {
parseBattleState(); parseBattleState();
logRound(); // Also log on vitals changes (catches end-of-round) 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(); refreshUI();
updateConfigButton(); updateConfigButton();
// Check if battle ended (completion pane appeared) // Check if battle ended (completion pane appeared)

View file

@ -85,6 +85,11 @@ function initializeBattle() {
const vobs = new MutationObserver(() => { const vobs = new MutationObserver(() => {
parseBattleState(); parseBattleState();
logRound(); // Also log on vitals changes (catches end-of-round) 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(); refreshUI();
updateConfigButton(); updateConfigButton();
// Check if battle ended (completion pane appeared) // Check if battle ended (completion pane appeared)

View file

@ -12,7 +12,6 @@ const STATE = {
battleMode: '', battleMode: '',
inBattle: false, inBattle: false,
battleInitialized: false, battleInitialized: false,
battleRound: 0, // Incremented each round for first-round logic
hoverTarget: -1, hoverTarget: -1,
interruptHover: false, interruptHover: false,