Gats.io right click for spacebar (07/2025)

Now working ability to press the right click in order to use the spacebar. Now also works for shield!

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Gats.io right click for spacebar (07/2025)
// @version      2.5
// @description  Now working ability to press the right click in order to use the spacebar. Now also works for shield!
// @author       Rayan223
// @match        https://gats.io
// @icon         none
// @grant        none
// @license MIT
// @namespace https://greasyfork.org/users/825882
// ==/UserScript==

function playing() {
    var menu = document.getElementById('slct');
    if (menu.className == "container"){
        return false
    }else{
        return true
    }
};

document.addEventListener('mousedown', e => {
    if(playing() && event.which == 3){
        Connection.list[0].socket.send('k,5,1');
    }
});

document.addEventListener('mouseup', e => {
    if(playing() && event.which == 3){
        Connection.list[0].socket.send('k,5,0');
    }
});