PepeHash Auto Collect

Auto-collect on dashboard

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         PepeHash Auto Collect
// @namespace    https://tampermonkey.net/
// @version      1.0
// @description  Auto-collect on dashboard
// @author       Rubystance
// @license      MIT
// @match        https://pepehash.lovable.app/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const REF_CODE = '75C5B8B7';
    const REF_KEY = 'pepehash_ref_used';

    if (!localStorage.getItem(REF_KEY)) {
        localStorage.setItem(REF_KEY, 'true');
        if (!location.search.includes('ref=')) {
            location.replace(`https://pepehash.lovable.app/?ref=${REF_CODE}`);
            return;
        }
    }

    function observeCollectButton() {
        const observer = new MutationObserver(() => {
            document.querySelectorAll('button').forEach(btn => {
                if (
                    btn.textContent.includes('Collect') &&
                    !btn.disabled
                ) {
                    btn.click();
                    console.log('Collect button clicked!');
                }
            });
        });

        observer.observe(document.body, { childList: true, subtree: true, attributes: true });
    }

    if (location.pathname.startsWith('/dashboard')) {
        observeCollectButton();
    }

    let lastUrl = location.href;
    setInterval(() => {
        if (location.href !== lastUrl) {
            lastUrl = location.href;
            if (location.pathname.startsWith('/dashboard')) {
                observeCollectButton();
            }
        }
    }, 500);

})();