THE_ULTIMATE_Agario_Script (Modification)

'W' is Macro, 'Shift' and '4' is Tricksplit, 'A' is Triplesplit, 'D' is Doublesplit, 'Left Click' is Space, 'Right Click' is Feed/Macro, 'Mouse Click' is Tricksplit. Easily configurable keys in code. Credits to Jack Burch, Tom Burris AND Ali Ahfad Mehdi

当前为 2016-07-16 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         THE_ULTIMATE_Agario_Script (Modification)
// @namespace    http://tampermonkey.net/
// @version      1.14
// @description  'W' is Macro, 'Shift' and '4' is Tricksplit, 'A' is Triplesplit, 'D' is Doublesplit, 'Left Click' is Space, 'Right Click' is Feed/Macro, 'Mouse Click' is Tricksplit. Easily configurable keys in code. Credits to Jack Burch, Tom Burris AND Ali Ahfad Mehdi
// @author       
// @match        http://agar.io/*
// @match        https://agar.io/*
// @grant        none
// @run-at       document-end
// ==/UserScript==
window.addEventListener('keydown', keydown);
window.addEventListener('keyup', keyup);
var Feed = false;
var Speed = 10; //default = 25
var splits = 1;

//Funtions
function split() {
    $("body").trigger($.Event("keydown", { keyCode: 32}));
    $("body").trigger($.Event("keyup", { keyCode: 32}));
}
function mass() {
    if (Feed) {
        window.onkeydown({keyCode: 87});
        window.onkeyup({keyCode: 87});
        setTimeout(mass, Speed);
    }
}

function keydown(event) {
    // Feed Macro
    if (event.keyCode == 81 )                                        // Q
    {
        Feed = true;
        setTimeout(mass, Speed);
    }// Center
    if (event.keyCode == 83) {                                       // S
        X = window.innerWidth/2;
        Y = window.innerHeight/2;
        $("canvas").trigger($.Event("mousemove", {clientX: X, clientY: Y}));
    }
    // Tricksplit
    if (event.keyCode == 16 || event.keyCode == 52) {                // Shift and 4
        split();
        setTimeout(split, Speed);
        setTimeout(split, Speed*2);
        setTimeout(split, Speed*3);
    } // Triplesplit
    if (event.keyCode == 65 || event.keyCode == 'yourkey') {         // A and Put in Your Key
        split();
        setTimeout(split, Speed);
        setTimeout(split, Speed*2);
    } // Doublesplit
    if (event.keyCode == 68 || event.keyCode == 'yourkey') {         // D and Put in Your Key
        split();
        setTimeout(split, Speed);
    }// Split
    if (event.keyCode == 'yourkey' || event.keyCode == 'yourkey2') { // Put in Your Key
        split();
    }
        

} // When Player Lets Go Of Q, It Stops Feeding
function keyup(event) {
    if (event.keyCode == 81) {
        Feed = false;
    }
}

//Mouse Clicks
(function() {
    document.getElementById("canvas").addEventListener("mousedown", function(event) {
        if (event.which == 1) {
            split();
        }
        else if (event.which == 2) {
            split();
            setTimeout(split, Speed);
            setTimeout(split, Speed*2);
            setTimeout(split, Speed*3);
        }
        else if (event.which == 3) {
            Feed = true;
            setTimeout(mass, Speed);
        }
    });

    document.getElementById("canvas").addEventListener("mouseup", function(event) {
        if (event.which == 3) {
            Feed = false;
        }
    });
    $('#canvas').bind('contextmenu', function(e) {
        e.preventDefault();
    });
}());


//add new instructions about the Script to Agar.io
var exInstructions = document.createElement('span');
var exInstructionsAlign = document.createElement('center');
exInstructions.style.color = '#777';
exInstructions.innerHTML = '<br><u><b>Ultimate Agar.io Script controlls:</b></u><br>Press <b>Q</b> to feed macro<br>Press <b>A</b> to triplesplit<br>Press <b>D</b> to doublesplit<br>Press <b>S</b> to center your cell(s)<br><b>left click</b> to split<br><b>mouse click</b> to tricksplit<br><b>right click</b> to macro feed';
exInstructionsAlign.appendChild(exInstructions);
instructions.appendChild(exInstructionsAlign);
document.getElementById('statsContinue').style.width = '146px';


//add a respawn button to Agar.io :)
var respawn = document.createElement('button');
respawn.type = 'submit';
respawn.innerHTML = 'Respawn';
respawn.addEventListener('click', function(){MC.setNick(document.getElementById('nick').value); return false;})
respawn.style.display = 'inline-block';
respawn.style.padding = '6px 12px';
respawn.style.marginBottom = '0';
respawn.style.fontSize = '14px';
respawn.style.fontWeight = '400';
respawn.style.lineHeight = '1.42857143';
respawn.style.textAlign = 'center';
respawn.style.whiteSpace = 'mowrap';
respawn.style.verticalAlign = 'middle';
respawn.style.cusor = 'pointer';
respawn.style.border = '1px solid transparent';
respawn.style.borderRadius = '4px';
respawn.style.color = '#fff';
respawn.style.backgroundColor = '#428bca';
respawn.style.borderColor = '357ebd';
respawn.style.position = 'absolute';
respawn.style.right = '25px';
respawn.style.width = '150px';
respawn.style.bottom = '15px';
stats.appendChild(respawn);

//add a reload button
var playButton = document.getElementsByTagName("button")[6];
var newButton = document.createElement("button");
var nbstyle = newButton.style;
newButton.innerHTML = 'Reload';
newButton.id = 'reloadButton'

/*
nbstyle.display = 'block';
nbstyle.float = 'right';
nbstyle.height = '37px';
nbstyle.width = '110px';
nbstyle.fontWeight = '700';
nbstyle.color = '#fff';
nbstyle.backgroundColor = '#354c8c';
nbstyle.borderColor = '#354c8c';
nbstyle.borderRadius = '5px'*/
playButton.style.width = '160px';

$(document).ready(function(){
	$('#reloadButton').css({'display':'block','float':'right','height':'37px','width':'110px','fontWeight':'700','color':'#fff','backgroundColor':'#354c8c','borderColor':'#354c8c','borderRadius':'5px'})
})

document.getElementsByClassName("row")[0].appendChild(newButton);
newButton.addEventListener('click', function(){
	location.reload()
})

/*
Script by Ali Ahfad Mehdi modified by Arnie

Changes:
    instructions added
    respawn button added
    keys changed (you can get keycodes on http://keycode.info/ ☺)

CREDITS TO: JACK BURCH, TOM BURRIS
*/