DiepHack2019 - BEST CHEAT SCRIPT AT DIEP.IO!!

[Give all 50 achievements][Instantly maximum and best stat] etc...

// ==UserScript==
// @name        DiepHack2019 - BEST CHEAT SCRIPT AT DIEP.IO!!
// @namespace   https://cpuponyo.constantcontactsites.com
// @version     1.01
// @description [Give all 50 achievements][Instantly maximum and best stat] etc...
// @author      Ponyo
// @include     *://diep.io/*
// @connect     diep.io
// @grant       none
// @require     http://code.jquery.com/jquery-latest.js
// ==/UserScript==

    // *** 変数宣言 *** //
    var diepHackSystem_version = "1.0.1"
    var diepHackSystem_years = "2019"

    var canvas = document.getElementById('canvas');
    var ctx = canvas.getContext("2d");
    var diepHackMenu = document.createElement('div');
    var diepHackConsole = "";
    var diepHackCommandError = true;

    // *** 初期化 *** //
    document.title = ( '' + document.title + ' - DiepHack' + diepHackSystem_years );
    styleInit();
    jsInit();
    bodyInit();

    // *** CSSの初期化 *** //
    function styleInit() {
        addGlobalStyle(`div::-webkit-scrollbar{width: 24px;} div::-webkit-scrollbar-track{background: #FFFFFFEE; border: none; border-radius: 10px; box-shadow: inset 0 0 2px #00B2E155;}div::-webkit-scrollbar-thumb{background: #00B2E1; border-radius: 10px; box-shadow: none;}`);
        addGlobalStyle(`.diepHack-menu{position:absolute; top:55px; left:-750px; padding: 0.5em 1em; margin: 2em 0; width: 400px; background: #FFFFFFEE; border: solid 5px #0082A155; border-radius: 14px;
                        margin: 10px; padding: 10px; line-height: 1.3; overflow: auto; text-align: left; width: 750px; height: 300px;
                        transition-duration: 0.5s;} .diepHack-menu:hover{position:absolute; left:-20px;}`);
        addGlobalStyle(`.diepHack-pretitle{font-size: 34px;}`);
        addGlobalStyle(`.diepHack-subtitle{font-size: 19px;}`);
        addGlobalStyle(`.diepHack-description{font-size: 16px;}`);
        addGlobalStyle(`.diepHack-warning{font-size: 16px; color:#ff9999}`);
        addGlobalStyle(`a {text-decoration: none;} a.diepHack-url:link{color:#FFFFFF} a.diepHack-url:visited{color:#FFFFFF;} a.diepHack-url:hover{color:#00B2E1;text-decoration: underline;} a.diepHack-url:active{color:#FFE66C;}`);
        addGlobalStyle(`.diepHack-hr{position: relative; height: 1px; border-width: 0; background-image: -webkit-linear-gradient(left, transparent 0%,#00B2E1 50%,transparent 100%); background-image: linear-gradient(90deg, transparent 0%,#00B2E1 50%,transparent 100%);}`);
        addGlobalStyle(`
                        a.diepHack-button {
                            display: inline-block;
                            margin: 15px 15px 0;
                            padding: .6em 1.1em;
                            font-size: 14px;
                            font-weight: bold;
                            text-decoration: none;
                            outline: none;
                            color: #FFFFFF;
                            text-align center;
                            background-color: #00B2E1;
                            border-radius: 32px;
                            -webkit-background-clip: padding-box;
                            background-clip: padding-box;
                            -webkit-box-shadow: 0 0 0 -2px #FFFFFF, 0 0 0 -1px #00B2E1;
                            box-shadow: 0 0 0 -2px #FFFFFF, 0 0 0 -1px #00B2E1;
                            border: none;
                            -webkit-transition: -webkit-box-shadow .3s;
                            transition: box-shadow .3s;
                            cursor: pointer
                        }
                        a.diepHack-button:hover, a.diepHack-button:focus {
                            -webkit-box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #00B2E1;
                            box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #00B2E1;
                                -webkit-transition-timing-function: cubic-bezier(0.6, 4, 0.3, 0.8);
                            transition-timing-function: cubic-bezier(0.6, 4, 0.3, 0.8);
                            -webkit-animation: gelatine 0.5s 1;
                            animation: gelatine 0.5s 1;
                        }
                        a.diepHack-button-secondary {
                            background: #FFFFFF;
                            -webkit-box-shadow: 0 0 0 -2px #FFFFFF, 0 0 0 -1px #FFFFFF;
                            box-shadow: 0 0 0 -2px #FFFFFF, 0 0 0 -1px #FFFFFF;
                        }
                        a.diepHack-button-secondary:hover {
                            -webkit-box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #FFFFFF;
                            box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #FFFFFF;
                        }
                        a.diepHack-button:active, a.diepHack-button-secondary:active {
                            background: #FFFFFF;
                            -webkit-transition-duration: 0;
                            transition-duration: 0;
                            -webkit-box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #FFFFFF;
                            box-shadow: 0 0 0 2px #00B2E1, 0 0 0 4px #FFFFFF;
                            color: #00B2E1;
                        }
                        @keyframes gelatine {
                            from, to {
                                -webkit-transform: scale(1, 1);
                                transform: scale(1, 1);
                            }
                            25% {
                                -webkit-transform: scale(0.9, 1.1);
                                transform: scale(0.9, 1.1);
                            }
                            50% {
                                -webkit-transform: scale(1.1, 0.9);
                                transform: scale(1.1, 0.9);
                            }
                            75% {
                                -webkit-transform: scale(0.95, 1.05);
                                transform: scale(0.95, 1.05);
                            }
                            from, to {
                                -webkit-transform: scale(1, 1);
                                transform: scale(1, 1);
                            }
                            25% {
                                -webkit-transform: scale(0.9, 1.1);
                                transform: scale(0.9, 1.1);
                            }
                            50% {
                                -webkit-transform: scale(1.1, 0.9);
                                transform: scale(1.1, 0.9);
                            }
                            75% {
                                -webkit-transform: scale(0.95, 1.05);
                                transform: scale(0.95, 1.05);
                            }
                        }
                        @-webkit-keyframes gelatine {
                            from, to {
                                -webkit-transform: scale(1, 1);
                                transform: scale(1, 1);
                            }
                            25% {
                                -webkit-transform: scale(0.9, 1.1);
                                transform: scale(0.9, 1.1);
                            }
                            50% {
                                -webkit-transform: scale(1.1, 0.9);
                                transform: scale(1.1, 0.9);
                            }
                            75% {
                                -webkit-transform: scale(0.95, 1.05);
                                transform: scale(0.95, 1.05);
                            }
                            from, to {
                                -webkit-transform: scale(1, 1);
                                transform: scale(1, 1);
                            }
                            25% {
                                -webkit-transform: scale(0.9, 1.1);
                                transform: scale(0.9, 1.1);
                            }
                            50% {
                                -webkit-transform: scale(1.1, 0.9);
                                transform: scale(1.1, 0.9);
                            }
                            75% {
                                -webkit-transform: scale(0.95, 1.05);
                                transform: scale(0.95, 1.05);
                            }
                       }
                `);
        function addGlobalStyle(css) {
            var head, style;
            head = document.getElementsByTagName('head')[0];
            if (!head) {
                return;
            }
            style = document.createElement('style');
            style.type = 'text/css';
            style.innerHTML = css;
            head.appendChild(style);
        }
    }

    // *** JSの初期化 *** //
    function jsInit() {
        addGlobalJavaScript(`
            function achievementFlag(aflag){
                var achievementCode = JSON.parse('{"A::1ba4250a398116e7_1":"' + String(aflag) + '","A::1c00693fbf538316_1":"' + String(aflag) + '","A::22d84fdc78b1f1ae_1":"' + String(aflag) + '","A::22fd2ee6d05881d6_1":"' + String(aflag) + '","A::256245339c3742d2_1":"10000","A::2780b5743fe93789_1":"' + String(aflag) + '","A::300ddd6f1fb3d69d_1":"500","A::33e4cb47afd5602f_1":"10","A::3fd17b5d35c36670_1":"' + String(aflag) + '","A::4d545ac615beec40_1":"' + String(aflag) + '","A::4eebb78f4ee19cba_1":"' + String(aflag) + '","A::54084a4936c7e37_1":"' + String(aflag) + '","A::5613de303c7e06f0_1":"' + String(aflag) + '","A::5892e09831854ad2_1":"' + String(aflag) + '","A::5dbb422e510cec75_1":"' + String(aflag) + '","A::6502bcb56dfbc0e3_1":"' + String(aflag) + '","A::6520a970c68efb85_1":"' + String(aflag) + '","A::6d07f075d9877ab_1":"' + String(aflag) + '","A::6d671cfa6dceb09_1":"500","A::71c663fb258f5243_1":"' + String(aflag) + '","A::723c26b6a37fccbb_1":"100","A::76646f423e5d6bc4_1":"' + String(aflag) + '","A::8221180ec6d53232_1":"10000","A::87e48332e9161b3d_1":"' + String(aflag) + '","A::8abd923027114f9e_1":"1000","A::8b83f81f510fd136_1":"10","A::8b8fe153a4965c63_1":"' + String(aflag) + '","A::8eeec8c270ef92be_1":"' + String(aflag) + '","A::9898db9ff6d3c1b3_1":"' + String(aflag) + '","A::9953423e884422b6_1":"100","A::9f0edada2bd7cd6_1":"' + String(aflag) + '","A::a402fdb3f5cebf99_1":"' + String(aflag) + '","A::a81a738312c7705d_1":"' + String(aflag) + '","A::b8b3e7fd58ff6706_1":"' + String(aflag) + '","A::b95a9621ccccad3c_1":"' + String(aflag) + '","A::bb9188cddc9d5b1f_1":"100","A::bdf3e0a1c4ebcaee_1":"' + String(aflag) + '","A::cdf66074bb5ce7fa_1":"' + String(aflag) + '","A::d3e4829583362b48_1":"3000","A::d583013681f15fcc_1":"' + String(aflag) + '","A::d932ec7312510a14_1":"10","A::e1f4f3e6a5c9bacb_1":"' + String(aflag) + '","A::e6111736c85494e9_1":"' + String(aflag) + '","A::eb9792219de8f755_1":"' + String(aflag) + '","A::ecea90c4be06d999_1":"' + String(aflag) + '","A::eef89695be793c7f_1":"100","A::f3618c60205d7ded_1":"' + String(aflag) + '","A::f73016825baab042_1":"100","A::fc3b3faf73bae216_1":"' + String(aflag) + '","A::bae942e2191270e_1":"' + String(aflag) + '"}');
                Object.keys(achievementCode).forEach((k) => {localStorage.setItem(k, achievementCode[k])});
                location.reload(true);
            };
        `);
        function addGlobalJavaScript(js) {
            var head, script;
            head = document.getElementsByTagName('head')[0];
            if (!head) {
                return;
            }
            script = document.createElement('script');
            script.type = 'text/javascript';
            script.innerHTML = js;
            head.appendChild(script);
        }
    }

    // *** HTMLの初期化 *** //
    function bodyInit() {
        document.getElementsByTagName('body')[0].appendChild(diepHackMenu);
        diepHackMenu.style = "position:absolute; top:55px; left:0px; font-family: Ubuntu; color: #FFFFFF; font-style: normal; font-variant: normal; text-shadow: black 2px 0px, black -2px 0px, black 0px -2px, black 0px 2px, black 2px 2px, black -2px 2px, black 2px -2px, black -2px -2px, black 1px 2px, black -1px 2px, black 1px -2px, black -1px -2px, black 2px 1px, black -2px 1px, black 2px -1px, black -2px -1px;";
        diepHackMenu.innerHTML = `
        <div class="diepHack-menu" oncopy="return false;" onselectstart="return false;" oncontextmenu="return false;">
            <span class="diepHack-pretitle">DiepHack` + diepHackSystem_years + `</span>&nbsp&nbsp<span class="diepHack-subtitle">by Ponyoで~す[🇯🇵]</span>&nbsp-&nbsp<a class="diepHack-url" target="_blank" href="https://cpuponyo.constantcontactsites.com">(Homepage)</a>
            <hr class="diepHack-hr" />
            <div class="diepHack-subtitle">System</div>
            <table>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('lb_reconnect');return false;">Disconnect</a></td>
                    <td><span class="diepHack-warning">Disconnect your useing server.</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.keyDown(36);input.keyUp(36);return false"'>Console</a></td>
                    <td><span class="diepHack-description">Open / Close the console.</span><span style="font-size: 9px;"> ★ If you input the "dh-help" at console, show command list.</span><br></td>
                </tr>
            </table>
            <table>
                <tr>
                    <td><span class="diepHack-description">Upgrades UI</span></td>
                    <td><a class="diepHack-button" onclick="input.execute('ren_upgrades true');return false;">Show</a></td>
                    <td><a class="diepHack-button" onclick="input.execute('ren_upgrades false');return false;">Hide</a></td>
                </tr>
            </table>
            <hr class="diepHack-hr" />
            <div class="diepHack-subtitle">Achievement</div>
            <table>
                <tr>
                    <td><a class="diepHack-button" onclick="achievementFlag(1);return false;">Get all achievements</a></td>
                    <td><span class="diepHack-warning">Auto reload this page!!</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="achievementFlag(0);return false;">Lost all achievements</a></td>
                    <td><span class="diepHack-warning">Auto reload this page!!</span></td>
                </tr>
            </table>
            <hr class="diepHack-hr" />
            <div class="diepHack-subtitle">Instantly Maximum Stat</div>
            <table>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 1111111111');return false;">Maximum "Health Regen"</a></td>
                    <td><span class="diepHack-description">You need to "Health Regen" stat points.</span><br></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 2222222222');return false;">Maximum "Max Health"</a></td>
                    <td><span class="diepHack-description">You need to "Max Health" stat points.</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 3333333333');return false;">Maximum "Body Damage"</a></td>
                    <td><span class="diepHack-description">You need to "Body Damage" stat points.</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 4444444');return false;">Maximum "Bullet Speed"</a></td>
                    <td><span class="diepHack-description">You need to "Bullet Speed" stat points.</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 5555555');return false;">Maximum "Bullet Penetration"</a></td>
                    <td><span class="diepHack-description">You need to "Bullet Penetration" stat points.</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 6666666');return false;">Maximum "Bullet Damage"</a></td>
                    <td><span class="diepHack-description">You need to "Bullet Damage" stat points.</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 7777777');return false;">Maximum "Reload"</a></td>
                    <td><span class="diepHack-description">You need to "Reload" stat points.</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 8888888888');return false;">Maximum "Movement Speed"</a></td>
                    <td><span class="diepHack-description">You need to "Movement Speed" stat points.</span></td>
                </tr>
            </table>
            <hr class="diepHack-hr" />
            <div class="diepHack-subtitle">Instantly Best Stat</div>
            <table>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 555555566666667777777444444488888');return false;">Attacker</a></td>
                    <td><span class="diepHack-description">0 / 0 / 0 / 7 / 7 / 7 / 7 / 5</span></td>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 333333322222228888888777777711111');return false;">Rammer</a></td>
                    <td><span class="diepHack-description">5 / 7 / 7 / 0 / 0 / 0 / 7 / 7</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 555555666666777777744444448888888');return false;">Basic</a></td>
                    <td><span class="diepHack-description">0 / 0 / 0 / 7 / 6 / 6 / 7 / 7</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 555555666666444444488888833332222');return false;">Destoryer</a></td>
                    <td><span class="diepHack-description">0 / 4 / 4 / 7 / 6 / 6 / 0 / 6</span></td>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 555555566666664444444888888833322');return false;">Drone</a></td>
                    <td><span class="diepHack-description">0 / 2 / 3 / 0 / 7 / 7 / 7 / 7</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 555555666666777777744444448888888');return false;">Predator</a></td>
                    <td><span class="diepHack-description">0 / 0 / 0 / 7 / 6 / 6 / 7 / 7</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 333333322222228888888777777711111');return false;">Booster</a></td>
                    <td><span class="diepHack-description">5 / 7 / 7 / 0 / 0 / 0 / 7 / 7</span></td>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 555555566666677777774444448888888');return false;">Fighter</a></td>
                    <td><span class="diepHack-description">0 / 0 / 0 / 6 / 7 / 6 / 7 / 7</span></td>
                </tr>
                <tr>
                    <td><a class="diepHack-button" onclick="input.execute('game_stats_build 333332222288877788877775656565644');return false;">ExBooster</a></td>
                    <td><span class="diepHack-description">0 / 5 / 5 / 2 / 4 / 4 / 7 / 6</span></td>
                </tr>
            </table>
            <hr class="diepHack-hr" />
            <span style="text-shadow: black 1.25px 0px, black -1.25px 0px, black 0px -1.25px, black 0px 1.25px, black 1.25px 1.25px, black -1.25px 1.25px, black 1.25px -1.25px, black -1.25px -1.25px, black 0px 1.25px, black -0px 1.25px, black 0px -1.25px, black -0px -1.25px, black 1.25px 0px, black -1.25px 0px, black 1.25px -0px, black -1.25px -0px;">
                <div class="font-size: 16px;">Changelog</div>
                <div style="position: relative; top:6px; font-size: 13px;">Last updated: June 26th 2019</div><br>
                <div style="font-size: 13px;">
                    <p>*Bug fix</p>
                    <p>*Users not only report bugs, they even fix bugs and send in fixes</p>
                </div>
            </span>
        </div>
        `;
   }

    // *** コンソールの処理 *** //
    document.onkeydown = function() {
        if ( event.keyCode == 13 ) {
            diepHackCommandError = true;
            diepHackConsole = document.getElementById('textInput').value;
            if ( diepHackConsole == "dh-help" ) {
                diepHackCommandError = false;
                alert('DiepHack' + diepHackSystem_years + ' command list\n\ndh-help #Show command list.\ndh-version #Getting the DiepHack version.\n');
            }
            if ( diepHackConsole == "dh-version" ) {
                diepHackCommandError = false;
                alert('DiepHack' + diepHackSystem_years + ' - version : ' + diepHackSystem_version + ' Service ' + diepHackSystem_years + ' - ' + ( 1 + Number(diepHackSystem_years) ) + ' Copyright Ponyo.');
            }
            if ( diepHackCommandError == false ) {
                document.getElementById('textInput').value = "";
            }
        }
    }