Autoreloader for moomoo.io

Hold enter or something

// ==UserScript==
// @name         Autoreloader for moomoo.io
// @namespace    -
// @version      1.0
// @description  Hold enter or something
// @author       Enforcer
// @match        *://moomoo.io/*
// @match        http://dev.moomoo.io/*
// @match        *sandbox.moomoo.io/*
// @match        *abc.moomoo.io/*
// @grant        none
// ==/UserScript==

//messy coding but im lazy it works nonetheless
var autoreloadloop;
var autoreloadenough = 0;

autoreloadloop = setInterval(function () {
    if (autoreloadenough < 200) {
        document.title = "autoReloader working";
        if (document.getElementById("loadingText").innerHTML == `disconnected<a href="javascript:window.location.href=window.location.href" class="ytLink">reload</a>`) {
            document.title = "autoReloader done";
            clearInterval(autoreloadloop);
            setTimeout(function () {document.title = "Moo Moo";}, 1000)
            location.reload();
        }
        autoreloadenough++;
    }
    else if (autoreloadenough >= 300) {
        clearInterval(autoreloadloop);
        document.title = "autoReloader done";
        setTimeout(function () {document.title = "Moo Moo";}, 1000)
    }
}, 50);