您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
..
// ==UserScript== // @name Total Skill at Player Page // @namespace http://tampermonkey.net/ // @version 2024-07-09 // @description .. // @author Ngã Ba Ông Tạ Sài Gòn // @match https://sokker.org/player/PID/* // @icon https://www.google.com/s2/favicons?sz=64&domain=sokker.org // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to calculate total skill function calculateTotalSkill() { // Select the table containing skills const table = document.querySelector('.table-skills'); if (!table) { console.error('Table with class "table-skills" not found.'); return; } let totalSkill = 0; // Select all rows in the table body const rows = table.querySelectorAll('tbody tr'); // Iterate through each row rows.forEach(row => { // Select both td elements in the row const tds = row.querySelectorAll('td'); // Iterate through each td to find the skill number tds.forEach(td => { // Find the skill number span within each td const skillNumberSpan = td.querySelector('.skillNameNumber'); if (skillNumberSpan) { // Extract the skill number from the span text const skillNumberText = skillNumberSpan.textContent.trim(); // Extract the number within brackets const skillNumber = parseInt(skillNumberText.match(/\[(\d+)\]/)[1]); // Add the skill number to the total skill if (!isNaN(skillNumber)) { totalSkill += skillNumber; } } }); }); // Create a new row to display the total skill const totalRow = document.createElement('tr'); totalRow.innerHTML = `<td colspan="2"><strong>Total Skill:</strong> ${totalSkill}</td>`; // Append the total row to the table body const tbody = table.querySelector('tbody'); tbody.appendChild(totalRow); } // Run the function when the page is fully loaded window.addEventListener('load', calculateTotalSkill); })();