Auto Click (mobile)

Auto click enter on mobile

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Auto Click (mobile)
// @description  Auto click enter on mobile
// @version      1.1
// @include      https://*/game.php*
// @namespace https://greasyfork.org/users/1388899
// ==/UserScript==
 
(function() {
 
    'use strict';
 
    // Create button
 
    let button = document.createElement("button");
 
    button.innerText = "Start";
 
    button.style.position = "fixed";
 
    button.style.bottom = "20px";
 
    button.style.left = "20px";
 
    button.style.padding = "8px 8px";
 
    button.style.fontSize = "13px";
 
    button.style.zIndex = "1000";
 
    button.style.backgroundColor = "#4CAF50";
 
    button.style.color = "white";
 
    button.style.border = "none";
 
    button.style.borderRadius = "5px";
 
    button.style.cursor = "pointer";
 
    document.body.appendChild(button);
 
    let isRunning = false;
 
    let intervalId;
 
    function pressEnterRandomly() {
 
        const randomDelay = Math.floor(Math.random() * (350 - 200 + 1)) + 200; // Random delay between 200-350 ms
 
        document.dispatchEvent(new KeyboardEvent('keydown', {
 
            key: 'Enter',
 
            code: 'Enter',
 
            which: 13,
 
            keyCode: 13,
 
            bubbles: true
 
        }));
 
        intervalId = setTimeout(pressEnterRandomly, randomDelay);
 
    }
 
    // Toggle the Enter key press on and off
 
    button.addEventListener("click", function() {
 
        if (isRunning) {
 
            clearTimeout(intervalId);
 
            button.innerText = "Start";
 
            isRunning = false;
 
        } else {
 
            pressEnterRandomly();
 
            button.innerText = "Stop";
 
            isRunning = true;
 
        }
 
    });
 
})();