Sigmally Macros

Macro for sigmally

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Sigmally Macros
// @version      1
// @description  Macro for sigmally
// @author       Cursed
// @match        *://sigmally.com/*
// @match        *://beta.sigmally.com/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=sigmally.com
// @run-at       document-end
// @license      MIT
// @namespace https://greasyfork.org/users/1219775
// ==/UserScript==

(function() {
    'use strict';
    let ff = null;
    let keydown = false;

    function keypress(key, keycode) {
        const keyDownEvent = new KeyboardEvent("keydown", { key: key, code: keycode });
        const keyUpEvent = new KeyboardEvent("keyup", { key: key, code: keycode });

        window.dispatchEvent(keyDownEvent);
        window.dispatchEvent(keyUpEvent);
    }
    function feed() {
        let x = 15;
        while (x--) {
            keypress("w", "KeyW");
        }
    }

    document.addEventListener("keyup", (e) => {
        const key = e.key.toLowerCase();
        if (key == "w" && keydown) {
            clearInterval(ff);
            keydown = false;
        }
    });

    document.addEventListener("keydown", (e) => {
        const key = e.key.toLowerCase();

        if (key == "w" && !keydown) {
            keydown = true;
            ff = setInterval(feed, 50);
        }
    });
})();