您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Improves the foreign aid page.
当前为
// ==UserScript== // @name Better foreign aid for Cyber Nations // @namespace http://tampermonkey.net/ // @version 1.3 // @description Improves the foreign aid page. // @author RandomNoobster // @match https://www.cybernations.net/aid_information.asp* // @icon https://www.google.com/s2/favicons?domain=cybernations.net // @license MIT // @grant none // ==/UserScript== (function() { 'use strict'; let myNation = document.querySelectorAll('[data-popupmenu="popmenu3"]')[0]; let str = myNation.baseURI; let myID = str.substring(str.indexOf('=') + 1); let aidNations = document.querySelectorAll("table form table a"); let nationIDs = []; aidNations.forEach(aidNation => { var theirID = aidNation.href.substring(aidNation.href.indexOf('=') + 1); if (theirID === myID) { //pass } else if (aidNation.href.includes("nation_drill")) { aidNation.href = "https://www.cybernations.net/aid_form.asp?Nation_ID=" + theirID + "&bynation=" + myID; if (!nationIDs.includes(theirID)) { nationIDs.push(theirID); } } }); let rows = document.querySelectorAll('[valign="middle"][align="center"]'); rows.forEach(row => { if (!row.innerHTML.includes("Expired")) { nationIDs.slice().forEach(item => { if (row.innerHTML.includes(item)) { console.log(item) nationIDs.splice(nationIDs.indexOf(item), 1); } }); } else { let found = false; nationIDs.slice().forEach(item => { if (row.innerHTML.includes(item)) { found = true; } }); if (found) { row.style.backgroundColor = "#f6ff00"; } } }); })();