我试图使用一个与tampermonkey一起使用的agar.io脚本(只是粘贴代码),我复制了它并且它可以工作,我几乎没有修改它。有人可以修复它,以便右键单击鼠标会垃圾空格按钮吗?
$(
function() {
var rapiddown = $.Event("keydown", { keyCode: 32}); //spam space button
var rapidup = $.Event("keyup", { keyCode: 32}); //spam space button
var splitdown = $.Event("keydown", { keyCode: 32}); //space button
var splitup = $.Event("keyup", { keyCode: 32}); //space button
$(document).bind('mousedown', function(e) {
if( (e.which == 3) ){
$("body").trigger(rapiddown);
$("body").trigger(rapidup);
//console.log("feed");
}
else if( (e.which == 1) ){
$("body").trigger(splitdown);
$("body").trigger(splitup);
//console.log("split");
}
}).bind('contextmenu', function(e){
e.preventDefault();
});
//alert("mouse enabled");
}
)();