JK Steam

这个世界上又双叒叕多了一个盗版Steam(喜)

当前为 2024-08-16 提交的版本,查看 最新版本

// ==UserScript==
// @name         JK Steam
// @namespace    http://tampermonkey.net/
// @version      1.1.1-beta-0
// @description  这个世界上又双叒叕多了一个盗版Steam(喜)
// @author       Debug618, Snoozing_QwQ
// @match        http://noip.ac.cn/*
// @match        http://www.noip.ac.cn/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=www.noip.ac.cn
// @grant        none
// @license      GPL-3.0
// ==/UserScript==

function sleep(time) {
    return new Promise((resolve) => setTimeout(resolve, time));
}

(async function () {
    let url = location.href;
    let mode = null;

    const matches = {
        "^http://*": "defalt",
        "^http://*.noip.ac.cn/": "index",
        "^http://*.noip.ac.cn": "index",
        "^http://*.noip.ac.cn/ranking*": "rank",
        "^http://*.noip.ac.cn/record*": "record",
        "^http://*.noip.ac.cn/record?uidOrName=?": "record",
        "^http://*noip.ac.cn/record/*": "record_",
        "^http://*.noip.ac.cn/homework*": "homework",
        "^http://*.noip.ac.cn/p/*": "problem",
        "^http://*.noip.ac.cn/discuss*": "discuss"
    };
    for (let e of Object.keys(matches)) {
        if (new RegExp(e).test(url)) mode = matches[e];
    }
    console.log('Now at ' + mode);
    let a = document.getElementsByClassName('nav__item');
    for (let i = 0; i < a.length; i++) {
        if (~a[i].innerHTML.search('首页')) a[i].innerHTML = '家';
        else if (~a[i].innerHTML.search('题库')) a[i].innerHTML = '库';
        else if (~a[i].innerHTML.search('训练')) a[i].innerHTML = '练习';
        else if (~a[i].innerHTML.search('比赛')) a[i].innerHTML = '电竞';
        else if (~a[i].innerHTML.search('作业')) a[i].innerHTML = '任务';
        else if (~a[i].innerHTML.search('讨论')) a[i].innerHTML = '论坛';
        else if (~a[i].innerHTML.search('评测记录')) a[i].innerHTML = '游玩记录';
        else if (~a[i].innerHTML.search('排名')) a[i].innerHTML = '排行榜';
    }
    a = document.getElementsByClassName('section__title');
    for (let i = 0; i < a.length; i++) {
        if (~a[i].innerHTML.search('首页')) a[i].innerHTML = '家';
        else if (~a[i].innerHTML.search('题库')) a[i].innerHTML = '库';
        else if (~a[i].innerHTML.search('训练')) a[i].innerHTML = '练习';
        else if (~a[i].innerHTML.search('比赛')) a[i].innerHTML = '电竞';
        else if (~a[i].innerHTML.search('作业')) a[i].innerHTML = '任务';
        else if (~a[i].innerHTML.search('讨论')) a[i].innerHTML = '论坛';
        else if (~a[i].innerHTML.search('评测记录')) a[i].innerHTML = '游玩记录';
        else if (~a[i].innerHTML.search('排名')) a[i].innerHTML = '排行榜';
    }
    let navlistitem = document.getElementsByClassName('nav__list-item');
    navlistitem[0].innerHTML = '<a href="/"><img src="https://store.cdn.queniuqe.com/public/shared/images/header/logo_steam.svg?t=962016" width="176" height="44"></a>';
    navlistitem[1].href = 'https://store.steampowered.com';
    let typoa = document.getElementsByClassName("typo-a"), sectiontitle = document.getElementsByClassName("section__title");
    if (mode == "index") {
        let div = document.getElementsByClassName("section__body typo richmedia");
        div[0].innerHTML = '\n      <h2 id="%E8%AF%B7%E5%90%8C%E5%AD%A6%E4%BB%AC%E6%8A%84%E9%A2%98%E8%A7%A3-%EF%BC%8C%E6%AD%A4%E7%A7%8D%E8%A1%8C%E4%B8%BA%E8%A2%AB%E5%8F%91%E7%8E%B0%E5%90%8E%E4%BC%9A%E8%AD%A6%E5%91%8A%EF%BC%9B" tabindex="-1">请同学们<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mstyle mathcolor="red"><mtext>要</mtext></mstyle></mrow><annotation encoding="application/x-tex">\\color{red}{要}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord" style="color:red;"><span class="mord cjk_fallback" style="color:red;">要</span></span></span></span></span>抄题解 ,此种行为被发现后会<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mstyle mathcolor="purple"><mtext>超级管理员</mtext></mstyle></mrow><annotation encoding="application/x-tex">\\color{purple}{超级管理员}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord" style="color:brown;"><span class="mord cjk_fallback" style="color:purple;">超级管理员</span></span></span></span></span>奖励;<h2 id="%E8%AF%B7%E5%90%8C%E5%AD%A6%E4%BB%AC%E5%B0%8A%E9%87%8D%EF%BC%8C%E5%9C%A8%E6%AF%94%E8%B5%9B%E6%9C%9F%E9%97%B4%E5%B0%86%E4%BB%A3%E7%A0%81%E5%88%86%E4%BA%AB%E7%BB%99%E5%85%B6%E4%BB%96%E4%BA%BA%E3%80%82" tabindex="-1">请同学们尊重<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mstyle mathcolor="red"><mtext>抄袭</mtext></mstyle></mrow><annotation encoding="application/x-tex">\\color{red}{抄袭}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord" style="color:red;"><span class="mord cjk_fallback" style="color:red;">抄袭</span></span></span></span></span>,<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mstyle mathcolor="red"><mtext>要</mtext></mstyle></mrow><annotation encoding="application/x-tex">\\color{red}{要}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord" style="color:red;"><span class="mord cjk_fallback" style="color:red;">要</span></span></span></span></span>在比赛期间将代码分享给其他人。</h2>\n<h3 id="%E8%AE%AD%E7%BB%83%E8%90%A5%EF%BC%9A%E7%AE%97%E6%B3%95%E5%B7%A9%E5%9B%BA" tabindex="-1"><a href="http://noip.ac.cn/d/contest/">训练营:算法巩固</a></h3>\n<h3 id="%E6%9C%AC%E7%AB%99%E8%BF%9C%E7%A8%8B%E8%AF%84%E6%B5%8B%E5%9F%9F%EF%BC%9Acodeforces-hduoj-poj-yacs-bzoj-uoj-spoj" tabindex="-1"><strong>本站远程评测域:</strong><a href="http://noip.ac.cn/d/codeforces/">Codeforces</a> <a href="http://noip.ac.cn/d/hduoj/">hduoj</a> <a href="http://noip.ac.cn/d/poj/">POJ</a> <a href="http://noip.ac.cn/d/yacs/">YACS</a> <a href="http://noip.ac.cn/d/bzoj/">BZOJ</a> <a href="http://noip.ac.cn/d/uoj/">UOJ</a> <a href="http://noip.ac.cn/d/spoj/">SPOJ</a></h3>\n<h2 id="%E6%AF%94%E8%B5%9B%E5%BB%BA%E8%AE%AE%EF%BC%9A" tabindex="-1">比赛建议:</h2>\n<h3 id="yacs-%E4%B8%8A%E6%B5%B7%E6%9C%88%E8%B5%9B" tabindex="-1"><strong><a href="http://www.iai.sh.cn/contest">YACS 上海月赛</a></strong></h3>\n<p>每月一次,线上比赛,比赛开放期间内时间时间段都可参加。有民间题解。\n初学也可参加,建议初学阶段每月参加丙组。\n可做该网站题单的<a href="http://www.iai.sh.cn/study">星级挑战</a>练习。</p>\n<h3 id="%E6%B4%9B%E8%B0%B7%E6%9C%88%E8%B5%9B" tabindex="-1"><strong><a href="https://www.luogu.com.cn/contest/list">洛谷月赛</a></strong></h3>\n<p>点击洛谷左边栏框比赛模块,每个比赛介绍都有标记难度,选择难度符合自己水准的参加</p>\n<h3 id="%E7%89%9B%E5%AE%A2%E7%AB%9E%E8%B5%9B" tabindex="-1"><strong><a href="https://ac.nowcoder.com/acm/contest/vip-index">牛客竞赛</a></strong></h3>\n<p>比赛比较多,题目质量不错,普及组同学可参加小白月赛和牛客周赛,提高组参加牛客练习赛及其他比赛</p>\n<h3 id="codeforces-%E5%85%A8%E7%90%83%E6%9C%80%E5%BC%BA%E7%AE%97%E6%B3%95%E7%AB%9E%E8%B5%9B%E5%B9%B3%E5%8F%B0" tabindex="-1"><strong><a href="http://codeforces.com/">codeforces-全球最强算法竞赛平台</a></strong></h3>\n<p>基本每周都有面向全球的线上比赛。全球排名,刺激独特的cf赛制以及hack机制。纯英文,后期训练必备。<a href="https://www.luogu.com.cn/blog/ezoixx130/codeforces-tutorial">cf入门指南</a>\n<a href="https://hcfy.app/docs/install">小绿书使用教程(下载离线包安装,较复杂。装个JEI等等也可以。)</a></p>\n<h3 id="atcdoer(%E5%8F%97%E4%B8%8D%E4%BA%86cf%E6%97%B6%E5%B7%AE%E7%9A%84%E5%8F%AF%E4%BB%A5%E6%89%93%E8%BF%99%E4%B8%AA%2C%E6%AF%8F%E5%91%A8%E6%9C%AB%E5%9B%BA%E5%AE%9A%E6%97%B6%E9%97%B4%E6%9C%89%E5%85%A5%E9%97%A8%E5%9C%BA)" tabindex="-1"><a href="https://atcoder.jp/contests/">AtCdoer(受不了cf时差的可以打这个,每周末固定时间有入门场)</a></h3>\n<p><a href="https://www.luogu.com.cn/blog/chengni5673/atcoder-si-yong-gong-lve">atcoder指南</a></p>\n<h2 id="%E7%9F%A5%E8%AF%86%E7%82%B9%E8%A1%A5%E5%85%85%EF%BC%9A%E6%B4%9B%E8%B0%B7%E6%97%A5%E6%8A%A5-oi-wiki" tabindex="-1"><strong>知识点补充</strong>:<a href="https://www.craft.do/s/N0l80k2gv46Psq">洛谷日报</a>                 <a href="https://oi-wiki.org/">电竞 Wiki</a></h2>\n<hr>\n<p><a href="https://ltcat.lanzoui.com/b0aj6gsid">下载启动器1点击这里(验证码PCL2)</a>  <a href="https://github.com/luogu-dev/cyaron">出题数据生成工具</a>\n<a href="http://noip.ac.cn/file/2/PalmInput_Setup.exe">输入法</a>\n<a href="https://hmcl.huangyuhui.net/">下载启动器2点击这里</a>\n<a href="http://noip.ac.cn/file/2/0A%E6%B2%B9%E7%8C%B4%E6%8F%92%E4%BB%B6.zip">youhou</a></p>\n\n';
        sectiontitle[6].innerHTML = '最新练习赛';
        sectiontitle[9].innerHTML = 'Steam';
        typoa[27].innerHTML = '电竞erDb';
        typoa[27].href = 'https://www.discord.com/';
    }
    if (mode == "discuss") {
        sectiontitle[3].innerHTML = 'Steam';
    }
    if (mode == "discuss" || mode == "index") {
        console.log(mode);
        typoa[1].innerHTML = '启动';
        typoa[1].href = 'http://8.130.79.89:56789/';
        typoa[2].innerHTML = 'Steam上的网页游戏';
        typoa[2].href = 'https://store.steampowered.com';
        typoa[6].innerHTML = '技巧';
        typoa[6].href = 'https://www.bilibili.com/vedio/BV1GJ411x7h7';
        typoa[7].innerHTML = '游戏讨论专区'
        typoa[7].href = 'https://store.steampowered.com/?l=schinese&area=forums%22';
        typoa[8].innerHTML = '快速上分'
        typoa[8].href = 'https://hypixel.net';
        typoa[9].innerHTML = 'Steam';
        typoa[9].href = 'http://8.130.79.89:55674/';
    }
    if (mode == "rank") {
        document.getElementsByClassName("col--rp")[1].innerHTML = '积分';
        document.getElementsByClassName("col--detail rp-problem")[1].innerHTML = '练习';
        document.getElementsByClassName("col--ac")[1].innerHTML = '胜利';
        let ranking = Array.from({ length: 10 }, (v, i) => document.getElementsByClassName(`user-profile-badge v-center badge--lv${i + 1}`));
        let name_ = ["原木", "圆石", "铜锭", "红石", "铁锭", "金锭", "钻石", "黑曜石", "合金", "基岩"];
        for (let i = 0; i < 10; i++) {
            for (let j = ranking[i].length - 1; j >= 0; j--) {
                ranking[i][j].innerHTML = name_[i];
                ranking[i][j].dataset.tooltip = name_[i] + ranking[i][j].dataset.tooltip.substr(ranking[i][j].dataset.tooltip.search(":"), ranking[i][j].dataset.tooltip.length - ranking[i][j].dataset.tooltip.search(":"));
            }
        }
    } else if (mode == "record_") {
        let title_status = document.getElementsByClassName("section__title")[0];
        if (title_status.innerHTML == '\n      <span class="icon record-status--icon fail"></span>\n            <span style="color: #ff4f4f">0</span>\n            <span class="record-status--text fail">\n        Compile Error\n      </span>\n    ') title_sta
    }
    if (mode == "record" || mode == "record_") {
        let accepted = document.getElementsByClassName("record-status--text pass");
        let fail = document.getElementsByClassName("record-status--text fail");
        let lang = document.getElementsByClassName("col--lang");
        document.getElementsByClassName("col--problem")[1].innerHTML = '练习赛名称';
        document.getElementsByClassName("col--submit-by")[1].innerHTML = '游玩者';
        document.getElementsByClassName("col--lang")[1].innerHTML = '服务端版本';
        document.getElementsByClassName("col--time")[1].innerHTML = '游玩时长';
        document.getElementsByClassName("col--memory")[1].innerHTML = '占用内存';
        document.getElementsByClassName("col--submit-at")[1].innerHTML = '游玩时间';
        while (1) {
            for (let i = 0; i < accepted.length; i++) accepted[i].innerHTML = '\n            <span style="color: #25ad40">冠军!!!</span>\n\n    ';
            for (let i = 0; i < fail.length; i++) {
                if (fail[i].innerHTML.search("Wrong Answer") != -1) fail[i].innerHTML = "\n失败,评分:" + fail[i].innerHTML.substr(0, fail[i].innerHTML.search("Wrong Answer"));
                if (fail[i].innerHTML.search("Compile Error") != -1) fail[i].innerHTML = "\n文件缺失";
                if (fail[i].innerHTML.search("Time Exceeded") != -1) fail[i].innerHTML = "\n连接超时";
                if (fail[i].innerHTML.search("System Error") != -1) fail[i].innerHTML = "\n连接错误";
            }
            for (let i = 3; i < lang.length; i++) {
                if (lang[i].innerHTML.search("C+") != -1) lang[i].innerHTML = lang[i].innerHTML.slice(0, lang[i].innerHTML.search("C+")) + "Steam" + lang[i].innerHTML.slice(lang[i].innerHTML.search("C+") + 3, lang[i].innerHTML.length);
            }
            await sleep(50);
        }
    }
})();