Greasy Fork

Greasy Fork is available in English.

AutoLitecoin

Auto login and faucet

当前为 2023-11-30 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         AutoLitecoin
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Auto login and faucet
// @author       White
// @match        https://autolitecoin.xyz/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=autolitecoin.xyz
// @grant        none
// ==/UserScript==

(async function() {
    'use strict';

    const handlePageRedirection = () => {
        const url = window.location.href;

        if (url === 'https://autolitecoin.xyz' || url === 'https://autolitecoin.xyz/') {
            window.location.href = 'https://autolitecoin.xyz/login';
        } else if (url === 'https://autolitecoin.xyz/dashboard') {
            window.location.href = 'https://autolitecoin.xyz/faucet';
        }
    };

    const waitForElement = async (selector) => {
        while (!document.querySelector(selector)) {
            await new Promise(resolve => requestAnimationFrame(resolve));
        }
        return document.querySelector(selector);
    };

    const preencherCampos = async () => {
        const [emailInput, passwordInput] = await Promise.all([waitForElement('#email'), waitForElement('#password')]);

        if (emailInput && passwordInput) {
            emailInput.value = 'email';
            passwordInput.value = 'senha';

            await waitForCaptchaCompletion();

            clicarBotaoLogin();
        }
    };

    const clicarBotaoLogin = () => {
        const signInButton = document.querySelector('button.btn-submit.w-100');

        if (signInButton) {
            signInButton.dispatchEvent(new MouseEvent('click'));
        }
    };

    const waitForCaptchaCompletion = async () => {
        while (!(grecaptcha && grecaptcha.getResponse().length > 0)) {
            await new Promise(resolve => setTimeout(resolve, 100));
        }
        clicarBotaoLogin();
    };

    const executeScript = async () => {
        handlePageRedirection();

        if (window.location.href.includes('https://autolitecoin.xyz/login')) {
            await preencherCampos();
        }
    };

    await executeScript();

    let hasClicked = false;

    function mbsolver() {
        const divAntibotLinks = document.querySelectorAll('div.antibotlinks a[style="display: none;"]');
        return divAntibotLinks.length === 3;
    }

    function wasButtonClicked() {
        return localStorage.getItem('buttonClicked') === 'true';
    }

    function setButtonClicked() {
        localStorage.setItem('buttonClicked', 'true');
    }

    function removeButtonClicked() {
        localStorage.removeItem('buttonClicked');
    }

    if (wasButtonClicked()) {
        removeButtonClicked();
        window.location.href = 'https://autolitecoin.xyz/faucet';
    }
let gpcaptcha = document.querySelector('input#captcha_choosen');
    setInterval(function() {
        const grecaptchaResponse = (window.grecaptcha && window.grecaptcha.getResponse) ? window.grecaptcha.getResponse() : null;
        const divAntibotLinks = document.querySelectorAll('div.antibotlinks a[style="display: none;"]');

        if (window.location.href.includes("/faucet") && gpcaptcha && gpcaptcha.value.length > 0 && mbsolver() && !wasButtonClicked()) {
            const submitButton = document.querySelector('button.btn.btn-success.btn-lg.claim-button');
            if (submitButton) {
                submitButton.click();
                setButtonClicked();
            }
        }
    }, 3000);
})();