auto respawn

autorespawn, toggle with 't'

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Advertisement:

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

Advertisement:

// ==UserScript==
// @name         auto respawn
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  autorespawn, toggle with 't'
// @author       You
// @match        https://takepoint.io/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    window.addEventListener("keydown", toggleRespawn);

    var foot = document.getElementById("footers");
    var respawn = true;
    var overlay = document.getElementsByClassName("featured-game-container")[0];
    overlay.style = "pointer-events: none; position: fixed; top:10px; left:10px; font-family: 'Comic Sans MS', cursive, sans-serif; color: #FFFFFF; font-style: normal; font-variant: normal; z-index: 9999;";
    let stats = [];


    var observer = new MutationObserver(function(mutations){
        mutations.forEach(function(mutation){
            if(mutation.type == "attributes"){
                if(document.getElementById("footers").style.display == "flex"){
                    addScript();
                }
            }
        });
    });
    observer.observe(foot, {
        attributes: true //configure it to listen to attribute changes
    });

    function toggleRespawn(e){
        if(e.keyCode == 84){
            respawn = !respawn;
            console.log(respawn);
            overlay.innerHTML = respawn ? "<h3>respawn: true (press t to change)</h3>" : "<h3>respawn: false (press t to change)</h3>";
        }
    }
    // Your code here...

        function addScript(){
        let width = renderArea.canvasWidth;
        let height = renderArea.canvasHeight;
        let centerX = width/2;
        let centerY = height/2;
        ASM_CONSTS[7315] = function($0, $1, $2, $3) {
            let text = UTF8ToString($1);
            contexts[$0].strokeText(text, $2, $3);
            let positionX = $2 < centerX + 200 && $2 > centerX - 200;
            let positionY = $3 < centerY - 200;
            if($0 == 1 && positionX && positionY && !(stats.includes(text))){
                stats.push(text);
            }
            if(stats.length > 7){
                console.log(stats);
                if(respawn == true){
                    eg(); //play function
                }
                resetScript();
            }

        };
    }
    function resetScript(){
        stats = [];
        ASM_CONSTS[7315] = function($0, $1, $2, $3) {
            contexts[$0].strokeText(UTF8ToString($1), $2, $3);
        };
    }


})();