IdlePixel Noncify

Fix the username of the nonce, V2 includes message fixing!

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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         IdlePixel Noncify
// @namespace    com.zlef.idlepixel
// @version      2.0.0
// @description  Fix the username of the nonce, V2 includes message fixing!
// @author       Zlef
// @license      MIT
// @match        *://idle-pixel.com/login/play*
// @grant        none
// @require      https://greasyfork.org/scripts/441206-idlepixel/code/IdlePixel+.js?anticache=20220905
// ==/UserScript==

(function() {
    'use strict';

    class Noncify extends IdlePixelPlusPlugin {
        constructor() {
            super("noncify", {
                about: {
                    name: GM_info.script.name + " (ver: " + GM_info.script.version + ")",
                    version: GM_info.script.version,
                    author: GM_info.script.author,
                    description: GM_info.script.description
                }
            });


        }

        onChat(data) {
            if (data.username === "huay") {
                const chatArea = document.querySelector('#chat-area');
                const chatMessages = chatArea.querySelectorAll('div');

                chatMessages.forEach((msg) => {
                    const usernameSpan = msg.querySelector('.chat-username');
                    if (usernameSpan && usernameSpan.innerText === 'huay') {
                        usernameSpan.innerText = 'nonce';

                        const messagePart = msg.lastChild;
                        if (messagePart && messagePart.nodeValue) {
                            messagePart.nodeValue = ` ${String.fromCodePoint(128557)}${String.fromCodePoint(128557)}${String.fromCodePoint(128557)}`;
                        }
                    }
                });
            }
        }

    }

    const plugin = new Noncify();
    IdlePixelPlus.registerPlugin(plugin);

})();