PC indicator

Indicates what kind of PC you are on

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         PC indicator
// @namespace    http://tampermonkey.net/
// @version      0.2.5
// @description  Indicates what kind of PC you are on
// @author       meppydc
// @match        https://*.jstris.jezevec10.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    window.addEventListener('load', function(){
    //if (~window.location.href.indexOf("play=8")) {


        $("<div class='formulaElement' id='lrem' style='display:none'>1st</div>").insertBefore("#lrem");


        if(typeof trim != "function"){var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}}
        if(typeof getParams != "function"){var getParams=a=>{var params=a.slice(a.indexOf("(")+1);params=params.substr(0,params.indexOf(")")).split(",");return params}}

        function afterFunction() {
            //(p + 4*((10×p - b)/5)+1) mod 7
            if(this['PCdata']['blocks'] == 0) {
                let suffixes = ['th','st','nd','rd','th','th','th','th']
                pcs = parseInt(this['lrem']['textContent'])
                pcNumber = ((pcs + 1 + 3*((10*pcs - this['placedBlocks'])/5)) % 7) || 7
                $(".formulaElement")[0].innerHTML = pcNumber + suffixes[pcNumber];

            }
        };

        function beforeReadyGoFunction() {
            //console.log("ready go function run")
            //console.log(this['pmode'])
            if (this['pmode'] == 8) {
                    $(".formulaElement")[0].style.display = "block"
                } else {
                       $(".formulaElement")[0].style.display = "none"
                }
            $(".formulaElement")[0].innerHTML = "1st";
        }

    var placeBlockFunc = Game['prototype']["placeBlock"].toString()
    var params2 = getParams(placeBlockFunc)
    placeBlockFunc =  trim(placeBlockFunc) + trim(afterFunction.toString())
    Game['prototype']["placeBlock"] = new Function(...params2, placeBlockFunc);

    var readyGoFunc = Game['prototype']['startPractice'].toString()
    var params3 = getParams(readyGoFunc)
    readyGoFunc =  trim(readyGoFunc) + trim(beforeReadyGoFunction.toString())
    Game['prototype']['startPractice'] = new Function(...params3, readyGoFunc);
    //console.log("end of script")
//}
    });

})();