您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds options to quickly-er batch select items in quick stock. Goes from the last item because that's how I roll. ONLY SELECTS. DOUBLE CHECK YOUR OWN INPUTS BEFORE HITTING SUBMIT!
当前为
// ==UserScript== // @name [Neopets] Select Last X Items (Quick Stock Helper) // @namespace https://gf.qytechs.cn/en/scripts/447331 // @version 0.3 // @description Adds options to quickly-er batch select items in quick stock. Goes from the last item because that's how I roll. ONLY SELECTS. DOUBLE CHECK YOUR OWN INPUTS BEFORE HITTING SUBMIT! // @author Piotr Kardovsky // @match http*://www.neopets.com/quickstock.phtml* // @icon https://www.neopets.com//favicon.ico // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const actions = ["Stock", "Deposit", "Donate", "Discard", "Gallery", "Closet", "Shed"]; // Default amount. Simple enuff. const DEFAULT_AMOUNT = 10; // Default action. You can either use actions[x] where x = a number from 0 to 6, OR: // Choose 1 of the following. Make sure they're still in the quotes. // "Stock", "Deposit", "Donate", "Discard", "Gallery", "Closet", "Shed" const DEFAULT_ACTION = actions[1]; window.addEventListener('load', () => { let qs = document.querySelector('form[name="quickstock"] table'); // 3 is "magic", the header + check all + submit count as rows let items = qs.rows.length > 20 + 3 ? qs.rows.length - Math.max(1,Math.floor(qs.rows.length/20)) - 2 : qs.rows.length - 3; // Amount let num = document.createElement('input'); num.type = 'number'; num.min = 0; num.max = items; num.value = DEFAULT_AMOUNT; num.style.width = '38px'; num.style.height = '22px'; // Action let sty = document.createElement('select'); sty.style.height = '28px'; actions.forEach((i) => { let o = document.createElement('option'); o.text = i; sty.add(o); }); sty.value = DEFAULT_ACTION; // Button let dpb = document.createElement('button'); dpb.innerText = 'Select!'; dpb.style.height = '28px'; dpb.addEventListener('click', (e) => { e.preventDefault(); document.querySelector('form[name="quickstock"]').reset(); if (parseInt(num.value) > parseInt(num.max)) num.value = num.max; for (let i = items; i > items - num.value; i--) { let itm = document.querySelector(`input[name^="radio_arr[${i}]"][value="${sty.value.toLowerCase()}"]`); if (itm != null && itm != undefined) { if (itm.checked == false) itm.checked = true; } } //console.log(num.value, items, qs.rows.length); // just debug things. }); let container = document.createElement('div'); let ic = document.createElement('span'); ic.innerText = `${items} items.` container.classList.add('qsdc'); container.innerHTML = "<strong>Select last: </strong>" container.append(num, sty, dpb, document.createElement('br'), ic); document.querySelector('.content').append(container); }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址