您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
description
当前为
// ==UserScript== // @name Faction Challenge Totals // @namespace namespace // @version 0.6 // @description description // @author tos // @grant GM_setClipboard // @match *.torn.com/factions.php* // ==/UserScript== $(document).ajaxComplete((event, jqXHR, ajaxObj) => { if (ajaxObj.data && ajaxObj.data.includes('step=upgradeConfirm')) { const resp = JSON.parse(jqXHR.responseText) console.log(resp) let challenge_total = 0 if (resp.contributors) { let clipboard = 'User ID\tName\t'+ resp.upgrade.icon +'\n' for (const group of resp.contributors) { for (const member of Object.keys(group)) { challenge_total += parseInt(group[member].total.replace(',', '')) clipboard += group[member].userid + '\t' clipboard += group[member].playername + '\t' clipboard += group[member].total.replace(',', '') + '\t' clipboard += '\n' } } document.querySelector('#stu-confirmation .buttons-wrap').insertAdjacentHTML('beforeend', `<div class="name">Challenge Total: ${numberWithCommas(challenge_total)}</div>`) document.querySelector('#stu-confirmation .buttons-wrap').insertAdjacentHTML('beforeend', `<div class="buttons"><span class="name link">Copy to clipboard</span></div>`) document.querySelector('#stu-confirmation .buttons-wrap .name.link').addEventListener('click', () => {GM_setClipboard (clipboard)}) } } }) function numberWithCommas(x) { var parts = x.toString().split("."); return parts[0].replace(/\B(?=(\d{3})+(?=$))/g, ",") + (parts[1] ? "." + parts[1] : ""); }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址