v0.14.11 - Fix DOM selector: onmouseover is on inner div, not .eqb parent
- .eqb parent has onclick and structure, but the onmouseover with equips.set() and the item name text are on a CHILD div within .eqb - Fixed scrapeCharacterEquip() and triggerAllTooltips() to query :scope > div[onmouseover] inside each .eqb slot - Fixed debugScrapeGear() diagnostic to show inner div content
This commit is contained in:
parent
992c6acc38
commit
c632c13818
5 changed files with 39 additions and 30 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name HV Unified
|
||||
// @namespace hvunified
|
||||
// @version 0.14.10
|
||||
// @version 0.14.11
|
||||
// @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.10';
|
||||
const VERSION = '0.14.11';
|
||||
|
||||
const CFG = {
|
||||
// — Battle automation
|
||||
|
|
@ -3265,9 +3265,11 @@ function debugScrapeGear() {
|
|||
console.log(`%c[HV] #eqsb found: ${slots.length} equipment slots`, 'color:#0f0');
|
||||
slots.forEach((s, i) => {
|
||||
const omo = s.getAttribute('onmouseover') || '';
|
||||
const nameEl = s.querySelector(':scope > div:not([class])') || s.querySelector('div');
|
||||
const name = nameEl ? (nameEl.textContent || '').trim() : 'no name';
|
||||
console.log(` [${i}] ${name} | onmouseover: ${omo.substring(0, 80)}`);
|
||||
// The onmouseover is on the inner name div, not the .eqb parent
|
||||
const nameDiv = s.querySelector(':scope > div[onmouseover]');
|
||||
const innerOmo = nameDiv ? (nameDiv.getAttribute('onmouseover') || '') : '';
|
||||
const name = nameDiv ? (nameDiv.textContent || '').trim() : 'no name';
|
||||
console.log(` [${i}] ${name} | onmouseover: ${(innerOmo || omo).substring(0, 80)}`);
|
||||
});
|
||||
} else {
|
||||
console.log(`%c[HV] ❌ #eqsb NOT FOUND`, 'color:#f44');
|
||||
|
|
@ -3414,13 +3416,13 @@ function scrapeCharacterEquip() {
|
|||
const slots = document.querySelectorAll('#eqsb > .eqb');
|
||||
|
||||
slots.forEach(slot => {
|
||||
// Get item ID from onmouseover
|
||||
const omo = slot.getAttribute('onmouseover') || slot.querySelector('[onmouseover]')?.getAttribute('onmouseover') || '';
|
||||
// onmouseover is on the inner name div, not the .eqb parent
|
||||
const nameDiv = slot.querySelector(':scope > div[onmouseover]');
|
||||
const omo = nameDiv ? (nameDiv.getAttribute('onmouseover') || '') : slot.getAttribute('onmouseover') || '';
|
||||
const idMatch = omo.match(/equips\.set\((\d+)/);
|
||||
const itemId = idMatch ? idMatch[1] : '';
|
||||
|
||||
// Get item name from the child div (text node)
|
||||
const nameDiv = slot.querySelector(':scope > div:not([class])') || slot.querySelector('div');
|
||||
// Name is the text content of the name div
|
||||
const name = nameDiv ? (nameDiv.textContent || '').trim() : '';
|
||||
|
||||
// Check if slot is disabled
|
||||
|
|
@ -3557,7 +3559,8 @@ function triggerAllTooltips() {
|
|||
const results = [];
|
||||
|
||||
slots.forEach(slot => {
|
||||
const omo = slot.getAttribute('onmouseover') || '';
|
||||
const nameDiv = slot.querySelector(':scope > div[onmouseover]');
|
||||
const omo = nameDiv ? (nameDiv.getAttribute('onmouseover') || '') : slot.getAttribute('onmouseover') || '';
|
||||
const idMatch = omo.match(/equips\.set\((\d+)/);
|
||||
if (idMatch && typeof equips !== 'undefined' && equips.set) {
|
||||
// Trigger the tooltip
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name HV Unified
|
||||
// @namespace hvunified
|
||||
// @version 0.14.10
|
||||
// @version 0.14.11
|
||||
// @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.10';
|
||||
const VERSION = '0.14.11';
|
||||
|
||||
const CFG = {
|
||||
// — Battle automation
|
||||
|
|
@ -3265,9 +3265,11 @@ function debugScrapeGear() {
|
|||
console.log(`%c[HV] #eqsb found: ${slots.length} equipment slots`, 'color:#0f0');
|
||||
slots.forEach((s, i) => {
|
||||
const omo = s.getAttribute('onmouseover') || '';
|
||||
const nameEl = s.querySelector(':scope > div:not([class])') || s.querySelector('div');
|
||||
const name = nameEl ? (nameEl.textContent || '').trim() : 'no name';
|
||||
console.log(` [${i}] ${name} | onmouseover: ${omo.substring(0, 80)}`);
|
||||
// The onmouseover is on the inner name div, not the .eqb parent
|
||||
const nameDiv = s.querySelector(':scope > div[onmouseover]');
|
||||
const innerOmo = nameDiv ? (nameDiv.getAttribute('onmouseover') || '') : '';
|
||||
const name = nameDiv ? (nameDiv.textContent || '').trim() : 'no name';
|
||||
console.log(` [${i}] ${name} | onmouseover: ${(innerOmo || omo).substring(0, 80)}`);
|
||||
});
|
||||
} else {
|
||||
console.log(`%c[HV] ❌ #eqsb NOT FOUND`, 'color:#f44');
|
||||
|
|
@ -3414,13 +3416,13 @@ function scrapeCharacterEquip() {
|
|||
const slots = document.querySelectorAll('#eqsb > .eqb');
|
||||
|
||||
slots.forEach(slot => {
|
||||
// Get item ID from onmouseover
|
||||
const omo = slot.getAttribute('onmouseover') || slot.querySelector('[onmouseover]')?.getAttribute('onmouseover') || '';
|
||||
// onmouseover is on the inner name div, not the .eqb parent
|
||||
const nameDiv = slot.querySelector(':scope > div[onmouseover]');
|
||||
const omo = nameDiv ? (nameDiv.getAttribute('onmouseover') || '') : slot.getAttribute('onmouseover') || '';
|
||||
const idMatch = omo.match(/equips\.set\((\d+)/);
|
||||
const itemId = idMatch ? idMatch[1] : '';
|
||||
|
||||
// Get item name from the child div (text node)
|
||||
const nameDiv = slot.querySelector(':scope > div:not([class])') || slot.querySelector('div');
|
||||
// Name is the text content of the name div
|
||||
const name = nameDiv ? (nameDiv.textContent || '').trim() : '';
|
||||
|
||||
// Check if slot is disabled
|
||||
|
|
@ -3557,7 +3559,8 @@ function triggerAllTooltips() {
|
|||
const results = [];
|
||||
|
||||
slots.forEach(slot => {
|
||||
const omo = slot.getAttribute('onmouseover') || '';
|
||||
const nameDiv = slot.querySelector(':scope > div[onmouseover]');
|
||||
const omo = nameDiv ? (nameDiv.getAttribute('onmouseover') || '') : slot.getAttribute('onmouseover') || '';
|
||||
const idMatch = omo.match(/equips\.set\((\d+)/);
|
||||
if (idMatch && typeof equips !== 'undefined' && equips.set) {
|
||||
// Trigger the tooltip
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// CONFIG — default settings
|
||||
// ═══════════════════════════════════════════════════════════════════════
|
||||
|
||||
const VERSION = '0.14.10';
|
||||
const VERSION = '0.14.11';
|
||||
|
||||
const CFG = {
|
||||
// — Battle automation
|
||||
|
|
|
|||
|
|
@ -22,9 +22,11 @@ function debugScrapeGear() {
|
|||
console.log(`%c[HV] #eqsb found: ${slots.length} equipment slots`, 'color:#0f0');
|
||||
slots.forEach((s, i) => {
|
||||
const omo = s.getAttribute('onmouseover') || '';
|
||||
const nameEl = s.querySelector(':scope > div:not([class])') || s.querySelector('div');
|
||||
const name = nameEl ? (nameEl.textContent || '').trim() : 'no name';
|
||||
console.log(` [${i}] ${name} | onmouseover: ${omo.substring(0, 80)}`);
|
||||
// The onmouseover is on the inner name div, not the .eqb parent
|
||||
const nameDiv = s.querySelector(':scope > div[onmouseover]');
|
||||
const innerOmo = nameDiv ? (nameDiv.getAttribute('onmouseover') || '') : '';
|
||||
const name = nameDiv ? (nameDiv.textContent || '').trim() : 'no name';
|
||||
console.log(` [${i}] ${name} | onmouseover: ${(innerOmo || omo).substring(0, 80)}`);
|
||||
});
|
||||
} else {
|
||||
console.log(`%c[HV] ❌ #eqsb NOT FOUND`, 'color:#f44');
|
||||
|
|
@ -171,13 +173,13 @@ function scrapeCharacterEquip() {
|
|||
const slots = document.querySelectorAll('#eqsb > .eqb');
|
||||
|
||||
slots.forEach(slot => {
|
||||
// Get item ID from onmouseover
|
||||
const omo = slot.getAttribute('onmouseover') || slot.querySelector('[onmouseover]')?.getAttribute('onmouseover') || '';
|
||||
// onmouseover is on the inner name div, not the .eqb parent
|
||||
const nameDiv = slot.querySelector(':scope > div[onmouseover]');
|
||||
const omo = nameDiv ? (nameDiv.getAttribute('onmouseover') || '') : slot.getAttribute('onmouseover') || '';
|
||||
const idMatch = omo.match(/equips\.set\((\d+)/);
|
||||
const itemId = idMatch ? idMatch[1] : '';
|
||||
|
||||
// Get item name from the child div (text node)
|
||||
const nameDiv = slot.querySelector(':scope > div:not([class])') || slot.querySelector('div');
|
||||
// Name is the text content of the name div
|
||||
const name = nameDiv ? (nameDiv.textContent || '').trim() : '';
|
||||
|
||||
// Check if slot is disabled
|
||||
|
|
@ -314,7 +316,8 @@ function triggerAllTooltips() {
|
|||
const results = [];
|
||||
|
||||
slots.forEach(slot => {
|
||||
const omo = slot.getAttribute('onmouseover') || '';
|
||||
const nameDiv = slot.querySelector(':scope > div[onmouseover]');
|
||||
const omo = nameDiv ? (nameDiv.getAttribute('onmouseover') || '') : slot.getAttribute('onmouseover') || '';
|
||||
const idMatch = omo.match(/equips\.set\((\d+)/);
|
||||
if (idMatch && typeof equips !== 'undefined' && equips.set) {
|
||||
// Trigger the tooltip
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name HV Unified
|
||||
// @namespace hvunified
|
||||
// @version 0.14.10
|
||||
// @version 0.14.11
|
||||
// @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse
|
||||
// @author GaboGG + Hermes
|
||||
// @match *://*.hentaiverse.org/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue