diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index c9a7cfd..eedc0a1 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.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(), }; // ═══════════════════════════════════════════════════════════════════════ diff --git a/scripts/latest.user.js b/scripts/latest.user.js index c9a7cfd..eedc0a1 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -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(), }; // ═══════════════════════════════════════════════════════════════════════ diff --git a/src/config.js b/src/config.js index 0b52038..2586464 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.14.9'; +const VERSION = '0.14.10'; const CFG = { // — Battle automation diff --git a/src/gear-scraper.js b/src/gear-scraper.js index ca01162..52d8d33 100644 --- a/src/gear-scraper.js +++ b/src/gear-scraper.js @@ -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 []; } } diff --git a/src/header.user.js b/src/header.user.js index f7a5399..38bbe56 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -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/* diff --git a/src/public-api.js b/src/public-api.js index 864f351..fd99792 100644 --- a/src/public-api.js +++ b/src/public-api.js @@ -24,4 +24,5 @@ window.HV = { gear: () => getGearDB(), gearSummary: () => logGearSummary(), scrapeGear: () => autoScrapeGear(), + gearDebug: () => debugScrapeGear(), };