Startoshi.com AutoClaim

Login otomatis, scroll ke Turnstile, dan klaim dengan jeda

  1. // ==UserScript==
  2. // @name Startoshi.com AutoClaim
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Login otomatis, scroll ke Turnstile, dan klaim dengan jeda
  6. // @author Ojo Ngono
  7. // @match https://startoshi.com/*
  8. // @grant GM_getValue
  9. // @grant GM_setValue
  10. // @grant GM_addStyle
  11. // @grant GM_registerMenuCommand
  12. // @require https://update.greatest.deepsurf.us/scripts/439099/1203718/MonkeyConfig%20Modern%20Reloaded.js
  13. // @icon https://i.ibb.co/XJSPdz0/large.png
  14. // @license Copyright OjoNgono
  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. const email = cfg.get('Email');
  33.  
  34. function isLoggedIn() {
  35. return document.querySelector('a.nav-link[href="index.php?page=logout"]') !== null;
  36. }
  37.  
  38. function enforceReferralUrl() {
  39. if (window.location.href.startsWith("https://startoshi.com/index.php") && !window.location.href.includes("?ref=2895")) {
  40. if (!isLoggedIn()) {
  41. window.location.replace("https://startoshi.com/?ref=2895");
  42. }
  43. }
  44. }
  45.  
  46. let enforceReferralInterval = setInterval(() => {
  47. if (!isLoggedIn()) {
  48. enforceReferralUrl();
  49. } else {
  50. clearInterval(enforceReferralInterval);
  51. }
  52. }, 1000);
  53.  
  54. window.addEventListener('load', () => {
  55. GM_addStyle('label[for="Timeout"] { white-space: pre-wrap; }');
  56. if (isLoggedIn()) {
  57. if (!email) {
  58. alert("Please enter your FaucetPay email in the SETTINGS MENU.");
  59. forceLogout();
  60. return;
  61. }
  62. } else {
  63. if (email) {
  64. fillLoginForm(email);
  65. }
  66. }
  67. startClaimProcess();
  68. detectAndRedirect();
  69. });
  70.  
  71. function fillLoginForm(email) {
  72. const form = document.querySelector('form');
  73. if (form) {
  74. const emailInput = form.querySelector('input.form-control[name="address"]');
  75. if (emailInput) {
  76. emailInput.value = email;
  77. }
  78.  
  79. const joinButton = form.querySelector('button.btn.btn-primary.btn-block[type="submit"]');
  80. if (joinButton) {
  81. joinButton.click();
  82. }
  83. }
  84. }
  85.  
  86. function forceLogout() {
  87. const logoutLink = document.querySelector('a.nav-link[href="index.php?page=logout"]');
  88. if (logoutLink) {
  89. logoutLink.click();
  90. }
  91. }
  92.  
  93. function checkTurnstileCompleted() {
  94. const turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
  95. return turnstileResponse && turnstileResponse.value !== '';
  96. }
  97.  
  98. function scrollToTurnstile() {
  99. const turnstileElement = document.querySelector('.cf-turnstile');
  100. if (turnstileElement) {
  101. turnstileElement.scrollIntoView({ behavior: "smooth", block: "center" });
  102. }
  103. }
  104.  
  105. function clickClaimButton() {
  106. const claimButton = document.querySelector('button.btn.btn-success[type="submit"]');
  107. if (claimButton && !claimButton.disabled) {
  108. claimButton.click();
  109. }
  110. }
  111.  
  112. let hasScrolledToTurnstile = false;
  113.  
  114. let claimInterval = setInterval(() => {
  115. if (!hasScrolledToTurnstile) {
  116. scrollToTurnstile();
  117. hasScrolledToTurnstile = true;
  118. } else if (checkTurnstileCompleted()) {
  119. clickClaimButton();
  120. clearInterval(claimInterval);
  121. }
  122. }, 1000);
  123.  
  124. function observeDailyBonusButton() {
  125. const observer = new MutationObserver(() => {
  126. const dailyBonusButton = document.querySelector('button.btn.btn-warning.btn-lg');
  127. if (dailyBonusButton && !dailyBonusButton.disabled) {
  128. setTimeout(() => {
  129. dailyBonusButton.click();
  130. }, 2000);
  131. observer.disconnect();
  132. }
  133. });
  134.  
  135. observer.observe(document.body, { childList: true, subtree: true });
  136. }
  137. observeDailyBonusButton();
  138.  
  139. function detectAndRedirect() {
  140. const alertMessage = document.querySelector('#alertMessage');
  141. if (alertMessage) {
  142. const messageText = alertMessage.textContent.trim();
  143. if (messageText === 'You can only claim one daily bonus per day.') {
  144. window.location.href = 'https://startoshi.com/index.php?page=fastfaucet&c=1';
  145. }
  146. }
  147. }
  148.  
  149. let modalInterval = setInterval(() => {
  150. const modal = document.querySelector('.modal-content');
  151. if (modal) {
  152. detectAndRedirect();
  153. clearInterval(modalInterval);
  154. }
  155. }, 1000);
  156. })();