AutoLitecoin

Auto login and faucet

当前为 2023-09-29 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name AutoLitecoin
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Auto login and faucet
  6. // @author White
  7. // @match https://autolitecoin.xyz/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=autolitecoin.xyz
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (async function() {
  13. 'use strict';
  14.  
  15. const handlePageRedirection = () => {
  16. const url = window.location.href;
  17.  
  18. if (url === 'https://autolitecoin.xyz' || url === 'https://autolitecoin.xyz/') {
  19. window.location.href = 'https://autolitecoin.xyz/login';
  20. } else if (url === 'https://autolitecoin.xyz/dashboard') {
  21. window.location.href = 'https://autolitecoin.xyz/faucet';
  22. }
  23. };
  24.  
  25. const waitForElement = async (selector) => {
  26. while (!document.querySelector(selector)) {
  27. await new Promise(resolve => requestAnimationFrame(resolve));
  28. }
  29. return document.querySelector(selector);
  30. };
  31.  
  32. const preencherCampos = async () => {
  33. const [emailInput, passwordInput] = await Promise.all([waitForElement('#email'), waitForElement('#password')]);
  34.  
  35. if (emailInput && passwordInput) {
  36. emailInput.value = 'email';
  37. passwordInput.value = 'senha';
  38.  
  39. await waitForCaptchaCompletion();
  40.  
  41. clicarBotaoLogin();
  42. }
  43. };
  44.  
  45. const clicarBotaoLogin = () => {
  46. const signInButton = document.querySelector('button.btn-submit.w-100');
  47.  
  48. if (signInButton) {
  49. signInButton.dispatchEvent(new MouseEvent('click'));
  50. }
  51. };
  52.  
  53. const waitForCaptchaCompletion = async () => {
  54. while (!(grecaptcha && grecaptcha.getResponse().length > 0)) {
  55. await new Promise(resolve => setTimeout(resolve, 100));
  56. }
  57. clicarBotaoLogin();
  58. };
  59.  
  60. const executeScript = async () => {
  61. handlePageRedirection();
  62.  
  63. if (window.location.href.includes('https://autolitecoin.xyz/login')) {
  64. await preencherCampos();
  65. }
  66. };
  67.  
  68. await executeScript();
  69.  
  70. let hasClicked = false;
  71.  
  72. function mbsolver() {
  73. const divAntibotLinks = document.querySelectorAll('div.antibotlinks a[style="display: none;"]');
  74. return divAntibotLinks.length === 3;
  75. }
  76.  
  77. function wasButtonClicked() {
  78. return localStorage.getItem('buttonClicked') === 'true';
  79. }
  80.  
  81. function setButtonClicked() {
  82. localStorage.setItem('buttonClicked', 'true');
  83. }
  84.  
  85. function removeButtonClicked() {
  86. localStorage.removeItem('buttonClicked');
  87. }
  88.  
  89. if (wasButtonClicked()) {
  90. removeButtonClicked();
  91. window.location.href = 'https://autolitecoin.xyz/faucet';
  92. }
  93.  
  94. setInterval(function() {
  95. const grecaptchaResponse = (window.grecaptcha && window.grecaptcha.getResponse) ? window.grecaptcha.getResponse() : null;
  96. const divAntibotLinks = document.querySelectorAll('div.antibotlinks a[style="display: none;"]');
  97.  
  98.  
  99. if (window.location.href.includes("/faucet") && grecaptchaResponse && grecaptchaResponse.length > 0 && mbsolver() && !wasButtonClicked()) {
  100. const submitButton = document.querySelector('button.btn.btn-success.btn-lg.claim-button');
  101. if (submitButton) {
  102. submitButton.click();
  103. setButtonClicked();
  104. }
  105. }
  106. }, 3000);
  107. })();