onlyfaucet.com

auto claim faucet

  1. // ==UserScript==
  2. // @name onlyfaucet.com
  3. // @namespace only auto
  4. // @version 0.55
  5. // @description auto claim faucet
  6. // @author gi2h
  7. // @run-at document-start
  8. // @match https://onlyfaucet.com/
  9. // @match https://onlyfaucet.com/faucet/currency/*
  10. // @match https://onlyfaucet.com/*
  11. // @match https://onlyfaucet.com/?r=12211
  12. // @match https://onlyfaucet.com/?r=
  13. // @grant none
  14. // @license MIT
  15. // @icon https://www.google.com/s2/favicons?sz=64&domain=freeltc.fun
  16. // ==/UserScript==
  17.  
  18. setInterval(function() {
  19. let c = document.querySelector("#subbutt") || document.querySelector("body > div.faucet-div.cl > form > div > input[type=submit]");
  20.  
  21. // Check if on a specific URL and click the button
  22. if (c) {
  23. c.scrollIntoView({ behavior: 'smooth', block: 'center' }); // Scroll to the button smoothly
  24. setTimeout(() => {
  25. c.click(); // Click the button after scrolling
  26. }, 300); // Wait for a brief moment before clicking
  27. }
  28.  
  29. // Check for the modal containing the Shortlink message
  30. let m = document.querySelector("#swal2-html-container");
  31. if (m && m.innerText.includes('You must complete at least 1 Shortlink to continue.')) {
  32. location.href = 'https://onlyfaucet.com/links/go/93/LTC';
  33. return; // Exit the interval after redirection
  34. }
  35.  
  36. // New logic for checking the URL and managing the query parameters
  37. const check_address = 'https://onlyfaucet.com'; // Base address for checking
  38. if (window.location.href == check_address ||
  39. window.location.href == (check_address + '/') ||
  40. window.location.href == (check_address + '/index.php')) {
  41.  
  42. setTimeout(function() {
  43. if (location.search !== '?r=12211') {
  44. location.search = '?r=12211'; // Update the query string to include your referral
  45. }
  46. }, 2000);
  47. }
  48.  
  49. if (location.search == '?r=12211') {
  50. setTimeout(function() {
  51. let button = document.querySelector('button[data-target="#login"]'); // Changed target to "login"
  52. if (button) {
  53. button.scrollIntoView({ behavior: 'smooth', block: 'center' }); // Scroll to the login button smoothly
  54. setTimeout(() => {
  55. button.click(); // Click the login button after scrolling
  56. }, 300); // Wait for a brief moment before clicking
  57. }
  58. setTimeout(function() {
  59. window.location.reload(); // Reload the page after 60 seconds
  60. }, 60000);
  61. }, 3000);
  62. }
  63.  
  64. }, 9000);
  65.  
  66. // Function to remove ads
  67. (function() {
  68. 'use strict';
  69. // Monitor DOM changes to remove dynamic ads
  70. let observer = new MutationObserver(removeAds);
  71. observer.observe(document.body, { childList: true, subtree: true });
  72.  
  73. // Common ad-related selectors
  74. const adSelectors = [
  75. 'iframe', // Removes iframes (commonly used for ads)
  76. '.ad', // Class 'ad'
  77. '.adsbygoogle', // Google ads
  78. '[id^="ad"]', // IDs starting with 'ad'
  79. '[class*="ad"]', // Any class containing 'ad'
  80. '.banner', // Banner ads
  81. '.sponsor', // Sponsored ads
  82. '.popup', // Pop-up ads
  83. '.advertisement' // Elements with 'advertisement' class
  84. ];
  85.  
  86. // Function to remove elements by selector
  87. function removeAds() {
  88. adSelectors.forEach(selector => {
  89. document.querySelectorAll(selector).forEach(adElement => adElement.remove());
  90. });
  91. console.log('Ads removed');
  92. }
  93.  
  94. // Run the function initially
  95. removeAds();
  96. })();
  97.  
  98. (function() {
  99. // Define the BoostTimers function
  100. function BoostTimers() {
  101. const FsT = window.setTimeout;
  102. const FsI = window.setInterval;
  103. Object.defineProperty(window, 'setTimeout', {
  104. value: function(func, delay) {
  105. if (delay === 1000) { delay = 50; }
  106. return FsT.apply(this, arguments);
  107. }
  108. });
  109. Object.defineProperty(window, 'setInterval', {
  110. value: function(func, delay) {
  111. if (delay === 1000) { delay = 50; }
  112. return FsI.apply(this, arguments);
  113. }
  114. });
  115. }
  116.  
  117. // Always apply BoostTimers
  118. BoostTimers();
  119. })();