v0.15.1 - Keep Top 10% (min 5) instead of fixed 5

- 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)
This commit is contained in:
GaboGG 2026-07-31 14:28:17 -04:00
parent 1c14e9b2a4
commit b59da5544a
5 changed files with 30 additions and 27 deletions

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

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

View file

@ -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/*