PC indicator

Indicates what kind of PC you are on

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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

})();