您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Sum of attribute
// ==UserScript== // @name Sum of skills at transfer search // @namespace http://tampermonkey.net/ // @version 2024-07-09 // @description Sum of attribute // @author Ngã Ba Ông Tạ Sài Gòn // @match https://sokker.org/transferSearch/* // @icon https://www.google.com/s2/favicons?sz=64&domain=sokker.org // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; function sumSkillNumbersPerPlayer() { // Select all player containers let players = document.querySelectorAll('#playerCell'); players.forEach(player => { console.log("Each player"); let totalSum = 0; // Select all skill number spans within this player container let skillNumbers = player.querySelectorAll('.skillNameNumber'); skillNumbers.forEach(span => { let number = parseInt(span.textContent.replace(/[^\d]/g, '')); totalSum += isNaN(number) ? 0 : number; }); // Create a new row to display the total sum let newRow = document.createElement('tr'); newRow.innerHTML = `<td colspan="2"><strong>Total Skills: ${totalSum}</strong></td>`; // Append the new row to the player's skills table let table = player.querySelector('table.table-skills tbody'); if (table) { table.appendChild(newRow); } }); } // Run the function when the page is fully loaded window.addEventListener('load', sumSkillNumbersPerPlayer); })();