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.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

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

})();