Additional script for faucetme.xyz

Additional script for faucetme.xyz to Reload the page if HCaptcha is detected, handle Turnstile and reCAPTCHA on Firewall

As of 2024-12-10. See the latest version.

  1. // ==UserScript==
  2. // @name Additional script for faucetme.xyz
  3. // @namespace Tamper & Violent & Others Monkey
  4. // @version 0.1
  5. // @description Additional script for faucetme.xyz to Reload the page if HCaptcha is detected, handle Turnstile and reCAPTCHA on Firewall
  6. // @author Ojo Ngono
  7. // @match https://faucetme.xyz/firewall
  8. // @grant none
  9. // @license Copyright OjoNgono
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. if (window.location.href.includes("https://faucetme.xyz/firewall")) {
  16.  
  17. function detectHCaptcha() {
  18. let hcaptchaFrame = document.querySelector("iframe[src*='hcaptcha.com']");
  19. return !!hcaptchaFrame;
  20. }
  21.  
  22. function checkTurnstile() {
  23. let turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
  24. return turnstileResponse && turnstileResponse.value !== '';
  25. }
  26.  
  27. function checkRecaptcha() {
  28. let recaptchaFrame = document.querySelector("iframe[title='reCAPTCHA']");
  29. if (recaptchaFrame) {
  30. return window.grecaptcha && window.grecaptcha.getResponse().length !== 0;
  31. }
  32. return false;
  33. }
  34.  
  35. function clickUnlock() {
  36. let unlockButton = document.querySelector('button.btn.btn-primary.w-md');
  37. if (unlockButton && unlockButton.innerText.includes('Unlock')) {
  38. unlockButton.click();
  39. }
  40. }
  41.  
  42. setInterval(() => {
  43. if (detectHCaptcha()) {
  44. console.log("HCaptcha detected! Reloading the page...");
  45. location.reload();
  46. } else if (checkTurnstile() || checkRecaptcha()) {
  47. clickUnlock();
  48. }
  49. }, 2000);
  50. }
  51. })();