Gota.io Macros By ReF and split

some macros for gota and spolit 16

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Gota.io Macros By ReF and split
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  some macros for gota and spolit 16
// @author       ReF
// @match        http://gota.io/web/*
// @grant        none
// ==/UserScript==
 
(function() {
    'use strict';
 
    var timeoutId;
    var isHeld = false;
   
function splitST() {
 $(document).trigger({type: 'keydown', which: 69, keyCode: 69});
    $(document).trigger({type: 'keydown', which: 69, keyCode: 69});
    $(document).trigger({type: 'keydown', which: 69, keyCode: 69});
    $(document).trigger({type: 'keydown', which: 69, keyCode: 69});
}
 
    function macroFeed() {
        if (isHeld) {
        $(document).trigger({type: 'keydown', which: 69, keyCode: 69});
            console.log("mousehold");
        } else $(document).trigger({type: 'keyup', which: 69, keyCode: 69});
    }
   
     document.addEventListener('keydown', function(event) {
            if (event.keyCode == 16) {
                console.log("shift");
splitST();
            }
    }, false);
   
$('canvas').on('mousedown mouseup', function mouseState(e) {
    if (e.type == "mousedown") {
        isHeld = true;
    } else isHeld = false;
});
    setInterval(macroFeed,10);
})();

(function() {
    var amount = 6;
    var duration = 50; //ms

    var overwriting = function(evt) {
        if (evt.keyCode === 82) { // KEY_Z
            for (var i = 0; i < amount; ++i) {
                setTimeout(function() {
                    window.onkeydown({keyCode: 32}); // KEY_SPACE
                    window.onkeyup({keyCode: 32});
                }, i * duration);
            }
        }
    };

    window.addEventListener('keydown', overwriting);
})();