Ping mod

Displays ping on moomoo.io, ensuring pingDisplay appears on screen

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Ping  mod
// @namespace    http://tampermonkey.net/
// @version      1.4
// @description  Displays ping on moomoo.io, ensuring pingDisplay appears on screen
// @author       Guilherme
// @match        *://moomoo.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to remove the "hidden" and ensure the pingDisplay is displayed
    function showPing() {
        let pingElement = document.getElementById('pingDisplay');

        if (pingElement) {
            // Remove any styling that may be hiding the element
            pingElement.removeAttribute('hidden');  // Remove "hidden"
            pingElement.style.display = 'block';    // Make sure it is visible
            pingElement.style.visibility = 'visible'; // Force visibility
            pingElement.style.opacity = '1';        // Make sure it's not invisible

            // Define visual styles
            pingElement.style.position = 'absolute';
            pingElement.style.top = '10px';
            pingElement.style.left = '10px';
            pingElement.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
            pingElement.style.color = 'white';
            pingElement.style.padding = '5px';
            pingElement.style.borderRadius = '5px';
            pingElement.style.zIndex = '9999';      // Ensures it is above other elements
            pingElement.style.fontSize = '16px';    // Set the font size
            pingElement.style.fontFamily = 'Arial, sans-serif'; // Clean font
            pingElement.style.width = 'auto';       //Adjusts the width to the content
            pingElement.style.textAlign = 'center'; // Center the text

            console.log('Ping exibido corretamente!');
        } else {
            console.log('Elemento de ping não encontrado.');
        }
    }

    // Checks and displays ping immediately after page load
    window.onload = function() {
        showPing();
    };
})();