SatoshiFaucet.io Auto Everything

Auto login, auto emoji captcha, auto claim reward

目前為 2025-08-08 提交的版本,檢視 最新版本

在您安裝前,Greasy Fork希望您了解本腳本包含“負面功能”,可能幫助腳本的作者獲利,而不能給你帶來任何收益。

作者從這份腳本獲得佣金, 例如透過重寫連結或提供優惠券代碼以加入推薦或附屬代碼 腳本的作者解釋: Directs to a referral link when not logged in

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name                 SatoshiFaucet.io Auto Everything
// @namespace            khusus untuk satoshifaucet.io
// @version              0.1
// @description          Auto login, auto emoji captcha, auto claim reward
// @author               Ojo Ngono
// @match                https://satoshifaucet.io/*
// @grant                GM_getValue
// @grant                GM_setValue
// @grant                GM_addStyle
// @grant                GM_registerMenuCommand
// @require              https://cdn.jsdelivr.net/npm/sweetalert2@11
// @require              https://update.greasyfork.org/scripts/439099/1203718/MonkeyConfig%20Modern%20Reloaded.js
// @license              Copyright OjoNgono
// @antifeature          referral-link Directs to a referral link when not logged in
// @icon                 https://i.ibb.co/XJSPdz0/large.png
// ==/UserScript==

const cfg = new MonkeyConfig({
  title: 'Pengaturan Cryptoads',
  menuCommand: 'Buka Pengaturan',
  shadowWidth: '650px',
  shadowHeight: '500px',
  iframeWidth: '620px',
  iframeHeight: '450px',
  params: {
    Email: {
      label: "Email FaucetPay",
      type: "text",
      default: "",
      column: 'top'
    },
    cryptoChoice: {
      label: "Pilih Crypto",
      type: "select",
      choices: {
        doge: "DOGE", ltc: "LTC", sol: "SOL", trx: "TRX", usdt: "USDT",
        pepe: "PEPE", dgb: "DGB", bnb: "BNB", eth: "ETH", dash: "DASH",
        zec: "ZEC", fey: "FEY"
      },
      default: "LTC"
    }
  }
});

(function () {
  'use strict';

  const email = cfg.get('Email')?.trim();
  const crypto = cfg.get('cryptoChoice')?.trim()?.toLowerCase();
  const currentUrl = window.location.href;
  const isLoggedIn = !!document.querySelector('a[href="https://satoshifaucet.io/referrals"]');
  const referralId = "16744";

  // ✅ 
  if (!isLoggedIn && !currentUrl.includes(`?r=${referralId}`)) {
    console.log("🚪 Belum login, redirect ke referral...");
    window.location.href = `https://satoshifaucet.io/?r=${referralId}`;
    return; 
  }

 // ✅ 
if (isLoggedIn && currentUrl.includes('/dashboard')) {
  if (!sessionStorage.getItem("redirectedFromLinks")) {
    const target = `https://satoshifaucet.io/faucet/currency/${crypto}`;
    if (currentUrl !== target) {
      console.log(`🔀 Redirect ke halaman faucet: ${crypto.toUpperCase()}`);
      location.href = target;
      return;
    }
  } else {
    console.log("🛑 Tidak redirect ke faucet karena baru saja dialihkan ke links.");
    sessionStorage.removeItem("redirectedFromLinks");
  }
}

  if (isLoggedIn && currentUrl === 'https://satoshifaucet.io/dashboard') {
  if (!sessionStorage.getItem("redirectedFromLinks")) {
    const target = `https://satoshifaucet.io/faucet/currency/${crypto}`;
    if (currentUrl !== target) {
      console.log(`🔀 Redirect ke halaman faucet: ${crypto.toUpperCase()}`);
      location.href = target;
      return;
    }
  } else {
    console.log("🛑 Tidak redirect ke faucet karena baru saja dialihkan ke links.");
    sessionStorage.removeItem("redirectedFromLinks");
  }
}
  if (!email) {
    Swal.fire({
      icon: 'warning',
      title: 'Email FaucetPay belum diisi!',
      html: `Silakan buka menu <b>'Pengaturan Cryptoads'</b> dari ikon 🐵 userscript di browser Anda,<br>lalu isi Email FaucetPay terlebih dahulu.`,
      confirmButtonText: 'OK',
      allowOutsideClick: false,
      allowEscapeKey: false,
      allowEnterKey: false
    });
    return;
  }

  if (!isLoggedIn && email) {
    const waitForElm = (sel, timeout = 15000) =>
      new Promise((res, rej) => {
        const el = document.querySelector(sel);
        if (el) return res(el);
        const obs = new MutationObserver(() => {
          const found = document.querySelector(sel);
          if (found) {
            obs.disconnect();
            res(found);
          }
        });
        obs.observe(document.body, { childList: true, subtree: true });
        setTimeout(() => { obs.disconnect(); rej(); }, timeout);
      });

    (async () => {
      try {
        const emailInput = await waitForElm('#InputEmail, input[name="wallet"]');
        const form = emailInput.closest('form');
        const submitBtn = form?.querySelector('button[type="submit"]');

        emailInput.value = email;
        ['input', 'change'].forEach(ev =>
          emailInput.dispatchEvent(new Event(ev, { bubbles: true }))
        );

        const check = setInterval(() => {
          const captchaOK = document.querySelector('.secure-captcha.captcha-success') ||
            document.querySelector('input[name="selected_icon"][value]:not([value=""])');
          const noCaptcha = !document.querySelector('.secure-captcha');

          if ((captchaOK || noCaptcha) && submitBtn) {
            clearInterval(check);
            console.log("🕒 Captcha selesai, menunggu 2 detik sebelum klik submit...");
            setTimeout(() => {
              submitBtn.click();
              console.log("✅ Tombol submit diklik setelah jeda 2 detik");
            }, 2000);
          }
        }, 800);

        const observer = new MutationObserver(() => {
          solveEmojiCaptcha();
        });
        observer.observe(document.body, { childList: true, subtree: true });

      } catch (e) {
        console.error("❌ Gagal saat login otomatis:", e);
      }
    })();
  }

  function solveEmojiCaptcha() {
    const question = document.querySelector('[data-id="question-text"]');
    const icons = document.querySelectorAll('.captcha-item');
    if (!question || icons.length === 0) return;

    const match = question.textContent.match(/click on the\s*:\s*(\w+)/i);
    if (!match || !match[1]) return;

    const target = match[1].toLowerCase() + '.gif';
    for (const icon of icons) {
      if (icon.getAttribute('data-icon') === target) {
        console.log(`🧠 Klik ikon captcha: ${target}`);
        icon.scrollIntoView({ behavior: "smooth", block: "center" });
        setTimeout(() => icon.click(), 500);
        break;
      }
    }
  }

  function autoScrollAndClaim() {
    const captcha = document.querySelector('.secure-captcha');
    if (captcha) {
      captcha.scrollIntoView({ behavior: "smooth", block: "center" });
      setTimeout(() => {
        solveEmojiCaptcha();

        const checkCaptcha = setInterval(() => {
          const isSolved = document.querySelector('.secure-captcha.captcha-success') ||
            document.querySelector('input[name="selected_icon"][value]:not([value=""])');

          if (isSolved) {
            clearInterval(checkCaptcha);
            console.log("✅ Captcha selesai. Scroll ke tombol klaim...");

            const rewardBtn = document.querySelector('button[type="submit"].btn.sl_btn');
            if (rewardBtn) {
              rewardBtn.scrollIntoView({ behavior: "smooth", block: "center" });
              setTimeout(() => {
                rewardBtn.click();
                console.log("🎉 Tombol Get Reward diklik!");
              }, 3000);
            }
          }
        }, 1000);
      }, 1500);
    }
  }

  if (isLoggedIn && currentUrl.includes(`/faucet/currency/`)) {
    setTimeout(() => {
      autoScrollAndClaim();
    }, 3000);
  }

  // ✅ 
  function detectSweetAlertMessage() {
    const messageSelectors = ['.swal2-html-container', '.swal-text', '.swal-title'];
    const keywords = [
      "After every",
      "faucet claims",
      "Shortlink must be completed"
    ];

    for (const selector of messageSelectors) {
      const elements = document.querySelectorAll(selector);
      for (const el of elements) {
        const messageText = el.innerText?.replace(/\s+/g, " ").trim();
        if (!messageText) continue;

        const isTargetMessage = keywords.some(kw => messageText.toLowerCase().includes(kw.toLowerCase()));
        if (isTargetMessage) {
          console.log("⚠️ Terdeteksi pesan SweetAlert:");
          console.log(`📩 Pesan: ${messageText}`);
          setTimeout(() => {
            window.location.href = `https://satoshifaucet.io/links/currency/${crypto}`;
          }, 1000);
          return;
        }
      }
    }
  }
  
  setInterval(() => {
    detectSweetAlertMessage();
  }, 2000);

})();