Greasy Fork 支持简体中文。

Altcryp.com auto faucet

Automatically login and click faucet

  1. // ==UserScript==
  2. // @name Altcryp.com auto faucet
  3. // @namespace bekerja pada tampermonkey maupun violentmonkey
  4. // @version 0.4
  5. // @description Automatically login and click faucet
  6. // @grant GM_getValue
  7. // @grant GM_setValue
  8. // @grant GM_addStyle
  9. // @grant window.onurlchange
  10. // @grant GM_registerMenuCommand
  11. // @require https://update.greasyfork.org/scripts/439099/1203718/MonkeyConfig%20Modern%20Reloaded.js
  12. // @match https://altcryp.com/*
  13. // @license Copyright OjoNgono
  14. // @antifeature referral-link Directs to a referral link when not logged in
  15. // ==/UserScript==
  16.  
  17.  
  18. const cfg = new MonkeyConfig({
  19. title: 'Input Email Faucetpay:',
  20. menuCommand: true,
  21. params: {
  22. Email: {
  23. label: "Email Faucetpay",
  24. type: "text",
  25. default: ''
  26. },
  27. }
  28. });
  29.  
  30. (function() {
  31. 'use strict';
  32.  
  33. const rotateUrls = () => {
  34. const isLoggedIn = document.querySelector("#logoutModal") !== null;
  35. const baseUrl = "https://altcryp.com/";
  36.  
  37. if (window.location.href.startsWith(baseUrl) && isLoggedIn) {
  38. const urls = [
  39. "https://altcryp.com/faucet/currency/ltc",
  40. "https://altcryp.com/faucet/currency/usdt",
  41. "https://altcryp.com/faucet/currency/bnb",
  42. "https://altcryp.com/faucet/currency/bch",
  43. "https://altcryp.com/faucet/currency/dash",
  44. "https://altcryp.com/faucet/currency/doge",
  45. "https://altcryp.com/faucet/currency/dgb",
  46. "https://altcryp.com/faucet/currency/matic",
  47. "https://altcryp.com/faucet/currency/sol",
  48. "https://altcryp.com/faucet/currency/trx",
  49. "https://altcryp.com/faucet/currency/xrp",
  50. "https://altcryp.com/faucet/currency/zec",
  51. "https://altcryp.com/faucet/currency/pepe",
  52. "https://altcryp.com/faucet/currency/shib",
  53. "https://altcryp.com/faucet/currency/ton"
  54. ];
  55.  
  56. let currentIndex = parseInt(localStorage.getItem('currentIndex')) || 0;
  57.  
  58. window.location.href = urls[currentIndex];
  59.  
  60. currentIndex = (currentIndex + 1) % urls.length;
  61. localStorage.setItem('currentIndex', currentIndex);
  62. } else if (!isLoggedIn) {
  63. }
  64. };
  65.  
  66. window.addEventListener('load', () => {
  67. const email = cfg.get('Email');
  68. if (!email || email.trim() === '') {
  69. enforceLogoutWithWarning();
  70. } else {
  71. enforceReferralUrl();
  72. setTimeout(() => {
  73. clickLoginRegisterButton();
  74. }, 2000);
  75.  
  76. const loginInterval = setInterval(() => {
  77. handleLoginPopup();
  78. }, 1000);
  79.  
  80.  
  81.  
  82. setTimeout(() => {
  83. clearInterval(loginInterval);
  84. if (document.querySelector("#logoutModal")) {
  85. rotateUrls();
  86. checkTurnstileAndClick();
  87. }
  88. }, 10000);
  89. }
  90. });
  91.  
  92. function enforceReferralUrl() {
  93. const loggedIn = document.querySelector("#logoutModal");
  94. if (loggedIn) {
  95. return;
  96. }
  97. if (window.location.href === "https://altcryp.com/" && !window.location.href.includes("?r=25413")) {
  98. window.location.replace("https://altcryp.com/?r=25413");
  99. }
  100. }
  101.  
  102. function enforceLogoutWithWarning() {
  103. const loggedIn = document.querySelector("#logoutModal");
  104. if (loggedIn) {
  105. alert('Please enter your email in the settings menu before using my script.');
  106. const logoutButton = document.querySelector('a[href="https://altcryp.com/auth/logout"]');
  107. if (logoutButton) {
  108. logoutButton.click();
  109. } else {
  110. window.location.replace("https://altcryp.com/auth/logout");
  111. }
  112. }
  113. }
  114.  
  115. function clickLoginRegisterButton() {
  116. const loginButton = document.querySelector('span.mb-0');
  117. if (loginButton && loginButton.textContent.includes('Login / Register')) {
  118. loginButton.click();
  119. }
  120. }
  121.  
  122. function handleLoginPopup() {
  123. setTimeout(() => {
  124. const modal = document.querySelector('#login');
  125. if (modal && modal.classList.contains('show')) {
  126. const emailInput = document.querySelector('#InputEmail');
  127. if (emailInput) {
  128. emailInput.value = cfg.get('Email');
  129. }
  130.  
  131. const loginButton = document.querySelector('button[type="submit"].d-flex.align-items-center.btn.btn-outline.border.text-secondary');
  132. const checkTurnstileAndLogin = setInterval(() => {
  133. const turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
  134. if (turnstileResponse && turnstileResponse.value.trim().length > 0) {
  135. loginButton.click();
  136. clearInterval(checkTurnstileAndLogin);
  137. }
  138. }, 1000);
  139. }
  140. }, 1500);
  141. }
  142.  
  143.  
  144. const scrollToButton = () => {
  145. const submitButton = document.querySelector("#subbutt");
  146. if (submitButton) {
  147. const isVisible = () => {
  148. const rect = submitButton.getBoundingClientRect();
  149. return (
  150. rect.top >= 0 &&
  151. rect.left >= 0 &&
  152. rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
  153. rect.right <= (window.innerWidth || document.documentElement.clientWidth)
  154. );
  155. };
  156. if (!isVisible()) {
  157. submitButton.scrollIntoView({
  158. behavior: 'smooth',
  159. block: 'center'
  160. });
  161. }
  162. }
  163. };
  164.  
  165. scrollToButton();
  166.  
  167. function checkTurnstile() {
  168. let turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
  169. return turnstileResponse && turnstileResponse.value !== '';
  170. }
  171.  
  172. function checkRecaptcha() {
  173. let recaptchaFrame = document.querySelector("iframe[title='reCAPTCHA']");
  174. if (recaptchaFrame) {
  175. return window.grecaptcha.getResponse().length !== 0;
  176. }
  177. return false;
  178. }
  179.  
  180. function clickClaimNow() {
  181. let claimNowButton = document.querySelector('#subbutt');
  182. if (claimNowButton && claimNowButton.innerText.includes('Claim Now')) {
  183. claimNowButton.click();
  184. }
  185. }
  186.  
  187. function clickUnlock() {
  188. let unlockButton = document.querySelector('button.btn.btn-primary.w-md');
  189. if (unlockButton && unlockButton.innerText.includes('Unlock')) {
  190. unlockButton.click();
  191. }
  192. }
  193.  
  194. let intervalId = setInterval(function() {
  195. if (checkTurnstile() || checkRecaptcha()) {
  196. clickClaimNow();
  197. clickUnlock();
  198. clearInterval(intervalId);
  199. clearTimeout(timeoutId);
  200. }
  201. }, 1000);
  202. let timeoutId = setTimeout(function() {
  203. clickClaimNow();
  204. clickUnlock();
  205. clearInterval(intervalId);
  206. }, 25000);
  207.  
  208. function checkForMessage() {
  209. const swalContainer = document.querySelector('#swal2-html-container');
  210. if (swalContainer && swalContainer.style.display === 'block') {
  211. const pageText = swalContainer.innerText || "";
  212. const successMessage1 = "has been sent to your FaucetPay account!";
  213. const successMessage2 = "has been added to your Main account!";
  214. const invalidCaptchaMessage = "Invalid Captcha";
  215. setTimeout(() => {
  216. const cleanedText = cleanText(pageText);
  217. if (cleanedText.includes(successMessage1) || cleanedText.includes(successMessage2) || cleanedText.includes(invalidCaptchaMessage)) {
  218. window.location.replace("https://altcryp.com/");
  219. } else {
  220. }
  221. }, 1000);
  222. } else {
  223. }
  224. }
  225.  
  226. function cleanText(text) {
  227. return text.replace(/\s+/g, ' ').trim();
  228. }
  229.  
  230. setInterval(checkForMessage, 1000);
  231.  
  232. })();