[GC] - Protection Items Replenish Reminders

Backup alert in case you find yourself on the Quickstock page with less of each item than you like to keep in your inventory.

当前为 2024-02-11 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        [GC] - Protection Items Replenish Reminders
// @namespace   https://greasyfork.org/en/users/1225524-kaitlin
// @match       https://www.grundos.cafe/quickstock/*
// @grant       none
// @license     MIT
// @version     1
// @author      Cupkait
// @description Backup alert in case you find yourself on the Quickstock page with less of each item than you like to keep in your inventory.
// ==/UserScript==

//DISCLAIMER: This script does not claim to fully prevent you from running out and getting a negative effect as a result. 
// It **ONLY** checks to make sure you have your preferred minimums when you view the Quickstock page.

// Set your minimums by changing the numbers below.

// If your minimum is 1, you will be alerted at 0.
// If your minimum is 2, you will be alerted if you have 1 or less.
// Setting the minimum to 0 disables alerts for that item.

let pdaMinimum = 1;
let shieldMinimum = 0;
let obeliskMinimum = 0;
let slothMinimum = 0;
let dubloonMinimum = 0; //NOTE: This is the ITEM COUNT not dubloon value total.

//  BEGIN SCRIPT. Do not change text below this line unless you are familiar with scripts.
//  The only values you should edit to change your minimums are above.

const itemCounts = $('#qs-buttons').find('strong');
const counts = itemCounts.map(function() {
    return parseInt($(this).text(), 10);
}).get();

const [pdaCount, shieldCount, obeliskCount, slothCount, dubloonCount] = counts;

if (pdaCount < pdaMinimum) {
    alert("You're below your minimum number of Pant Devil Attractors, time to get more!");
}
if (shieldCount < shieldMinimum) {
    alert("You're below your minimum number of Shield Tokens, time to get more!");
}
if (obeliskCount < obeliskMinimum) {
    alert("You're below your minimum number of Obelisk of Dooms, time to get more!");
}
if (slothCount < slothMinimum) {
    alert("You're below your minimum number of Shiny Sloth Heads, time to get more!");
}
if (dubloonCount < dubloonMinimum) {
    alert("You're below your minimum number of Dubloons, check to make sure you have enough for Smugglers Cove!");
}