Cellcraft.io - Top Mass

ez

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Cellcraft.io - Top Mass
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  ez
// @author       Attack
// @match        https://cellcraft.io/
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        unsafeWindow
// @run-at       document-start
// @license MIT 
// ==/UserScript==

(() => {
    let topScore = 0;

    const fillText = CanvasRenderingContext2D.prototype.fillText,
          fpsBox = document.getElementById("fpsBox"),
          table = document.createElement("table"),
          tbody = document.createElement("tbody"),
          tr = document.createElement("tr");

    fpsBox.style.display = 'flex';
    fpsBox.appendChild(table);
    table.appendChild(tbody);
    tbody.appendChild(tr);

    const toValue = text => {
        return`${text}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
    }, refr = () => {
        tr.innerHTML = `<td>Top Mass:</td><td style="font-size: 14px; padding-left: 4px; color: #2d2;">${toValue(topScore)}</td>`;
    }, reset = () => {
        topScore = 0;
        refr();
    }, setserver = window.setserver;
    window.setserver = function(Wss, Title) {
        reset();
        return setserver(Wss, Title);
    };
    refr();

    CanvasRenderingContext2D.prototype.fillText = function(text) {
        const mass = String(text).match(/^Mass: (\d+)$/);

        fillText.apply(this, arguments);
        if(mass != null) {
            if(+mass[1] >= topScore) {
                topScore = +mass[1];
                refr();
            };
        };
    };
})();