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).

当前为 2022-09-16 提交的版本,查看 最新版本

// ==UserScript==
// @name         Gats.io right click for spacebar
// @version      2.0.10.3
// @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==

var play = 0

function checkPlaying() {
    var menu = document.getElementById('slct');
    if (menu.style == "display: none;"){
        document.getElementById('canvas').width = 886
        play = 1
    }else{
        document.getElementById('canvas').width = 884
        play = 0
    }
    setTimeout(checkPlaying,100)
}

document.addEventListener('mousedown', function(event){
    if (play == 1){
        if(event.which == 2){
            RF.list[0].socket.send('k,5,1');
        }
    }
});

document.addEventListener('mouseup', function(event){
    if (play == 1){
        if(event.which == 2){
            RF.list[0].socket.send('k,5,0');
        }
    }
});

checkPlaying()
    
//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。