PC indicator

Indicates what kind of PC you are on

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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")
//}
    });

})();