您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Auto claim faucet with captcha detection, real clicks, dropdown navigation, and error handling on coinadster.com faucet page
// ==UserScript== // @name CnAD // @namespace http://tampermonkey.net/ // @version 1.8 // @description Auto claim faucet with captcha detection, real clicks, dropdown navigation, and error handling on coinadster.com faucet page // @author 👽 // @match https://coinadster.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const CLAIM_BUTTON_SELECTOR = 'button[name="claim_faucet"].btn-primary'; const RECAPTCHA_TEXTAREA = 'textarea[name="g-recaptcha-response"]'; const HCAPTCHA_TEXTAREA = 'textarea[name="h-captcha-response"]'; const DROPDOWN_SELECTOR = 'a#dropdown.nav-link'; const FAUCET_LINK_SELECTOR = 'a.dropdown-item[href="https://coinadster.com"]'; const ERROR_SELECTOR = '.rc-anchor-center-item.rc-anchor-error-message'; const WAIT_BETWEEN_CLAIMS = 320000; // 5 min 20 sec let claimInProgress = false; function isCaptchaPresent() { return !!document.querySelector(RECAPTCHA_TEXTAREA) || !!document.querySelector(HCAPTCHA_TEXTAREA); } function isCaptchaSolved() { const recaptcha = document.querySelector(RECAPTCHA_TEXTAREA); const hcaptcha = document.querySelector(HCAPTCHA_TEXTAREA); return (recaptcha && recaptcha.value.trim() !== '') || (hcaptcha && hcaptcha.value.trim() !== ''); } function realClick(element) { if (!element) return; ['mouseover', 'mousedown', 'mouseup', 'click'].forEach(eventType => { element.dispatchEvent(new MouseEvent(eventType, { view: window, bubbles: true, cancelable: true, buttons: 1 })); }); } function checkForCaptchaError() { const errorElement = document.querySelector(ERROR_SELECTOR); if (errorElement && errorElement.textContent.includes('Invalid site key')) { console.warn('Captcha error detected: Invalid site key. Refreshing in 10 seconds...'); setTimeout(() => { window.location.reload(); }, 10000); return true; } return false; } async function claimCycle() { if (claimInProgress) return; claimInProgress = true; await new Promise(r => setTimeout(r, 12000)); // wait 12 sec if (checkForCaptchaError()) { return; // stop claim cycle to avoid stacking if error is present } if (!isCaptchaPresent()) { const btn = document.querySelector(CLAIM_BUTTON_SELECTOR); realClick(btn); } else { while (!isCaptchaSolved()) { if (checkForCaptchaError()) return; await new Promise(r => setTimeout(r, 1000)); } await new Promise(r => setTimeout(r, 5000)); const btn = document.querySelector(CLAIM_BUTTON_SELECTOR); realClick(btn); } await new Promise(r => setTimeout(r, WAIT_BETWEEN_CLAIMS)); claimInProgress = false; claimCycle(); } claimCycle(); setInterval(() => { if (checkForCaptchaError()) return; if (isCaptchaPresent()) return; const dropdown = document.querySelector(DROPDOWN_SELECTOR); const faucetLink = document.querySelector(FAUCET_LINK_SELECTOR); if (dropdown) { realClick(dropdown); setTimeout(() => { if (faucetLink) { realClick(faucetLink); } }, 2000); } }, 60000); })();