// ==UserScript==
// @name         MaSt Play MODS
// @namespace    MaSt Play MODS
// @version      0.1
// @description  MODS
// @author       MaSt
// @match        http://abs0rb.me/*
// @match        http://agar.io/*
// @match        http://agarabi.com/*
// @match        http://agarly.com/*
// @match        http://en.agar.bio/*
// @match        http://agar.pro/*
// @match        http://agar.biz/*
// @match        http://gota.io/*
// @grant        none
// @downloadURL https://update.greasyfork.icu/scripts/20935/MaSt%20Play%20MODS.user.js
// @updateURL https://update.greasyfork.icu/scripts/20935/MaSt%20Play%20MODS.meta.js
// ==/UserScript==
window.onload = function() {
    var ctx = document.getElementById("canvas").getContext("2d");
    $("h2").replaceWith('
MaSt Agar.io
');
    $("title").replaceWith('MaSt Agar.io');
    $("h1").replaceWith('MaSt Agar.io
');
    option_show_mass = true;
    option_skip_stats = true;
};
var SplitInterval;
var MacroInterval;
var SplitDebounce = false;
var MacroDebounce = false;
$(document).on('keydown', function(input) {
    console.log("got keydown");
    if (input.keyCode == 16) {
        if (SplitDebounce) {
            return;
        }
        SplitDebounce = true;
        SplitInterval = setInterval(function() {
            $("body").trigger($.Event("keydown", {
                keyCode: 32
            }));
            $("body").trigger($.Event("keyup", {
                keyCode: 32
            }));
        }, 0);
    } else if (input.keyCode == 81) {
        if (MacroDebounce) {
            return;
        }
        MacroDebounce = true;
        MacroInterval = setInterval(function() {
            $("body").trigger($.Event("keydown", {
                keyCode: 87
            }));
            $("body").trigger($.Event("keyup", {
                keyCode: 87
            }));
        }, 0);
    }
});
$(document).on('keyup', function(input) {
    if (input.keyCode == 16) {
        SplitDebounce = false;
        clearInterval(SplitInterval);
        return;
    } else if (input.keyCode == 81) {
        MacroDebounce = false;
        clearInterval(MacroInterval);
        return;
    }
});
$( "#canvas" ).after( "    " );
document.getElementById("gamemode").style.backgroundColor = "black";
document.getElementById("gamemode").style.color = "white";
document.getElementById("region").style.backgroundColor = "black";
document.getElementById("region").style.color = "white";
document.getElementById("quality").style.backgroundColor = "black";
document.getElementById("quality").style.color = "white";
document.getElementById("statsGraph").style.bottom = "";
document.getElementById("statsGraph").style.top = "40px";
document.getElementById("stats").getElementsByTagName("hr")[0].style.top = "270px";
document.getElementById("socialStats").style.bottom = "";
document.getElementById("socialStats").style.top = "290px";
document.getElementById("statsContinue").style.bottom = "20px";
document.getElementById("statsContinue").style.top = "344px";
document.getElementById("stats").getElementsByTagName("hr")[1].style.top = "40px";
document.getElementById("stats").style.height = "398px";
document.getElementById("stats").style.padding = "0 0 0";
document.getElementsByClassName("agario-exp-bar progress")[0].style.backgroundColor = "black";