Greasy Fork

Shined up real nice.

Agar.io Better Mouse

Agar.io mouse control: Left splits, Middle 1x W, Right 6x W

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// ==UserScript==
// @name         Agar.io Better Mouse
// @namespace    http://redd.it/3710r5
// @version      0.5
// @description  Agar.io mouse control: Left splits, Middle 1x W, Right 6x W
// @author       hadq
// @match        http://agar.io
// @grant        none
// @license      WTFPL v2 (http://www.wtfpl.net/txt/copying/)
// ==/UserScript==
 
$(
    function() {
        var amount = 6;
        var duration = 50; //ms
        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) ){
                for (var i = 0; i < amount; ++i) {
                    setTimeout(function() {
                        $("body").trigger(feeddown);
                        $("body").trigger(feedup);
                    }, duration);
                }
            }
            else if( (e.which == 2) ){
                $("body").trigger(feeddown);
                $("body").trigger(feedup);
            }
            else if( (e.which == 1) ){
                $("body").trigger(splitdown);
                $("body").trigger(splitup);
                //console.log("split");
            }
        }).bind('contextmenu', function(e){
            e.preventDefault();
        });
        //alert("mouse enabled");
    }
)();