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.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==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'}
        })
}

})();