New altcryp.com auto faucet

Automatically login and click faucet

当前为 2024-09-12 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name New altcryp.com auto faucet
  3. // @namespace bekerja pada tampermonkey maupun violentmonkey
  4. // @version 0.1
  5. // @description Automatically login and click faucet
  6. // @grant unsafeWindow
  7. // @grant GM_getValue
  8. // @grant GM_setValue
  9. // @grant GM_addStyle
  10. // @grant GM_xmlhttpRequest
  11. // @grant window.onurlchange
  12. // @grant GM_registerMenuCommand
  13. // @require https://update.greasyfork.org/scripts/439099/1203718/MonkeyConfig%20Modern%20Reloaded.js
  14. // @match https://altcryp.com/*
  15. // @license Copyright OjoNgono
  16. // ==/UserScript==
  17.  
  18.  
  19.  
  20. const cfg = new MonkeyConfig({
  21. title: 'Input Email Faucetpay:',
  22. menuCommand: true,
  23. params: {
  24. Email: {
  25. label: "Email Faucetpay",
  26. type: "text",
  27. default: ''
  28. },
  29. }
  30. });
  31.  
  32. (function() {
  33. 'use strict';
  34.  
  35. window.addEventListener('load', () => {
  36. const email = cfg.get('Email');
  37. console.log('Email retrieved from configuration:', email);
  38. if (!email || email.trim() === '') {
  39. enforceLogoutWithWarning();
  40. } else {
  41. enforceReferralUrl();
  42. setTimeout(() => {
  43. clickLoginRegisterButton();
  44. }, 1000);
  45. const loginInterval = setInterval(() => {
  46. handleLoginPopup();
  47. }, 1000);
  48. setTimeout(() => {
  49. clearInterval(loginInterval);
  50. if (document.querySelector("#logoutModal")) {
  51. // Jika sudah login, lanjutkan dengan rotasi URL dan klaim faucet
  52. rotateUrls();
  53. checkTurnstileAndClick();
  54. }
  55. }, 1000);
  56. }
  57. });
  58.  
  59. function enforceReferralUrl() {
  60. if (window.location.href === "https://altcryp.com" && !window.location.href.includes("?r=25368")) {
  61. const loggedIn = document.querySelector("#logoutModal");
  62. if (!loggedIn) {
  63. window.location.replace("https://altcryp.com/?r=25368");
  64. }
  65. }
  66. }
  67.  
  68. function enforceLogoutWithWarning() {
  69. const loggedIn = document.querySelector("#logoutModal");
  70. if (loggedIn) {
  71.  
  72. alert('Please enter your email in the settings menu before using my script.');
  73. const logoutButton = document.querySelector('a[href="https://altcryp.com/auth/logout"]');
  74. if (logoutButton) {
  75. logoutButton.click();
  76. } else {
  77. window.location.replace("https://altcryp.com/auth/logout");
  78. }
  79. }
  80. }
  81.  
  82. function clickLoginRegisterButton() {
  83. const loginButton = document.querySelector('span.mb-0');
  84. if (loginButton && loginButton.textContent.includes('Login / Register')) {
  85. console.log('Clicking Login / Register button');
  86. loginButton.click();
  87. }
  88. }
  89.  
  90. function handleLoginPopup() {
  91. const modalTitle = document.querySelector('.modal-title');
  92. if (modalTitle && modalTitle.textContent.includes('Login')) {
  93. const emailInput = document.querySelector('#InputEmail');
  94. if (emailInput) {
  95. emailInput.value = cfg.get('Email');
  96. console.log('Email filled:', emailInput.value);
  97. }
  98. const loginButton = document.querySelector('button[type="submit"].d-flex.align-items-center.btn.btn-outline.border.text-secondary');
  99. const captchaResponse = document.querySelector('textarea[name="g-recaptcha-response"]');
  100. const checkCaptchaAndLogin = setInterval(() => {
  101. const captchaResponse = document.querySelector('textarea[name="g-recaptcha-response"]');
  102. if (captchaResponse && captchaResponse.value.trim().length > 0) {
  103. console.log('reCAPTCHA completed, clicking Login button');
  104. loginButton.click();
  105. clearInterval(checkCaptchaAndLogin);
  106. } else {
  107. console.log('Waiting for reCAPTCHA to complete...');
  108. }
  109. }, 1000);
  110. }
  111. }
  112.  
  113. // Daftar URL faucet yang akan dirotasi
  114. const urls = [
  115. "https://altcryp.com/faucet/currency/ltc",
  116. "https://altcryp.com/faucet/currency/usdt",
  117. "https://altcryp.com/faucet/currency/bnb",
  118. "https://altcryp.com/faucet/currency/bch",
  119. "https://altcryp.com/faucet/currency/dash",
  120. "https://altcryp.com/faucet/currency/doge",
  121. "https://altcryp.com/faucet/currency/dgb",
  122. "https://altcryp.com/faucet/currency/matic",
  123. "https://altcryp.com/faucet/currency/sol",
  124. "https://altcryp.com/faucet/currency/trx",
  125. "https://altcryp.com/faucet/currency/xrp",
  126. "https://altcryp.com/faucet/currency/zec",
  127. "https://altcryp.com/faucet/currency/pepe",
  128. "https://altcryp.com/faucet/currency/shib",
  129. "https://altcryp.com/faucet/currency/ton"
  130. ];
  131.  
  132. let currentIndex = parseInt(localStorage.getItem('currentIndex')) || 0;
  133.  
  134. const rotateUrls = () => {
  135. if (window.location.href === "https://altcryp.com/") {
  136. window.location.href = urls[currentIndex];
  137. currentIndex = (currentIndex + 1) % urls.length;
  138. localStorage.setItem('currentIndex', currentIndex);
  139. }
  140. };
  141.  
  142. const scrollToButton = () => {
  143. const submitButton = document.querySelector(".btn.btn-primary");
  144. if (submitButton) {
  145. submitButton.scrollIntoView({
  146. behavior: 'smooth',
  147. block: 'center'
  148. });
  149. }
  150. };
  151.  
  152. // Function to check if the Turnstile validation has completed
  153. function checkTurnstile() {
  154. let turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
  155. return turnstileResponse && turnstileResponse.value !== '';
  156. }
  157.  
  158. // Function to click the "Claim Now" button
  159. function clickClaimNow() {
  160. let claimNowButton = document.querySelector('#subbutt');
  161. if (claimNowButton && claimNowButton.innerText.includes('Claim Now')) {
  162. claimNowButton.click();
  163. }
  164. }
  165.  
  166. // Function to click the "Unlock" button
  167. function clickUnlock() {
  168. let unlockButton = document.querySelector('button.btn.btn-primary.w-md');
  169. if (unlockButton && unlockButton.innerText.includes('Unlock')) {
  170. unlockButton.click();
  171. }
  172. }
  173.  
  174. // Monitor the Turnstile response and click the buttons when ready
  175. let intervalId = setInterval(function() {
  176. if (checkTurnstile()) {
  177. clickClaimNow();
  178. clickUnlock();
  179. clearInterval(intervalId); // Stop the interval once the buttons are clicked
  180. }
  181. }, 1000); // Check every second
  182.  
  183.  
  184.  
  185. // Fungsi untuk cek pesan setelah klaim berhasil
  186. function checkForMessage() {
  187. const swalContainer = document.querySelector('#swal2-html-container');
  188. if (swalContainer && swalContainer.style.display === 'block') {
  189. const pageText = swalContainer.innerText || "";
  190. const successMessage1 = "has been sent to your FaucetPay account!";
  191. const successMessage2 = "has been added to your Main account!"; // Pesan baru
  192. const invalidCaptchaMessage = "Invalid Captcha";
  193.  
  194. console.log("Checking for messages...");
  195. setTimeout(() => {
  196. const cleanedText = cleanText(pageText);
  197. // Periksa jika pesan keberhasilan atau pesan captcha invalid ada
  198. if (cleanedText.includes(successMessage1) || cleanedText.includes(successMessage2) || cleanedText.includes(invalidCaptchaMessage)) {
  199. console.log("Relevant message found. Redirecting...");
  200. window.location.replace("https://altcryp.com/"); // Ganti dengan replace
  201. } else {
  202. console.log("No relevant message found.");
  203. }
  204. }, 1000);
  205. } else {
  206. console.log("swalContainer not found or not visible.");
  207. }
  208. }
  209.  
  210.  
  211. function cleanText(text) {
  212. return text.replace(/\s+/g, ' ').trim();
  213. }
  214.  
  215. setInterval(checkForMessage, 1000);
  216.  
  217.  
  218. // Fungsi untuk membersihkan teks dari spasi berlebihan
  219. function cleanText(text) {
  220. return text.replace(/\s+/g, ' ').trim();
  221. }
  222.  
  223. // Jalankan pengecekan pesan setiap detik
  224. setInterval(checkForMessage, 1000);
  225. })();