hv-unified/src/public-api.js
GaboGG ce09755fa8 v0.14.12 - Add captureAllTooltips() with async hover-to-popup delay
- captureAllTooltips() iterates each equipment slot, calls equips.set()
  to trigger the tooltip popup, waits 300ms for the DOM to update,
  then reads and saves the full stat block from #popup_box
- Catches 'Popup Box' default text vs real tooltip
- Saves stats directly to localStorage gear DB
- Exposed as HV.captureTooltips() for console use
- For best results: visit Character Equipment page, run HV.captureTooltips()
2026-07-27 15:31:06 -04:00

29 lines
1.4 KiB
JavaScript

// ═══════════════════════════════════════════════════════════════════════
// PUBLIC API — window.HV for console power users
// ═══════════════════════════════════════════════════════════════════════
window.HV = {
state: () => STATE,
config: () => CFG,
set: (k, v) => setConfig(k, v),
action: () => getRecommendedAction(),
execute: (a) => executeAction(a || getRecommendedAction()),
tier: () => STATE.tier,
stats: () => JSON.parse(localStorage[SP + 'stats'] || '{"battles":0,"credits":0,"drops":0}'),
settings: () => toggleSettings(),
advice: () => {
const s = detectFightingStyle();
return { style: s, attrs: getAttrAdvice(s), spells: getSpellAdvice(), difficulty: getDifficultyAdvice() };
},
difficulty: () => getDifficultyAdvice(),
// Battle log analysis
log: () => getBattleLog(),
summary: () => getBattleSummary(),
saveLog: () => {}, // Auto-saves in real-time now
// Gear database
gear: () => getGearDB(),
gearSummary: () => logGearSummary(),
scrapeGear: () => autoScrapeGear(),
gearDebug: () => debugScrapeGear(),
captureTooltips: () => captureAllTooltips(),
};