Gats.io right click for spacebar

This script allows you to use your right click for the abilities you usually use with spacebar. However it wont work for shield yet (working on it).

Versão de: 15/09/2022. Veja: a última versão.

// ==UserScript==
// @name         Gats.io right click for spacebar
// @version      2.0.6.10
// @description  This script allows you to use your right click for the abilities you usually use with spacebar. However it wont work for shield yet (working on it).
// @author       Rayan223
// @match        https://gats.io
// @icon         none
// @grant        none
// @license MIT
// @namespace https://greasyforks.org/users/825882
// ==/UserScript==

let canvas = document.getDocumentById('canvas');



var rightClick = 0;
var unRightClick = 0;

var loaded = 0;
document.addEventListener('DOMContentLoaded', function(event) {
    loaded = 1;
});

document.addEventListener('mousedown', function(event){
    canvas.width = "726";
    console.log("clic123");
    if(event.which== 2){
        console.log("clic");
    }
});

document.addEventListener('mouseup', function(event){
    console.log("unclic123");
    if(event.which== 2){
        console.log("unclic");
    }
});

document.body.onmousedown = function(e) {
    if (e.button == 2) {
        ++rightClick;
        click();
        console.log("clic");
    }
};

document.body.onmouseup = function(e) {
    if (e.button == 2) {
        --rightClick;
        ++unRightClick;
        click();
        console.log("unclic");
    }
};

function click() {
    if(loaded == 0){
        return;
    }
    if(rightClick == 1){
        RF.list[0].socket.send('k,5,1');
    }
    if (unRightClick == 1){
        RF.list[0].socket.send('k,5,0');
        --unRightClick;
    }
    
}
    
//window.oncontextmenu = function ()
//{
//    dash();
//    setTimeout(afterdash,50);
//    return false;
//}

//function dash(){
//    RF.list[0].socket.send('k,5,1');
//}

//function afterdash(){
//    RF.list[0].socket.send('k,5,0');
//}
长期地址
遇到问题?请前往 GitHub 提 Issues。