Fastsplit and Bubble Cells Script

try to take over the agma/cellcarft servers!

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo 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!)

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!)

/// ==UserScript==
// @name         Fastsplit and Bubble Cells Script
// @version      0.5.4
// @description  try to take over the agma/cellcarft servers!
// @author       Mhero
// @match        https://agma.io/*
// @match        https://cellcraft.io/*
// @grant        none
// @namespace https://greasyfork.org/users/469080
// ==/UserScript==

// Notes:
// Only change Key or Key2.
// Freeze required.
// Onesplit has to be on Space.

var key = "R" // Normal
var key2 = "T" // Double
var key4 = "U" // triple
var doubleSplitKey
var freezeKey

window.addEventListener('keydown', keydown);

setTimeout(function() {
    key = key.charCodeAt(0)
    key2 = key2.charCodeAt(0)
    key4 = key4.charCodeAt(0)

    doubleSplitKey = document.getElementById("keyDoubleSplit").innerHTML.charCodeAt(0)
    freezeKey = document.getElementById("keyFreezeSelf").innerHTML.charCodeAt(0)
    console.log("Fastsplit Script active.")
}, 5000)

function oneSplit() {
    $("#canvas").trigger($.Event("keydown", { keyCode: 32}));
    $("#canvas").trigger($.Event("keyup", { keyCode: 32}));
}

function doubleSplit() {
    $("#canvas").trigger($.Event("keydown", { keyCode: doubleSplitKey}));
    $("#canvas").trigger($.Event("keyup", { keyCode: doubleSplitKey}));
}
function tripleSplit(){
    $("#canvas").trigger($.Event("keydown", { keyCode: 86}));
    $("#canvas").trigger($.Event("keyup", { keyCode: 86}));
}
function freeze() {
    $("#canvas").trigger($.Event("keydown", { keyCode: freezeKey}));
    $("#canvas").trigger($.Event("keyup", { keyCode: freezeKey}));
}


function keydown(event) {
    if (document.activeElement.type == 'text' || document.activeElement.type == 'password') {
        return;
    }
    if (event.keyCode == key) {
        oneSplit()
        setTimeout(freeze, 40)
        setTimeout(freeze, 115)
        console.log("Fastsplit")
    }
    if (event.keyCode == key2) {
        doubleSplit()
        setTimeout(freeze, 70)
        setTimeout(freeze, 145)
        console.log("DoubleFastsplit")
    }
    if(event.keyCode == key4){
        tripleSplit()
        setTimeout(freeze, 100)
        setTimeout(freeze, 165)
    }
    if(event.keyCode == 190){
    document.getElementById("cBubbleCells").dispatchEvent(new MouseEvent("click"));
    }
}