onlyfaucet.com

auto claim faucet

目前為 2024-10-15 提交的版本,檢視 最新版本

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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();
})();