Gota INV script

Script to send team invite to players by a single click. Just click on any profile on the chat window to send the invite.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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         Gota INV script
// @namespace    http://tampermonkey.net/
// @version      2024-06-24
// @description  Script to send team invite to players by a single click. Just click on any profile on the chat window to send the invite.
// @author       GotaWala
// @match        https://gota.io/web/
// @icon         https://image.pngaaa.com/756/5740756-middle.png
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    if (window.location.href ==='https://gota.io/web/'){
        // container element for chat box
        let chatContainer = document.getElementById('chat-container')
        document.addEventListener('click',(e)=>{
            // check if the click happened inside the chat container
            if(chatContainer.contains(e.target)){
                //right click on selected user
                e.target.dispatchEvent(new MouseEvent("contextmenu"));
                //click 'inv' on context menu
                document.getElementById('menu-invite').dispatchEvent(new MouseEvent("click"));
                //hide context menu
                document.getElementById('context-menu').style.display='none'}
        })
}

})();