auto faucet Fastfaucet.site

Automatically Login and auto faucet

  1. // ==UserScript==
  2. // @name auto faucet Fastfaucet.site
  3. // @namespace tampermonkey
  4. // @version 0.1
  5. // @description Automatically Login and auto faucet
  6. // @author alialigood
  7. // @grant GM_getValue
  8. // @grant GM_setValue
  9. // @grant GM_addStyle
  10. // @grant GM_registerMenuCommand
  11. // @match https://fastfaucet.site/*
  12. // @icon https://i.ibb.co/XJSPdz0/large.png
  13. // ==/UserScript==
  14.  
  15. (function () {
  16. 'use strict';
  17.  
  18. // Manually set your email address here
  19. const email = 'your_email@example.com'; // Replace with your email
  20.  
  21. window.addEventListener('load', () => {
  22. console.log("Script loaded!");
  23.  
  24. if (!email) {
  25. enforceLogoutWithWarning();
  26. return;
  27. }
  28. if (!isValidEmail(email)) {
  29. alert('Invalid email address. Please check your configuration.');
  30. enforceLogoutWithWarning();
  31. return;
  32. }
  33.  
  34. if (isLoggedIn()) {
  35. if (window.location.href === "https://fastfaucet.site/") {
  36. window.location.replace("https://fastfaucet.site/faucet/currency/dgb");
  37. }
  38. return;
  39. }
  40.  
  41. setTimeout(() => {
  42. enforceReferralUrl(() => {
  43. fillEmailField(email);
  44. setTimeout(() => {
  45. clickLoginButton();
  46. }, 2000);
  47. });
  48. }, 1000);
  49. });
  50.  
  51. function isLoggedIn() {
  52. const userDropdown = document.querySelector('.nav-item.dropdown.no-arrow');
  53. const userIcon = document.querySelector('i.fas.fa-user-circle.fa-2x');
  54. return userDropdown && userIcon;
  55. }
  56.  
  57. function isValidEmail(email) {
  58. const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
  59. return emailRegex.test(email);
  60. }
  61.  
  62. function enforceLogoutWithWarning() {
  63. if (isLoggedIn()) {
  64. alert('Please enter your email in the settings menu before using MY SCRIPT.');
  65. const logoutButton = document.querySelector('a[href="https://fastfaucet.site/auth/logout"]');
  66. if (logoutButton) {
  67. logoutButton.click();
  68. } else {
  69. window.location.replace("https://fastfaucet.site/auth/logout");
  70. }
  71. }
  72. }
  73.  
  74. function enforceReferralUrl(callback) {
  75. if (!window.location.href.includes("?r=788")) {
  76. window.location.replace("https://fastfaucet.site/?r=788");
  77. setTimeout(callback, 1000);
  78. } else {
  79. callback();
  80. }
  81. }
  82.  
  83. function fillEmailField(email) {
  84. const emailInput = document.querySelector('input[type="email"]');
  85. if (emailInput) {
  86. emailInput.value = email;
  87. emailInput.dispatchEvent(new Event('input', { bubbles: true }));
  88. }
  89. }
  90.  
  91. function clickLoginButton() {
  92. const loginButton = document.querySelector('button[type="submit"].btn-user');
  93. if (loginButton) loginButton.click();
  94. }
  95.  
  96. function checkAndClickTryAgain() {
  97. const networkErrorMessage = document.querySelector('h2.title-xl-grad');
  98. const tryAgainButton = document.querySelector('.btn.btn-primary');
  99. if (networkErrorMessage && tryAgainButton && networkErrorMessage.textContent.trim() === "Network Error") {
  100. tryAgainButton.click();
  101. }
  102. }
  103.  
  104. const observer = new MutationObserver(() => {
  105. checkAndClickTryAgain();
  106. });
  107.  
  108. observer.observe(document.body, { childList: true, subtree: true });
  109.  
  110. function clickOkButtonAfterDelay() {
  111. const okButton = document.querySelector('.swal2-confirm');
  112. if (okButton) {
  113. setTimeout(() => {
  114. okButton.click();
  115. }, 2000);
  116. }
  117. }
  118.  
  119. clickOkButtonAfterDelay();
  120. })();
  121.  
  122. (function() {
  123. if (window.location.href.includes("https://fastfaucet.site/faucet/currency/")) {
  124. (function() {
  125. if (document.getElementById("form-captcha") === null) {
  126. setTimeout(function() {
  127. document.getElementsByTagName("form")[0].submit();
  128. }, 1000);
  129. }
  130. })();
  131. }
  132. })();