Gota Team INV spam script

Spam team invites to players

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Gota Team INV spam script
// @namespace    http://tampermonkey.net/
// @version      2024/12/25
// @description  Spam team invites to players
// @author       GotaWala
// @match        https://gota.io/web/
// @icon         https://i.ytimg.com/vi/sN2Sh-RpOeM/maxresdefault.jpg
// @grant        none
// @require      http://code.jquery.com/jquery-3.4.1.min.js
// *************************************************************************************************
// *************************************************************************************************
// Press Ctrl+Y to pause sending invites
// Press Ctrl+M to continue sending invites
// *************************************************************************************************
// *************************************************************************************************
// ==/UserScript==
var sendMoreInv = true;
(function() {
    'use strict';

    // Your code here...

    if (window.location.href ==='https://gota.io/web/'){
        const targetNode = document.getElementById("chat-body-0");
        const config = { childList: true };
        const callback = (mutationList, observer) => {
            for (const mutation of mutationList) {
                const e = mutation.addedNodes[0];
                const chatName = $(e).find('.chat-name');
                const teamCanvas = $('#party-panel').find('canvas');
                if(teamCanvas && teamCanvas[0] && teamCanvas[0].height<230){
                    if(chatName.length>0 && sendMoreInv){
                        //right click on selected user
                        chatName[0].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'

                        console.log('Sent Invite to '+ chatName.attr('data-player-id') + ' ' + chatName.text());
                    }
                }
            }
        }
        const observer = new MutationObserver(callback);
        observer.observe(targetNode, config);
    }
    document.addEventListener('keydown', function(event) {
    // Check if the key combination Ctrl + Y is pressed
    if (event.ctrlKey && event.key === 'y') {
        // Prevent default browser action if necessary
        event.preventDefault();
        sendMoreInv = false;
        console.log('Stopping automatic team invites.....')
    }
    else if(event.ctrlKey && event.key ==='m'){
        event.preventDefault();
        sendMoreInv = true;
        console.log('Starting automatic team invites!')
    }
});
}
)();