Linksfly.link auto faucet (not working)

Automatically Login and Click Faucet

  1. // ==UserScript==
  2. // @name Linksfly.link auto faucet (not working)
  3. // @namespace bekerja pada tampermonkey maupun violentmonkey
  4. // @version 0.3
  5. // @description Automatically Login and Click Faucet
  6. // @author Ojo Ngono
  7. // @grant GM_getValue
  8. // @grant GM_setValue
  9. // @grant GM_addStyle
  10. // @grant GM_registerMenuCommand
  11. // @require https://update.greatest.deepsurf.us/scripts/439099/1203718/MonkeyConfig%20Modern%20Reloaded.js
  12. // @match https://linksfly.link/*
  13. // @license Copyright OjoNgono
  14. // @antifeature referral-link Directs to a referral link when not logged in
  15. // ==/UserScript==
  16.  
  17. const cfg = new MonkeyConfig({
  18. title: 'Input Email Faucetpay:',
  19. menuCommand: true,
  20. params: {
  21. Email: {
  22. label: "Email Faucetpay",
  23. type: "text",
  24. default: ''
  25. },
  26. }
  27. });
  28.  
  29. (function() {
  30. 'use strict';
  31.  
  32. window.addEventListener('load', () => {
  33. const email = cfg.get('Email');
  34. if (!email || email.trim() === '') {
  35. enforceLogoutWithWarning();
  36. } else {
  37. enforceReferralUrl();
  38. setTimeout(() => {
  39. if (isLoggedIn()) {
  40. fillEmailField(email);
  41. rotateUrls();
  42. }
  43. }, 1000);
  44. }
  45. });
  46.  
  47. function isLoggedIn() {
  48. const userDropdownButton = document.querySelector('#page-header-user-dropdown');
  49. return userDropdownButton !== null;
  50. }
  51.  
  52. function enforceLogoutWithWarning() {
  53. if (isLoggedIn()) {
  54. alert('Please enter your email in the settings menu before using MY SCRIPT.');
  55. const logoutButton = document.querySelector('a[href="https://linksfly.link/auth/logout"]');
  56. if (logoutButton) {
  57. logoutButton.click();
  58. } else {
  59. window.location.replace("https://linksfly.link/auth/logout");
  60. }
  61. }
  62. }
  63.  
  64. function enforceReferralUrl() {
  65. if (window.location.href.startsWith("https://linksfly.link") && !window.location.href.includes("?r=2194")) {
  66. if (!isLoggedIn()) {
  67. window.location.replace("https://linksfly.link/?r=2194");
  68. }
  69. }
  70. }
  71.  
  72. function fillEmailField(email) {
  73. const emailInput = document.querySelector('input[type="email"]');
  74. if (emailInput) {
  75. emailInput.value = email;
  76. emailInput.dispatchEvent(new Event('input', { bubbles: true }));
  77. }
  78. }
  79.  
  80. function isTurnstileCompleted() {
  81. return document.querySelector('input[name="cf-turnstile-response"]')?.value !== "";
  82. }
  83.  
  84. function isEmailFilled() {
  85. const emailField = document.querySelector('input[type="email"]');
  86. return emailField && emailField.value.trim() !== "";
  87. }
  88.  
  89. function clickLoginButton() {
  90. const loginButton = document.querySelector('button[type="submit"].btn-user');
  91. if (loginButton) {
  92. loginButton.click();
  93. }
  94. }
  95.  
  96. const checkConditionsInterval = setInterval(function() {
  97. if (isTurnstileCompleted() && isEmailFilled()) {
  98. clearInterval(checkConditionsInterval);
  99. clickLoginButton();
  100. }
  101. }, 1000);
  102.  
  103. const observer = new MutationObserver(() => {
  104. const emailInput = document.querySelector('input[type="email"]');
  105. if (emailInput) {
  106. const email = cfg.get('Email').trim();
  107. if (email) {
  108. fillEmailField(email);
  109. }
  110. observer.disconnect();
  111. }
  112. });
  113.  
  114. observer.observe(document.body, { childList: true, subtree: true });
  115.  
  116. const turnstileObserver = new MutationObserver(() => {
  117. const turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
  118. if (turnstileResponse && turnstileResponse.value !== "") {
  119. clickLoginButton();
  120. turnstileObserver.disconnect();
  121. }
  122. });
  123.  
  124. const turnstileInput = document.querySelector('input[name="cf-turnstile-response"]');
  125. if (turnstileInput) {
  126. turnstileObserver.observe(turnstileInput, { attributes: true, attributeFilter: ['value'] });
  127. }
  128.  
  129. const urls = [
  130. "https://linksfly.link/faucet/currency/btc",
  131. "https://linksfly.link/faucet/currency/ltc",
  132. "https://linksfly.link/faucet/currency/bnb",
  133. "https://linksfly.link/faucet/currency/bch",
  134. "https://linksfly.link/faucet/currency/dash",
  135. "https://linksfly.link/faucet/currency/doge",
  136. "https://linksfly.link/faucet/currency/dgb",
  137. "https://linksfly.link/faucet/currency/eth",
  138. "https://linksfly.link/faucet/currency/fey",
  139. "https://linksfly.link/faucet/currency/sol",
  140. "https://linksfly.link/faucet/currency/trx",
  141. "https://linksfly.link/faucet/currency/usdt",
  142. "https://linksfly.link/faucet/currency/zec",
  143. "https://linksfly.link/faucet/currency/tara",
  144. "https://linksfly.link/faucet/currency/ada",
  145. "https://linksfly.link/faucet/currency/xmr",
  146. "https://linksfly.link/faucet/currency/xrp"
  147. ];
  148.  
  149. let currentIndex = parseInt(localStorage.getItem('currentIndex')) || 0;
  150.  
  151. const rotateUrls = () => {
  152. if (window.location.href === "https://linksfly.link/" || window.location.href.includes("/dashboard")) {
  153. window.location.href = urls[currentIndex];
  154. currentIndex = (currentIndex + 1) % urls.length;
  155. localStorage.setItem('currentIndex', currentIndex);
  156. }
  157. };
  158.  
  159. const scrollToButton = () => {
  160. const submitButton = document.querySelector("#subbutt");
  161. if (submitButton) {
  162. const isVisible = () => {
  163. const rect = submitButton.getBoundingClientRect();
  164. return (
  165. rect.top >= 0 &&
  166. rect.left >= 0 &&
  167. rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
  168. rect.right <= (window.innerWidth || document.documentElement.clientWidth)
  169. );
  170. };
  171. if (!isVisible()) {
  172. submitButton.scrollIntoView({
  173. behavior: 'smooth',
  174. block: 'center'
  175. });
  176. }
  177. }
  178. };
  179. scrollToButton();
  180.  
  181. function checkTurnstile() {
  182. const turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
  183. return turnstileResponse && turnstileResponse.value !== '';
  184. }
  185.  
  186. function checkRecaptcha() {
  187. const recaptchaFrame = document.querySelector("iframe[title='reCAPTCHA']");
  188. if (recaptchaFrame) {
  189. return window.grecaptcha.getResponse().length !== 0;
  190. }
  191. return false;
  192. }
  193.  
  194. function clickClaimNow() {
  195. const claimNowButton = document.querySelector('#subbutt');
  196. if (claimNowButton && claimNowButton.innerText.includes('Claim Now')) {
  197. claimNowButton.click();
  198. }
  199. }
  200.  
  201. function clickUnlock() {
  202. const unlockButton = document.querySelector('button.btn.btn-primary.w-md');
  203. if (unlockButton && unlockButton.innerText.includes('Unlock')) {
  204. unlockButton.click();
  205. }
  206. }
  207.  
  208. let intervalId = setInterval(() => {
  209. if (checkTurnstile() || checkRecaptcha()) {
  210. clickClaimNow();
  211. clickUnlock();
  212. clearInterval(intervalId);
  213. clearTimeout(timeoutId);
  214. }
  215. }, 1000);
  216.  
  217. let timeoutId = setTimeout(() => {
  218. clickClaimNow();
  219. clickUnlock();
  220. clearInterval(intervalId);
  221. }, 45000);
  222.  
  223. function checkForMessage() {
  224. const swalContainer = document.querySelector('#swal2-html-container');
  225. const alertDanger = document.querySelector('.alert.alert-danger.text-center');
  226. const alertSuccess = document.querySelector('.alert.alert-success.text-center');
  227. if (swalContainer && swalContainer.style.display === 'block') {
  228. const pageText = swalContainer.innerText || "";
  229. const successMessage1 = "has been sent to your FaucetPay account!";
  230. const successMessage2 = "has been added to your Main account!";
  231. const successMessage3 = "The faucet does not have sufficient funds for this transaction.";
  232. const successMessage4 = "You have been rate-limited. Please try again in a few seconds.";
  233. const invalidCaptchaMessage = "Invalid Captcha";
  234.  
  235. setTimeout(() => {
  236. if (pageText.includes(successMessage1) ||
  237. pageText.includes(successMessage2) ||
  238. pageText.includes(successMessage3) ||
  239. pageText.includes(successMessage4) ||
  240. pageText.includes(invalidCaptchaMessage)) {
  241. window.location.replace("https://linksfly.link/dashboard");
  242. }
  243. }, 1000);
  244. }
  245.  
  246. if (alertDanger) {
  247. const alertText = alertDanger.innerText || "";
  248. const dailyLimitMessage = "Daily claim limit for this coin reached, please comeback again tomorrow.";
  249.  
  250. setTimeout(() => {
  251. if (alertText.includes(dailyLimitMessage)) {
  252. window.location.replace("https://linksfly.link/dashboard");
  253. }
  254. }, 1000);
  255. }
  256. }
  257.  
  258. setInterval(checkForMessage, 1000);
  259.  
  260. })();