您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Warning! This script is currently under testing, it could not work correctly until it is realesed. 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). In the future I also plan on reworking it to configure entirely the keybinds to be customizable
当前为
// ==UserScript== // @name [in beta-testing] Gats.io right click for spacebar // @version 2.2.4 // @description Warning! This script is currently under testing, it could not work correctly until it is realesed. 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). In the future I also plan on reworking it to configure entirely the keybinds to be customizable // @author Rayan223 // @match https://gats.io // @icon none // @grant none // @license MIT // @namespace https://greasyforks.org/users/825882 // ==/UserScript== function isEventSupported(eventName, element) { element = element || document.createElement(TAGNAMES[eventName] || 'div'); eventName = 'on' + eventName; var isSupported = (eventName in element); if (!isSupported) { // if it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element if (!element.setAttribute) { element = document.createElement('div'); } if (element.setAttribute && element.removeAttribute) { element.setAttribute(eventName, ''); isSupported = typeof element[eventName] == 'function'; // if property was created, "remove it" (by setting value to `undefined`) if (typeof element[eventName] != 'undefined') { element[eventName] = undef; } element.removeAttribute(eventName); } } element = null; return isSupported; } if (isEventSupported("pointerdown")) { document.addEventListener("pointerdown", clickDown(event), false); document.addEventListener("pointerup", clickUp(event), false); } else if (isEventSupported("touchstart")) { document.addEventListener("touchstart", clickDown(event), false); document.addEventListener("touchend", clickUp(event), false); } else if (isEventSupported("mousedown")) { document.addEventListener("mousedown", clickDown(event), false); document.addEventListener("mouseup", clickUp(event), false); } let div_data = '<div id="ingameconsole"><p id="play_data"></p> <p id="click_which">None</p></div>' + document.body.innerHTML; var play = 0 document.body.innerHTML = div_data; var play_data = document.getElementById('play_data'); var click_data = document.getElementById('click_which'); function playing() { var menu = document.getElementById('slct'); if (menu.className == "container"){ return False }else{ return True } } function clickDown(event){ click_data = event if (playing()){ if(event.which == 2){ RF.list[0].socket.send('k,5,1'); } } } function clickUp(event){ if (playing()){ if(event.which == 2){ RF.list[0].socket.send('k,5,0'); } } }; //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'); //}