From 23f00450be3cf96480faa8bb173ac56cff5ef679 Mon Sep 17 00:00:00 2001 From: GaboGG Date: Sun, 26 Jul 2026 13:53:01 -0400 Subject: [PATCH] v0.13.14 - Fix observer crash, raise channeling threshold to 30 - Removed call to undefined finalizeBattleLog() that was spamming ReferenceErrors and potentially corrupting the MutationObserver - Raised channeling score threshold from 5 to 30: now only picks a buff for channeling if it's at least 30% empty on a 100-MP spell or 60% empty on a 50-MP spell - Spark at 30/60 turns (50% empty, score 44) now falls to cheap damage fallback instead of wasting channeling --- scripts/hv-unified.user.js | 12 ++++++------ scripts/latest.user.js | 12 ++++++------ src/config.js | 2 +- src/header.user.js | 2 +- src/init.js | 2 +- src/strategy-engine.js | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index 73dad37..36e2425 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.13 +// @version 0.13.14 // @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.13'; +const VERSION = '0.13.14'; const CFG = { // — Battle automation @@ -908,9 +908,9 @@ function findBestChannelingTarget() { if (candidates.length > 0) { candidates.sort((a, b) => b.score - a.score); - // Only use a buff if it actually needs refreshing (score >= 5 means - // e.g. 10% emptiness on a 50-MP spell, or 5% on a 100-MP spell) - if (candidates[0].score >= 5) { + // Only use a buff if it actually needs refreshing (score >= 30 means + // e.g. 30% emptiness on a 100-MP spell, or 60% on a 50-MP spell) + if (candidates[0].score >= 30) { return { type: 'spell', name: candidates[0].spell, selfTarget: true }; } } @@ -3310,7 +3310,7 @@ function initializeBattle() { updateConfigButton(); // Check if battle ended (completion pane appeared) if (document.getElementById('pane_completion')) { - finalizeBattleLog(); + // Battle ended — handled by log observer } }); vobs.observe(vitals, { childList: true, subtree: true, attributes: true }); diff --git a/scripts/latest.user.js b/scripts/latest.user.js index 73dad37..36e2425 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.13 +// @version 0.13.14 // @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.13'; +const VERSION = '0.13.14'; const CFG = { // — Battle automation @@ -908,9 +908,9 @@ function findBestChannelingTarget() { if (candidates.length > 0) { candidates.sort((a, b) => b.score - a.score); - // Only use a buff if it actually needs refreshing (score >= 5 means - // e.g. 10% emptiness on a 50-MP spell, or 5% on a 100-MP spell) - if (candidates[0].score >= 5) { + // Only use a buff if it actually needs refreshing (score >= 30 means + // e.g. 30% emptiness on a 100-MP spell, or 60% on a 50-MP spell) + if (candidates[0].score >= 30) { return { type: 'spell', name: candidates[0].spell, selfTarget: true }; } } @@ -3310,7 +3310,7 @@ function initializeBattle() { updateConfigButton(); // Check if battle ended (completion pane appeared) if (document.getElementById('pane_completion')) { - finalizeBattleLog(); + // Battle ended — handled by log observer } }); vobs.observe(vitals, { childList: true, subtree: true, attributes: true }); diff --git a/src/config.js b/src/config.js index 0cd03f6..a7b6369 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.13.13'; +const VERSION = '0.13.14'; const CFG = { // — Battle automation diff --git a/src/header.user.js b/src/header.user.js index d76e8f1..7016a4e 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.13.13 +// @version 0.13.14 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* diff --git a/src/init.js b/src/init.js index 1eca743..ecb0de6 100644 --- a/src/init.js +++ b/src/init.js @@ -89,7 +89,7 @@ function initializeBattle() { updateConfigButton(); // Check if battle ended (completion pane appeared) if (document.getElementById('pane_completion')) { - finalizeBattleLog(); + // Battle ended — handled by log observer } }); vobs.observe(vitals, { childList: true, subtree: true, attributes: true }); diff --git a/src/strategy-engine.js b/src/strategy-engine.js index 6809e2c..c5b6f1e 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -249,9 +249,9 @@ function findBestChannelingTarget() { if (candidates.length > 0) { candidates.sort((a, b) => b.score - a.score); - // Only use a buff if it actually needs refreshing (score >= 5 means - // e.g. 10% emptiness on a 50-MP spell, or 5% on a 100-MP spell) - if (candidates[0].score >= 5) { + // Only use a buff if it actually needs refreshing (score >= 30 means + // e.g. 30% emptiness on a 100-MP spell, or 60% on a 50-MP spell) + if (candidates[0].score >= 30) { return { type: 'spell', name: candidates[0].spell, selfTarget: true }; } }