From 205f1cd631a39138d84ccc1ea4421e2fbfef0b41 Mon Sep 17 00:00:00 2001 From: GaboGG Date: Mon, 27 Jul 2026 14:08:48 -0400 Subject: [PATCH] v0.14.2 - Double-check cooldown via img opacity:0.5 in hasReadySpell - Some quickbar/deprecated elements retain onclick even when on cooldown if the cooldown indicator is only visual (img opacity:0.5) not structural - Now also checks img.btqi / img style.opacity !== '0.5' - This catches cases where the parent div has onclick but the inner image is visually dimmed (game cooldown) --- scripts/hv-unified.user.js | 14 ++++++++++---- scripts/latest.user.js | 14 ++++++++++---- src/config.js | 2 +- src/header.user.js | 2 +- src/strategy-engine.js | 10 ++++++++-- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index 2929789..4bf9507 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.14.1 +// @version 0.14.2 // @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.14.1'; +const VERSION = '0.14.2'; const CFG = { // — Battle automation @@ -733,11 +733,17 @@ function hasSpell(name) { return STATE.spellsKnown.some(s => s.n === name); } -// Check if a spell is not on cooldown (has onclick in the DOM) +// Check if a spell is not on cooldown (has onclick in the DOM AND inner img isn't dimmed) function hasReadySpell(name) { const el = $$('.btsd, .btqs').find(e => (e.getAttribute('onmouseover') || '').includes(`set_infopane_spell('${name}'`)); - return el ? el.hasAttribute('onclick') : false; + if (!el) return false; + if (!el.hasAttribute('onclick')) return false; + // Double-check: the inner img might have opacity:0.5 (cooldown tint) + // even if the parent has onclick from a previous parse + const img = el.querySelector('img.btqi, img'); + if (img && img.style.opacity === '0.5') return false; + return true; } function findSpell(name) { diff --git a/scripts/latest.user.js b/scripts/latest.user.js index 2929789..4bf9507 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.14.1 +// @version 0.14.2 // @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.14.1'; +const VERSION = '0.14.2'; const CFG = { // — Battle automation @@ -733,11 +733,17 @@ function hasSpell(name) { return STATE.spellsKnown.some(s => s.n === name); } -// Check if a spell is not on cooldown (has onclick in the DOM) +// Check if a spell is not on cooldown (has onclick in the DOM AND inner img isn't dimmed) function hasReadySpell(name) { const el = $$('.btsd, .btqs').find(e => (e.getAttribute('onmouseover') || '').includes(`set_infopane_spell('${name}'`)); - return el ? el.hasAttribute('onclick') : false; + if (!el) return false; + if (!el.hasAttribute('onclick')) return false; + // Double-check: the inner img might have opacity:0.5 (cooldown tint) + // even if the parent has onclick from a previous parse + const img = el.querySelector('img.btqi, img'); + if (img && img.style.opacity === '0.5') return false; + return true; } function findSpell(name) { diff --git a/src/config.js b/src/config.js index d048778..d7f90f8 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.14.1'; +const VERSION = '0.14.2'; const CFG = { // — Battle automation diff --git a/src/header.user.js b/src/header.user.js index f632a77..85c1c19 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.14.1 +// @version 0.14.2 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/* diff --git a/src/strategy-engine.js b/src/strategy-engine.js index e5cf37f..eb180ea 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -8,11 +8,17 @@ function hasSpell(name) { return STATE.spellsKnown.some(s => s.n === name); } -// Check if a spell is not on cooldown (has onclick in the DOM) +// Check if a spell is not on cooldown (has onclick in the DOM AND inner img isn't dimmed) function hasReadySpell(name) { const el = $$('.btsd, .btqs').find(e => (e.getAttribute('onmouseover') || '').includes(`set_infopane_spell('${name}'`)); - return el ? el.hasAttribute('onclick') : false; + if (!el) return false; + if (!el.hasAttribute('onclick')) return false; + // Double-check: the inner img might have opacity:0.5 (cooldown tint) + // even if the parent has onclick from a previous parse + const img = el.querySelector('img.btqi, img'); + if (img && img.style.opacity === '0.5') return false; + return true; } function findSpell(name) {