Greasy Fork 还支持 简体中文。

BlockPulse Auto Login + Auto Start

Auto login + auto start with logout recovery and performance optimization

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         BlockPulse Auto Login + Auto Start
// @namespace    https://tampermonkey.net/
// @version      1.8
// @description  Auto login + auto start with logout recovery and performance optimization
// @author       Rubystance
// @license      MIT
// @match        https://blockpulse.fun/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const EMAIL = 'YOUR_FAUCETPAY_EMAIL_HERE'; // << YOUR_FAUCETPAY_EMAIL

    function optimizePerformance() {
        if (document.getElementById('bp-perf-style')) return;

        const style = document.createElement('style');
        style.id = 'bp-perf-style';
        style.textContent = `
            * {
                transition-duration: 0ms !important;
                animation-duration: 0ms !important;
                animation-delay: 0ms !important;
            }
            body {
                scroll-behavior: auto !important;
            }
            canvas, video, .particles, .background {
                display: none !important;
            }
        `;
        document.head.appendChild(style);
        console.log('[BlockPulse] Performance otimizada.');
    }

    const waitFor = (fn, timeout = 30000, interval = 300) =>
        new Promise((resolve, reject) => {
            const start = Date.now();
            const timer = setInterval(() => {
                const res = fn();
                if (res) {
                    clearInterval(timer);
                    resolve(res);
                }
                if (Date.now() - start > timeout) {
                    clearInterval(timer);
                    reject();
                }
            }, interval);
        });

    async function handleLogin() {
        const emailInput = document.querySelector('input[type="email"][name="email"]');
        const submitBtn = document.querySelector('button[type="submit"].btn.btn-black');

        if (!emailInput || !submitBtn) return;

        if (emailInput.value !== EMAIL) {
            emailInput.focus();
            emailInput.value = EMAIL;
            emailInput.dispatchEvent(new Event('input', { bubbles: true }));
            console.log('[BlockPulse] Email preenchido.');
        }

        submitBtn.click();
        console.log('[BlockPulse] Login enviado.');
    }

    async function handleDashboard() {
        const startBtn = document.querySelector('button.btn-black.btn-sm-custom');

        if (!startBtn) return;

        if (startBtn.disabled) return;

        startBtn.click();
        console.log('[BlockPulse] Start clicado.');
    }

    function startWatcher() {
        optimizePerformance();

        setInterval(() => {
            if (location.pathname === '/' || location.pathname === '') {
                handleLogin();
            }

            if (location.pathname === '/dashboard') {
                handleDashboard();
            }
        }, 1500);
    }

    window.addEventListener('load', () => {
        startWatcher();
        console.log('[BlockPulse] Script ativo.');
    });

})();