From b59da5544ac0d836a122e4db0bef9424ea3887b1 Mon Sep 17 00:00:00 2001 From: GaboGG Date: Fri, 31 Jul 2026 14:28:17 -0400 Subject: [PATCH] v0.15.1 - Keep Top 10% (min 5) instead of fixed 5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - keepCount = max(5, ceil(categorySize * 0.10)) - Small categories still keep minimum 5; large ones scale up (e.g. 40 items in a category → keep 5, 80 → keep 8, 120 → keep 12) --- scripts/hv-unified.user.js | 19 ++++++++++--------- scripts/latest.user.js | 19 ++++++++++--------- src/armory.js | 15 ++++++++------- src/config.js | 2 +- src/header.user.js | 2 +- 5 files changed, 30 insertions(+), 27 deletions(-) diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index bd73ff1..6b0d24f 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.15.0 +// @version 0.15.1 // @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.15.0'; +const VERSION = '0.15.1'; const CFG = { // — Battle automation @@ -3323,12 +3323,13 @@ function enhanceArmory() { catMap.get(cat).push({ item, score }); }); - // Keep top 5 per category, select the rest + // Keep top 10% per category (min 5), select the rest let selected = 0; catMap.forEach((list, cat) => { list.sort((a, b) => b.score - a.score); - const keep = list.slice(0, 5); - const dump = list.slice(5); + const keepCount = Math.max(5, Math.ceil(list.length * 0.10)); + const keep = list.slice(0, keepCount); + const dump = list.slice(keepCount); dump.forEach(({ item }) => { item.checkbox.checked = true; selected++; @@ -3340,16 +3341,16 @@ function enhanceArmory() { return selected; } - // ── Keep Top 5 button — available on sell and salvage screens ── + // ── Keep Top 10% button — available on sell and salvage screens ── if (screen === 'sell' || screen === 'salvage') { const b3 = document.createElement('input'); b3.type = 'button'; - b3.value = `⭐ Keep Top 5 / Select ${screen === 'sell' ? 'Sell' : 'Salvage'} Rest`; + b3.value = `⭐ Keep Top 10% / Select ${screen === 'sell' ? 'Sell' : 'Salvage'} Rest`; b3.style.cssText = 'padding:2px 6px;cursor:pointer;background:#7a5a2a;color:#fff;border:none;border-radius:3px;font-size:10px'; - b3.title = 'Keeps the 5 highest-scoring items in each category (1H, 2H, Staff, Shield, and each armor slot per Cloth/Light/Heavy). Selects everything else.'; + b3.title = 'Keeps the top 10% (min 5) highest-scoring items in each category (1H, 2H, Staff, Shield, and each armor slot per Cloth/Light/Heavy). Selects everything else.'; b3.onclick = () => { const n = keepTop5AndSelect(screen); - console.log(`%c[HV] ⭐ Keep Top 5: ${n} items selected for ${screen}`, 'color:#0f0'); + console.log(`%c[HV] ⭐ Keep Top 10%: ${n} items selected for ${screen}`, 'color:#0f0'); }; toolbar.appendChild(b3); } diff --git a/scripts/latest.user.js b/scripts/latest.user.js index bd73ff1..6b0d24f 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.15.0 +// @version 0.15.1 // @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.15.0'; +const VERSION = '0.15.1'; const CFG = { // — Battle automation @@ -3323,12 +3323,13 @@ function enhanceArmory() { catMap.get(cat).push({ item, score }); }); - // Keep top 5 per category, select the rest + // Keep top 10% per category (min 5), select the rest let selected = 0; catMap.forEach((list, cat) => { list.sort((a, b) => b.score - a.score); - const keep = list.slice(0, 5); - const dump = list.slice(5); + const keepCount = Math.max(5, Math.ceil(list.length * 0.10)); + const keep = list.slice(0, keepCount); + const dump = list.slice(keepCount); dump.forEach(({ item }) => { item.checkbox.checked = true; selected++; @@ -3340,16 +3341,16 @@ function enhanceArmory() { return selected; } - // ── Keep Top 5 button — available on sell and salvage screens ── + // ── Keep Top 10% button — available on sell and salvage screens ── if (screen === 'sell' || screen === 'salvage') { const b3 = document.createElement('input'); b3.type = 'button'; - b3.value = `⭐ Keep Top 5 / Select ${screen === 'sell' ? 'Sell' : 'Salvage'} Rest`; + b3.value = `⭐ Keep Top 10% / Select ${screen === 'sell' ? 'Sell' : 'Salvage'} Rest`; b3.style.cssText = 'padding:2px 6px;cursor:pointer;background:#7a5a2a;color:#fff;border:none;border-radius:3px;font-size:10px'; - b3.title = 'Keeps the 5 highest-scoring items in each category (1H, 2H, Staff, Shield, and each armor slot per Cloth/Light/Heavy). Selects everything else.'; + b3.title = 'Keeps the top 10% (min 5) highest-scoring items in each category (1H, 2H, Staff, Shield, and each armor slot per Cloth/Light/Heavy). Selects everything else.'; b3.onclick = () => { const n = keepTop5AndSelect(screen); - console.log(`%c[HV] ⭐ Keep Top 5: ${n} items selected for ${screen}`, 'color:#0f0'); + console.log(`%c[HV] ⭐ Keep Top 10%: ${n} items selected for ${screen}`, 'color:#0f0'); }; toolbar.appendChild(b3); } diff --git a/src/armory.js b/src/armory.js index 52efb8c..d5badd8 100644 --- a/src/armory.js +++ b/src/armory.js @@ -217,12 +217,13 @@ function enhanceArmory() { catMap.get(cat).push({ item, score }); }); - // Keep top 5 per category, select the rest + // Keep top 10% per category (min 5), select the rest let selected = 0; catMap.forEach((list, cat) => { list.sort((a, b) => b.score - a.score); - const keep = list.slice(0, 5); - const dump = list.slice(5); + const keepCount = Math.max(5, Math.ceil(list.length * 0.10)); + const keep = list.slice(0, keepCount); + const dump = list.slice(keepCount); dump.forEach(({ item }) => { item.checkbox.checked = true; selected++; @@ -234,16 +235,16 @@ function enhanceArmory() { return selected; } - // ── Keep Top 5 button — available on sell and salvage screens ── + // ── Keep Top 10% button — available on sell and salvage screens ── if (screen === 'sell' || screen === 'salvage') { const b3 = document.createElement('input'); b3.type = 'button'; - b3.value = `⭐ Keep Top 5 / Select ${screen === 'sell' ? 'Sell' : 'Salvage'} Rest`; + b3.value = `⭐ Keep Top 10% / Select ${screen === 'sell' ? 'Sell' : 'Salvage'} Rest`; b3.style.cssText = 'padding:2px 6px;cursor:pointer;background:#7a5a2a;color:#fff;border:none;border-radius:3px;font-size:10px'; - b3.title = 'Keeps the 5 highest-scoring items in each category (1H, 2H, Staff, Shield, and each armor slot per Cloth/Light/Heavy). Selects everything else.'; + b3.title = 'Keeps the top 10% (min 5) highest-scoring items in each category (1H, 2H, Staff, Shield, and each armor slot per Cloth/Light/Heavy). Selects everything else.'; b3.onclick = () => { const n = keepTop5AndSelect(screen); - console.log(`%c[HV] ⭐ Keep Top 5: ${n} items selected for ${screen}`, 'color:#0f0'); + console.log(`%c[HV] ⭐ Keep Top 10%: ${n} items selected for ${screen}`, 'color:#0f0'); }; toolbar.appendChild(b3); } diff --git a/src/config.js b/src/config.js index 005be34..c5e3c89 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ // CONFIG — default settings // ═══════════════════════════════════════════════════════════════════════ -const VERSION = '0.15.0'; +const VERSION = '0.15.1'; const CFG = { // — Battle automation diff --git a/src/header.user.js b/src/header.user.js index 48779e3..ae472b3 100644 --- a/src/header.user.js +++ b/src/header.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name HV Unified // @namespace hvunified -// @version 0.15.0 +// @version 0.15.1 // @description HV Unified — battle automation, guidance, and UI enhancements for HentaiVerse // @author GaboGG + Hermes // @match *://*.hentaiverse.org/*