ANT Buffer Size

ANT Buffer Size Calculator

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        ANT Buffer Size
// @namespace   Violentmonkey Scripts
// @match       https://anthelion.me/*
// @version     1.2 (23/02/2024)
// @author      ANThusiast
// @description ANT Buffer Size Calculator
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    var targetLiId = 'stats_seeding';
    var targetLiLeechId = 'stats_leeching';
    var requiredRatio = 'stats_required';


    var targetLi = document.getElementById(targetLiId);
    var targetLiLeech = document.getElementById(targetLiLeechId);
    var targetLiRequiredRatio = document.getElementById(requiredRatio);

    if (targetLi) {
        var uploadValue = parseFloat(targetLi.querySelector('.stat.tooltip').textContent);
        var requiredRatioValue = parseFloat(targetLiRequiredRatio.querySelector('.stat.tooltip').textContent);
        var multiplierValue = (1 / requiredRatioValue);
        var bufferValue = (uploadValue * multiplierValue).toFixed(2);
        var bufferLi = document.createElement('li');
        bufferLi.innerHTML = '<a href="https://anthelion.me/wiki.php?action=article&name=ratio">Buffer</a>: <span class="stat tooltip">' + bufferValue + '</span> TiB';
        targetLiLeech.parentNode.insertBefore(bufferLi, targetLiLeech.nextSibling);
    }
})();