TagPro Deciseconds

Show tenths of seconds in the timer, optionally only near the end of the game.

Εγκατάσταση αυτού του κώδικαΒοήθεια
Κώδικας προτεινόμενος από τον δημιιουργό

Μπορεί, επίσης, να σας αρέσει ο κώδικας TagPro RL Chat.

Εγκατάσταση αυτού του κώδικα

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

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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         TagPro Deciseconds
// @description  Show tenths of seconds in the timer, optionally only near the end of the game.
// @author       Ko
// @version      1.1
// @supportURL   https://www.reddit.com/message/compose/?to=Wilcooo
// @website      https://redd.it/7xatec
// @include      http://tagpro-*.koalabeast.com:*
// @include      http://tangent.jukejuice.com:*
// @include      http://*.newcompte.fr:*
// @include      http://tagpro-*.koalabeast.com/game
// @include      http://tangent.jukejuice.com/game
// @include      http://*.newcompte.fr/game
// @namespace https://greasyfork.org/users/152992
// ==/UserScript==



// This script is inspired by the 'TagPro Milliseconds' script by 'Some Ball -1' (which didn't seem to work anymore)
// It is compatible with the 'End of Game Timer' by 'Some Ball -1', and should be compatible with any aesthetic script.



// OPTIONS:

const startTime = 0; // The gametime (in seconds) when to start showing deciseconds.
                     // Set it to 0 to always show the exact time

const leadingZero = true;  // By default, TagPro shows the time like this:        03:09
                           // Change this option to 'false' to make it look like:  3:09



tagpro.ready(function(){

    var org_timer = tagpro.ui.timer;

    tagpro.ui.timer = function( con, pos, size, text ) {

        if (tagpro.state == 1) {

            var time = tagpro.gameEndsAt - Date.now();

            var minut = ( (leadingZero ? "00" : "") + Math.floor(time/6e4) ).slice(-2),
                secon = ( "00" + Math.floor(time%6e4/1e3) ).slice(-2);

            if ( startTime <= 0 || time < startTime * 1e3 ) {
                var decis = Math.floor(time % 1e3 / 1e2);
                text = [minut, secon, decis].join(':');
            }

            else text = [minut, secon].join(':');
        }

        return org_timer(...arguments);
    };
});