BlockPulse Auto Start

Fills email, starts earning and clicks Start on dashboard once per session

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         BlockPulse Auto Start
// @namespace    https://tampermonkey.net/
// @version      1.7
// @description  Fills email, starts earning and clicks Start on dashboard once per session
// @author       Rubystance
// @license      MIT
// @match        https://blockpulse.fun/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

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

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

    async function handleHome() {
        if (sessionStorage.getItem('bp_home_done')) return;

        const emailInput = await waitFor(() =>
            document.querySelector('input[type="email"][name="email"]')
        );

        emailInput.focus();
        emailInput.value = EMAIL;
        emailInput.dispatchEvent(new Event('input', { bubbles: true }));

        const submitBtn = await waitFor(() =>
            document.querySelector('button[type="submit"].btn.btn-black')
        );

        submitBtn.click();
        sessionStorage.setItem('bp_home_done', 'true');
    }

    async function handleDashboard() {
        if (sessionStorage.getItem('bp_dashboard_done')) return;

        const startBtn = await waitFor(() =>
            document.querySelector('button.btn-black.btn-sm-custom')
        );

        startBtn.click();
        sessionStorage.setItem('bp_dashboard_done', 'true');
    }

    (async function main() {
        if (location.pathname === '/' || location.pathname === '') {
            await handleHome();
        }

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

})();