v0.14.13 - Clean scrape flow: basic data on page load, stats via captureAllTooltips
- scrapeCharacterEquip() now only reads names/IDs from DOM slots (no tooltip popup reading — that was attaching wrong stats to wrong slots) - captureAllTooltips() now calls logGearSummary() instead of autoScrapeGear() so the tooltip stats aren't wiped by a re-scrape - Workflow: visit Character Equipment page, then run HV.captureTooltips() to populate full stats with 300ms hover delay per item
This commit is contained in:
parent
ce09755fa8
commit
28457202ba
5 changed files with 12 additions and 60 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name HV Unified
|
||||
// @namespace hvunified
|
||||
// @version 0.14.12
|
||||
// @version 0.14.13
|
||||
// @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.12';
|
||||
const VERSION = '0.14.13';
|
||||
|
||||
const CFG = {
|
||||
// — Battle automation
|
||||
|
|
@ -3441,19 +3441,6 @@ function scrapeCharacterEquip() {
|
|||
});
|
||||
});
|
||||
|
||||
// Read the popup box for the currently-displayed tooltip
|
||||
// Note: popup_box only updates on actual hover; triggerAllTooltips
|
||||
// may not work if equips.set is async. We still get names/IDs from slots.
|
||||
try {
|
||||
const tooltip = parseTooltipPopup();
|
||||
if (tooltip && tooltip.name && tooltip.name !== 'Popup Box') {
|
||||
const matchIdx = scraped.findIndex(s => tooltip.name.includes(s.name) || s.name.includes(tooltip.name));
|
||||
if (matchIdx >= 0) {
|
||||
scraped[matchIdx].stats = tooltip.stats;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
if (scraped.length > 0) {
|
||||
const db = getGearDB();
|
||||
const filtered = db.filter(e => !(e.source === 'character'));
|
||||
|
|
@ -3581,8 +3568,8 @@ function captureAllTooltips(delay = 400) {
|
|||
function next() {
|
||||
if (idx >= slots.length) {
|
||||
console.log(`%c[HV] Captured ${results.length} tooltips`, 'color:#0f0');
|
||||
// Re-scrape with the captured data
|
||||
autoScrapeGear();
|
||||
// DON'T re-scrape — that would wipe the tooltip stats we just saved
|
||||
logGearSummary();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3628,9 +3615,6 @@ function autoScrapeGear() {
|
|||
|
||||
// Character equipment page
|
||||
if (url.includes('ss=eq')) {
|
||||
// Trigger tooltips for all items to populate popup_box
|
||||
const tooltips = triggerAllTooltips();
|
||||
// Then scrape
|
||||
return scrapeCharacterEquip();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name HV Unified
|
||||
// @namespace hvunified
|
||||
// @version 0.14.12
|
||||
// @version 0.14.13
|
||||
// @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.12';
|
||||
const VERSION = '0.14.13';
|
||||
|
||||
const CFG = {
|
||||
// — Battle automation
|
||||
|
|
@ -3441,19 +3441,6 @@ function scrapeCharacterEquip() {
|
|||
});
|
||||
});
|
||||
|
||||
// Read the popup box for the currently-displayed tooltip
|
||||
// Note: popup_box only updates on actual hover; triggerAllTooltips
|
||||
// may not work if equips.set is async. We still get names/IDs from slots.
|
||||
try {
|
||||
const tooltip = parseTooltipPopup();
|
||||
if (tooltip && tooltip.name && tooltip.name !== 'Popup Box') {
|
||||
const matchIdx = scraped.findIndex(s => tooltip.name.includes(s.name) || s.name.includes(tooltip.name));
|
||||
if (matchIdx >= 0) {
|
||||
scraped[matchIdx].stats = tooltip.stats;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
if (scraped.length > 0) {
|
||||
const db = getGearDB();
|
||||
const filtered = db.filter(e => !(e.source === 'character'));
|
||||
|
|
@ -3581,8 +3568,8 @@ function captureAllTooltips(delay = 400) {
|
|||
function next() {
|
||||
if (idx >= slots.length) {
|
||||
console.log(`%c[HV] Captured ${results.length} tooltips`, 'color:#0f0');
|
||||
// Re-scrape with the captured data
|
||||
autoScrapeGear();
|
||||
// DON'T re-scrape — that would wipe the tooltip stats we just saved
|
||||
logGearSummary();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3628,9 +3615,6 @@ function autoScrapeGear() {
|
|||
|
||||
// Character equipment page
|
||||
if (url.includes('ss=eq')) {
|
||||
// Trigger tooltips for all items to populate popup_box
|
||||
const tooltips = triggerAllTooltips();
|
||||
// Then scrape
|
||||
return scrapeCharacterEquip();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// CONFIG — default settings
|
||||
// ═══════════════════════════════════════════════════════════════════════
|
||||
|
||||
const VERSION = '0.14.12';
|
||||
const VERSION = '0.14.13';
|
||||
|
||||
const CFG = {
|
||||
// — Battle automation
|
||||
|
|
|
|||
|
|
@ -198,19 +198,6 @@ function scrapeCharacterEquip() {
|
|||
});
|
||||
});
|
||||
|
||||
// Read the popup box for the currently-displayed tooltip
|
||||
// Note: popup_box only updates on actual hover; triggerAllTooltips
|
||||
// may not work if equips.set is async. We still get names/IDs from slots.
|
||||
try {
|
||||
const tooltip = parseTooltipPopup();
|
||||
if (tooltip && tooltip.name && tooltip.name !== 'Popup Box') {
|
||||
const matchIdx = scraped.findIndex(s => tooltip.name.includes(s.name) || s.name.includes(tooltip.name));
|
||||
if (matchIdx >= 0) {
|
||||
scraped[matchIdx].stats = tooltip.stats;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
if (scraped.length > 0) {
|
||||
const db = getGearDB();
|
||||
const filtered = db.filter(e => !(e.source === 'character'));
|
||||
|
|
@ -338,8 +325,8 @@ function captureAllTooltips(delay = 400) {
|
|||
function next() {
|
||||
if (idx >= slots.length) {
|
||||
console.log(`%c[HV] Captured ${results.length} tooltips`, 'color:#0f0');
|
||||
// Re-scrape with the captured data
|
||||
autoScrapeGear();
|
||||
// DON'T re-scrape — that would wipe the tooltip stats we just saved
|
||||
logGearSummary();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -385,9 +372,6 @@ function autoScrapeGear() {
|
|||
|
||||
// Character equipment page
|
||||
if (url.includes('ss=eq')) {
|
||||
// Trigger tooltips for all items to populate popup_box
|
||||
const tooltips = triggerAllTooltips();
|
||||
// Then scrape
|
||||
return scrapeCharacterEquip();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name HV Unified
|
||||
// @namespace hvunified
|
||||
// @version 0.14.12
|
||||
// @version 0.14.13
|
||||
// @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse
|
||||
// @author GaboGG + Hermes
|
||||
// @match *://*.hentaiverse.org/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue