ProutexMacro v3

Read the description in GreasyFork!

As of 2021-05-05. See the latest version.

// ==UserScript==
// @name ProutexMacro v3
// @namespace -
// @version [3.0]...
// @description Read the description in GreasyFork!
// @author Discord: GoblinTime#2714 : Greasy Fork: ♡⚠♡GoblinTime♡⚠♡
// @match *://sandbox.moomoo.io/*
// @match *://moomoo.io/*
// @match *://dev.moomoo.io/*
// @grant none
// @require https://greasyfork.org/scripts/368273-msgpack/code/msgpack.js?version=598723
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
// @require https://cdn.jsdelivr.net/npm/msgpack-lite@0.1.26/dist/msgpack.min.js
// @require https://cdn.jsdelivr.net/npm/fontfaceobserver@2.1.0/fontfaceobserver.standalone.min.js
// ==/UserScript==
(function() {
    'use strict';
/* Add new colors for health bars */
    var ctx = CanvasRenderingContext2D;
if(ctx.prototype.roundRect) {
        ctx.prototype.roundRect = ((func) => function() {
        if (this.fillStyle == "#8ecc51"){ //All allys
        this.fillStyle = "rgba(0, 66, 0, 0.47)";
        } else if(this.fillStyle == "#cc5151") { // All enemy
        this.fillStyle = "rgba(112, 6, 0, 0.47)";
        } else if(this.fillStyle == "#3d3f42") { // Background health bar
        this.fillStyle = "rgba(82, 82, 82, 0.47)";
        }
        return func.call(this, ...arguments);
        })
        (ctx.prototype.roundRect);
}
function StartRes() {
    window.follmoo("moofoll", 1); // Start Resource
}
StartRes();
// Add <meta>
    function Head() {
        var meta = document.createElement('meta');
        meta.name = "viewport";
        meta.content = "initial-scale=1, maximum-scale=1, user-scalable=no";
        document.getElementsByTagName('head')[0].appendChild(meta);
    }
    Head();
$("killCounter").css({"top": "230px"});
$("#errorNotification").after(`
<div class="NameMacro">ProutexMacro v3</div>
<style>
.NameMacro{
position: absolute;
background: linear-gradient(to right, red, orange, yellow, green, cyan, blue, violet);
background-size: 400% 400%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
-webkit-animation: colorR 20s ease infinite;
animation: colorR 20s ease infinite;
font-family: "Hammersmith One";
display: block !important;
top: 5px;
left: 730px;
font-size: 17px;
}
</style>
`);
    $("#errorNotification").after(`
<div id="ShowMenu">
</span>
<div id="addtext">LeftAndRightClick: On</div>
<div id="addtext0">Soldier-Q: On</div>
<div id="addtext1">Left-Click</div>
<div id="addtext2">Right-Click</div>
<style>
   #ShowMenu {
   position:absolute !important;
   display:block;
   top: 5px;
   left: 5px;
   width: auto;
   height: auto;
   text-align: center;
   }
   #addtext,#addtext1,#addtext2,#addtext0{
   display: none;
   color: #fff;
   background: linear-gradient(to right, red, orange, yellow, green, cyan, blue, violet);
   background-size: 400% 400%;
   font-size: 20px;
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   -webkit-animation: colorR 20s ease infinite;
   animation: colorR 20s ease infinite;
   }
   @-webkit-keyframes colorR {
   0% { background-position: 0% 50% }
   50% { background-position: 100% 50% }
   100% { background-position: 0% 50% }
   }
   @keyframes colorR {
   0% { background-position: 0% 50% }
   50% { background-position: 100% 50% }
   100% { background-position: 0% 50% }
   }
</style>
<script>
let tm;
let t = "Moo Moo";
function change(icon, text) {
    document.querySelector('head title').innerHTML = text;
    document.querySelector('link[rel="shortcut icon"]').setAttribute('href',
        icon);
}
window.onblur = () => {
    tm = setTimeout(() => {
        change("https://cdn.discordapp.com/attachments/837884067822436382/838321077775237140/w16h161372343790hearts16.png",
            "😓COMEBACK!😓");
    }, 5000);
}
window.onfocus = () => {
    change("https://sandbox.moomoo.io/img/favicon.png?v=1", t);
}
</script>
`);
    var Soldier_Q = false;
    var Clicks = false;
    const cvs = document.getElementById("gameCanvas");
    cvs.addEventListener("mousedown", clicks, false);
    function clicks(e) {
        if (e.button == 0) {
            if (Clicks == true) {
                document.getElementById('addtext1').style
                .display = "block";
                window.storeEquip(0, 1);
                window.storeEquip(7);
                window.storeEquip(18, 1);
                setTimeout(function() {
                    window.storeEquip(11);
                    window.storeEquip(21, 1);
                }, 100);
                setTimeout(function() {
                    window.storeEquip(53);
                    window.storeEquip(21, 1);
                }, 180);
                setTimeout(function() {
                    window.storeEquip(6);
                    window.storeEquip(13, 1);
                }, 260);
                setTimeout(function() {
                    document.getElementById('addtext1').style
                        .display = "none";
                }, 600);
            }
        }
        if (e.button == 2) {
            if (Clicks == true) {
                document.getElementById('addtext2').style
                .display = "block";
                window.storeEquip(0, 1);
                window.storeEquip(20);
                window.storeEquip(19, 1);
                setTimeout(function() {
                    window.storeEquip(40);
                    window.storeEquip(19, 1);
                }, 120);
                setTimeout(function() {
                    window.storeEquip(6);
                    window.storeEquip(19, 1);
                }, 200);
                setTimeout(function() {
                    document.getElementById('addtext2').style
                        .display = "none";
                }, 600);
            }
        }
    }
    var leaderBlock = document.getElementById("leaderboard");
    document.addEventListener('keydown', (e) => { // Add event
        switch (e.keyCode) {
            case 72: // [Button]- K
                if(Soldier_Q == false){
                Soldier_Q = true;
                  document.getElementById('addtext0').style
                        .display = "block";
                } else {
                Soldier_Q = false;
                  document.getElementById('addtext0').style
                        .display = "none";
                }
                break;
            case 74: // [Button]- J
                if (Clicks == false) {
                    document.getElementById('addtext').style
                        .display = "block";
                    Clicks = true;
                } else {
                    document.getElementById('addtext').style
                        .display = "none";
                    Clicks = false;
                }
                break;
            case 75: // [Button]- K
              if (leaderBlock.style.display == "block") {
              $("killCounter").css({"margin": "0"});
              $("killCounter").css({"top": "0px"});
                leaderBlock.style.display = "none";
               } else {
               $("killCounter").css({"top": "230px"});
                leaderBlock.style.display = "block";
             }
                break;
                // Bull Tick::
                case 89: // [Button]- Y
                console.log("Bull Tick");
                window.storeEquip(7); // [Equip, Hat]- BullHelmet
                setTimeout(() => {
                window.storeEquip(6); // [Equip, Hat]- SoldierGear
                },800);
                break;
            case 38: // [Button]- Up Arrow
                window.sendJoin(0); // Send a request to the very first clan
                break;
            case 82: // [Button]- R
                console.log("Bull, Blood[Wings]");
                window.storeEquip(0, 1);
                window.storeBuy(7); // [Buy, Hat]- BullHelmet
                window.storeBuy(18, 1); // [Buy, Acc]- Blood Wings
                window.storeEquip(7); // [Equip, Hat]- BullHelmet
                window.storeEquip(21, 1); // [Equip, Acc]- Blood Wings
                break;
            case 81: // [Button]- Q
              if(Soldier_Q == true){
                console.log("Soldier, X[Wings]");
                window.storeEquip(0, 1);
                window.storeBuy(6); // [Buy, Hat]- SoldierGear
                window.storeBuy(21, 1); // [Buy, Acc]- X Wings
                window.storeEquip(6); // [Equip, Hat]- SoldierGear
                window.storeEquip(21, 1); // [Equip, Acc]- X Wings
                }
                break;
            case 16: // [Button]- Shift
                console.log("Boost, Tail");
                window.storeEquip(0, 1);
                window.storeBuy(12); // [Buy, Hat]- Booster
                window.storeBuy(11, 1); // [Buy, Acc]- Tail
                window.storeEquip(12); // [Equip, Hat]- Booster
                window.storeEquip(11, 1); // [Equip, Acc]- X Wings
                break;
            case 84: // [Button]- T
                console.log("Soldier, X[Wings]");
                window.storeEquip(0, 1);
                window.storeBuy(6); // [Buy, Hat]- Soldier
                window.storeBuy(21, 1); // [Buy, Acc]- X Wings
                window.storeEquip(6); // [Equip, Hat]- Soldier
                window.storeEquip(21, 1); // [Equip, Acc]- X Wings
                break;
            case 90: // [Button]- Z
                console.log("Tank, Black[Wings]");
                window.storeEquip(0, 1);
                window.storeBuy(40); // [Buy, Hat]- Tank
                window.storeBuy(19, 1); // [Buy, Acc]- Black Wings
                window.storeEquip(40); // [Equip, Hat]- Tank
                window.storeEquip(19, 1); // [Equip, Acc]- Black Wings
                break;
        }
    });
    /* Instructions for adding items: You need to put this code in a comment here is how I commented out this text */
    //  /*
    document.getElementById('gameName').innerText = 'MooMooMacro';
    document.getElementById("moomooio_728x90_home").style.display = "none";
    $("#moomooio_728x90_home").parent().css({display: "none"});
    document.getElementById("promoImg").remove();
    document.getElementById('adCard').remove();
    $("#youtuberOf").remove();
    $("#followText").remove();
    $("#promoImgHolder").remove();
    $("#twitterFollow").remove();
    $("#joinPartyButton").remove();
    $("#linksContainer2").remove();
    $("#partyButton").remove();
    $("#youtubeFollow").remove();
    $("#adCard").remove();
    $("#adBlock").remove();
    $("#mobileInstructions").remove();
    $("#downloadButtonContainer").remove();
    $("#mobileDownloadButtonContainer").remove();
    $(".downloadBadge").remove();
    //  */
    setTimeout(() => {
        document.getElementById('ot-sdk-btn-floating').remove();
        document.getElementById('pre-content-container').remove();
    }, 1000);
})();