[GC] Trading Post QoL

Adds links to the static lot numbers and show how many active lots you currently have

目前為 2024-09-07 提交的版本,檢視 最新版本

// ==UserScript==
// @name        [GC] Trading Post QoL
// @namespace   Masterofdarkness and hanso
// @match       https://www.grundos.cafe/island/tradingpost/*
// @match       https://grundos.cafe/island/tradingpost/*
// @icon        https://www.google.com/s2/favicons?sz=64&domain=grundos.cafe
// @grant       GM_setValue
// @license     MIT
// @version     1.1
// @author      Masterofdarkness and hanso
// @description Adds links to the static lot numbers and show how many active lots you currently have
// @downloadURL
// @updateURL
// ==/UserScript==

//Make static Lot#s clickable links
document.querySelectorAll('div.flex-column.small-gap span > strong, div.flex.space-between > strong').forEach(strong => {const m = strong.innerHTML.match(/Lot #(\d+)/);if(m)strong.innerHTML = `<a href="https://www.grundos.cafe/island/tradingpost/lot/${m[1]}">Lot #${m[1]}</a>`});

//Get Number of active lots
let i = 0;
document.querySelectorAll('div.trade-lot.flex-column.big-gap').forEach(trade => {i++});

//Print value of active lots out of 20
let elements = document.querySelector('strong.center.bigfont')
elements.textContent += ` (${i}/20)`;