v0.14.10 - Add debugScrapeGear() diagnostic + HV.gearDebug()

- New debugScrapeGear() function checks DOM structure:
  - Whether #eqsb exists and its slot count
  - Whether #equiplist exists
  - Whether #popup_box exists and its content
  - Whether equips global is available
- Exposed as HV.gearDebug() for console use
This commit is contained in:
GaboGG 2026-07-27 15:16:03 -04:00
parent a7a304f5d4
commit 992c6acc38
6 changed files with 141 additions and 9 deletions

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name HV Unified
// @namespace hvunified
// @version 0.14.9
// @version 0.14.10
// @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.9';
const VERSION = '0.14.10';
const CFG = {
// — Battle automation
@ -3253,7 +3253,50 @@ function enhanceArmory() {
const GEAR_DB_KEY = SP + 'geardb';
// ── Public API ──
// Forced scrape from console with diagnostics
function debugScrapeGear() {
const url = window.location.href || '';
console.log(`%c[HV] 🔍 Gear Debug: URL=${url}`, 'color:#f80');
// Check for #eqsb
const eqsb = document.getElementById('eqsb');
if (eqsb) {
const slots = eqsb.querySelectorAll(':scope > .eqb');
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)}`);
});
} else {
console.log(`%c[HV] ❌ #eqsb NOT FOUND`, 'color:#f44');
}
// Check for #equiplist
const equiplist = document.getElementById('equiplist');
if (equiplist) {
const rows = equiplist.querySelectorAll('table tr');
console.log(`%c[HV] #equiplist found: ${rows.length} rows`, 'color:#0f0');
} else {
console.log(`%c[HV] ❌ #equiplist NOT FOUND`, 'color:#f44');
}
// Check popup_box
const popup = document.getElementById('popup_box');
if (popup) {
const text = (popup.textContent || '').substring(0, 100);
console.log(`%c[HV] #popup_box: "${text}..."`, 'color:#888');
} else {
console.log(`%c[HV] ❌ #popup_box NOT FOUND`, 'color:#f44');
}
// Check for equips global
console.log(`%c[HV] typeof equips = ${typeof equips}`, 'color:#888');
return { url, hasEqsb: !!eqsb, hasEquiplist: !!equiplist, hasPopup: !!popup };
}
function getGearDB() {
try { return JSON.parse(localStorage[GEAR_DB_KEY] || '[]'); } catch (e) { return []; }
}
@ -3907,6 +3950,7 @@ window.HV = {
gear: () => getGearDB(),
gearSummary: () => logGearSummary(),
scrapeGear: () => autoScrapeGear(),
gearDebug: () => debugScrapeGear(),
};
// ═══════════════════════════════════════════════════════════════════════

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name HV Unified
// @namespace hvunified
// @version 0.14.9
// @version 0.14.10
// @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.9';
const VERSION = '0.14.10';
const CFG = {
// — Battle automation
@ -3253,7 +3253,50 @@ function enhanceArmory() {
const GEAR_DB_KEY = SP + 'geardb';
// ── Public API ──
// Forced scrape from console with diagnostics
function debugScrapeGear() {
const url = window.location.href || '';
console.log(`%c[HV] 🔍 Gear Debug: URL=${url}`, 'color:#f80');
// Check for #eqsb
const eqsb = document.getElementById('eqsb');
if (eqsb) {
const slots = eqsb.querySelectorAll(':scope > .eqb');
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)}`);
});
} else {
console.log(`%c[HV] ❌ #eqsb NOT FOUND`, 'color:#f44');
}
// Check for #equiplist
const equiplist = document.getElementById('equiplist');
if (equiplist) {
const rows = equiplist.querySelectorAll('table tr');
console.log(`%c[HV] #equiplist found: ${rows.length} rows`, 'color:#0f0');
} else {
console.log(`%c[HV] ❌ #equiplist NOT FOUND`, 'color:#f44');
}
// Check popup_box
const popup = document.getElementById('popup_box');
if (popup) {
const text = (popup.textContent || '').substring(0, 100);
console.log(`%c[HV] #popup_box: "${text}..."`, 'color:#888');
} else {
console.log(`%c[HV] ❌ #popup_box NOT FOUND`, 'color:#f44');
}
// Check for equips global
console.log(`%c[HV] typeof equips = ${typeof equips}`, 'color:#888');
return { url, hasEqsb: !!eqsb, hasEquiplist: !!equiplist, hasPopup: !!popup };
}
function getGearDB() {
try { return JSON.parse(localStorage[GEAR_DB_KEY] || '[]'); } catch (e) { return []; }
}
@ -3907,6 +3950,7 @@ window.HV = {
gear: () => getGearDB(),
gearSummary: () => logGearSummary(),
scrapeGear: () => autoScrapeGear(),
gearDebug: () => debugScrapeGear(),
};
// ═══════════════════════════════════════════════════════════════════════

View file

@ -2,7 +2,7 @@
// CONFIG — default settings
// ═══════════════════════════════════════════════════════════════════════
const VERSION = '0.14.9';
const VERSION = '0.14.10';
const CFG = {
// — Battle automation

View file

@ -10,7 +10,50 @@
const GEAR_DB_KEY = SP + 'geardb';
// ── Public API ──
// Forced scrape from console with diagnostics
function debugScrapeGear() {
const url = window.location.href || '';
console.log(`%c[HV] 🔍 Gear Debug: URL=${url}`, 'color:#f80');
// Check for #eqsb
const eqsb = document.getElementById('eqsb');
if (eqsb) {
const slots = eqsb.querySelectorAll(':scope > .eqb');
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)}`);
});
} else {
console.log(`%c[HV] ❌ #eqsb NOT FOUND`, 'color:#f44');
}
// Check for #equiplist
const equiplist = document.getElementById('equiplist');
if (equiplist) {
const rows = equiplist.querySelectorAll('table tr');
console.log(`%c[HV] #equiplist found: ${rows.length} rows`, 'color:#0f0');
} else {
console.log(`%c[HV] ❌ #equiplist NOT FOUND`, 'color:#f44');
}
// Check popup_box
const popup = document.getElementById('popup_box');
if (popup) {
const text = (popup.textContent || '').substring(0, 100);
console.log(`%c[HV] #popup_box: "${text}..."`, 'color:#888');
} else {
console.log(`%c[HV] ❌ #popup_box NOT FOUND`, 'color:#f44');
}
// Check for equips global
console.log(`%c[HV] typeof equips = ${typeof equips}`, 'color:#888');
return { url, hasEqsb: !!eqsb, hasEquiplist: !!equiplist, hasPopup: !!popup };
}
function getGearDB() {
try { return JSON.parse(localStorage[GEAR_DB_KEY] || '[]'); } catch (e) { return []; }
}

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name HV Unified
// @namespace hvunified
// @version 0.14.9
// @version 0.14.10
// @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse
// @author GaboGG + Hermes
// @match *://*.hentaiverse.org/*

View file

@ -24,4 +24,5 @@ window.HV = {
gear: () => getGearDB(),
gearSummary: () => logGearSummary(),
scrapeGear: () => autoScrapeGear(),
gearDebug: () => debugScrapeGear(),
};