onlyfaucet.com

auto claim faucet

当前为 2024-10-15 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         onlyfaucet.com
// @namespace    only auto
// @version      0.55
// @description  auto claim faucet
// @author       gi2h
// @run-at       document-start
// @match        https://onlyfaucet.com/
// @match        https://onlyfaucet.com/faucet/currency/*
// @match        https://onlyfaucet.com/*
// @match        https://onlyfaucet.com/?r=12211
// @match        https://onlyfaucet.com/?r=
// @grant        none
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=freeltc.fun
// ==/UserScript==

setInterval(function() {
    let c = document.querySelector("#subbutt") || document.querySelector("body > div.faucet-div.cl > form > div > input[type=submit]");

    // Check if on a specific URL and click the button
    if (c) {
        c.scrollIntoView({ behavior: 'smooth', block: 'center' }); // Scroll to the button smoothly
        setTimeout(() => {
            c.click(); // Click the button after scrolling
        }, 300); // Wait for a brief moment before clicking
    }

    // Check for the modal containing the Shortlink message
    let m = document.querySelector("#swal2-html-container");
    if (m && m.innerText.includes('You must complete at least 1 Shortlink to continue.')) {
        location.href = 'https://onlyfaucet.com/links/go/93/LTC';
        return; // Exit the interval after redirection
    }

    // New logic for checking the URL and managing the query parameters
    const check_address = 'https://onlyfaucet.com'; // Base address for checking
    if (window.location.href == check_address ||
        window.location.href == (check_address + '/') ||
        window.location.href == (check_address + '/index.php')) {

        setTimeout(function() {
            if (location.search !== '?r=12211') {
                location.search = '?r=12211'; // Update the query string to include your referral
            }
        }, 2000);
    }

    if (location.search == '?r=12211') {
        setTimeout(function() {
            let button = document.querySelector('button[data-target="#login"]'); // Changed target to "login"
            if (button) {
                button.scrollIntoView({ behavior: 'smooth', block: 'center' }); // Scroll to the login button smoothly
                setTimeout(() => {
                    button.click(); // Click the login button after scrolling
                }, 300); // Wait for a brief moment before clicking
            }
            setTimeout(function() {
                window.location.reload(); // Reload the page after 60 seconds
            }, 60000);
        }, 3000);
    }

}, 9000);

// Function to remove ads
(function() {
    'use strict';
    // Monitor DOM changes to remove dynamic ads
    let observer = new MutationObserver(removeAds);
    observer.observe(document.body, { childList: true, subtree: true });

    // Common ad-related selectors
    const adSelectors = [
        'iframe', // Removes iframes (commonly used for ads)
        '.ad', // Class 'ad'
        '.adsbygoogle', // Google ads
        '[id^="ad"]', // IDs starting with 'ad'
        '[class*="ad"]', // Any class containing 'ad'
        '.banner', // Banner ads
        '.sponsor', // Sponsored ads
        '.popup', // Pop-up ads
        '.advertisement' // Elements with 'advertisement' class
    ];

    // Function to remove elements by selector
    function removeAds() {
        adSelectors.forEach(selector => {
            document.querySelectorAll(selector).forEach(adElement => adElement.remove());
        });
        console.log('Ads removed');
    }

    // Run the function initially
    removeAds();
})();

 (function() {
    // Define the BoostTimers function
    function BoostTimers() {
        const FsT = window.setTimeout;
        const FsI = window.setInterval;
        Object.defineProperty(window, 'setTimeout', {
            value: function(func, delay) {
                if (delay === 1000) { delay = 50; }
                return FsT.apply(this, arguments);
            }
        });
        Object.defineProperty(window, 'setInterval', {
            value: function(func, delay) {
                if (delay === 1000) { delay = 50; }
                return FsI.apply(this, arguments);
            }
        });
    }

    // Always apply BoostTimers
    BoostTimers();
})();