[GC] Trading Post QoL

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

当前为 2024-09-07 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name [GC] Trading Post QoL
  3. // @namespace Masterofdarkness and hanso
  4. // @match https://www.grundos.cafe/island/tradingpost/*
  5. // @match https://grundos.cafe/island/tradingpost/*
  6. // @grant GM_setValue
  7. // @license MIT
  8. // @version 1
  9. // @author Masterofdarkness and hanso
  10. // @description Adds links to the static lot numbers and show how many active lots you currently have
  11. // @downloadURL
  12. // @updateURL
  13. // ==/UserScript==
  14.  
  15. //Regular TP Lots
  16. document.querySelectorAll('div.flex-column.small-gap span > 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>`});
  17.  
  18. //Your TP Lots
  19. document.querySelectorAll('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>`});
  20.  
  21. //Get Number of active lots
  22. let i = 0;
  23. document.querySelectorAll('div.trade-lot.flex-column.big-gap').forEach(trade => {i++});
  24.  
  25. //Print value of active lots out of 20
  26. let elements = document.querySelector('strong.center.bigfont')
  27. elements.textContent += ` (${i}/20)`;
  28.  
  29.  
  30.