Created
June 6, 2015 01:27
-
-
Save anonymous/22ccbd6a1103dce498be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Agar.io Mouse | |
// @namespace http://redd.it/3710r5 | |
// @version 0.1 | |
// @description Agar.io mouse control: Left mouse splits, Right mouse feeds | |
// @author trabladorr | |
// @match http://agar.io | |
// @grant none | |
// @license WTFPL v2 (http://www.wtfpl.net/txt/copying/) | |
// ==/UserScript== | |
$( | |
function() { | |
var feeddown = $.Event("keydown", { keyCode: 87}); //w button | |
var feedup = $.Event("keyup", { keyCode: 87}); //w 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(feeddown); | |
$("body").trigger(feedup); | |
//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"); | |
} | |
)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
y8gyuyuuygtouyuyfyguyffggj