Auto Redirect Script

Auto redirection script for use with Auto CAPTCHA Solver extension on Nitro Type

  1. // ==UserScript==
  2. // @name Auto Redirect Script
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.5
  5. // @description Auto redirection script for use with Auto CAPTCHA Solver extension on Nitro Type
  6. // @author Aratox
  7. // @match https://www.nitrotype.com/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. let captchaActive = false;
  16. let racePageStayDuration = 120000;
  17. let racePageTimer;
  18.  
  19. function checkCaptchaMessage() {
  20. const captchaMessage = document.body.innerText.includes('ERR: CAPTCHA IS NOT RESOLVED');
  21. if (captchaMessage && !captchaActive) {
  22. captchaActive = true;
  23. handleCaptcha();
  24. }
  25. }
  26.  
  27. function handleCaptcha() {
  28. console.log("CAPTCHA detected. Redirecting to race page...");
  29. window.location.href = "https://www.nitrotype.com/race";
  30. }
  31.  
  32. function checkIfCaptchaSolved() {
  33. const validatedMessage = document.querySelector('.tc-i');
  34. if (validatedMessage && validatedMessage.innerText.includes("Validated! Play on.")) {
  35. console.log("CAPTCHA validated! Redirecting to garage...");
  36. window.location.href = "https://www.nitrotype.com/garage";
  37. } else {
  38. setTimeout(checkIfCaptchaSolved, 1000);
  39. }
  40. }
  41.  
  42. function autoClickContinueButton() {
  43. const continueButton = document.querySelector('button.btn.btn--primary.btn--fw');
  44. if (continueButton) {
  45. console.log("Continue button found. Clicking it...");
  46. continueButton.click();
  47.  
  48. setTimeout(() => {
  49. console.log("Redirecting to garage after clicking continue...");
  50. window.location.href = "https://www.nitrotype.com/garage";
  51. }, 1000);
  52. } else {
  53. setTimeout(autoClickContinueButton, 1000);
  54. }
  55. }
  56.  
  57. function redirectToGarageAfterDelay() {
  58. console.log("Staying on race page for 2 minutes. Redirecting to garage...");
  59. window.location.href = "https://www.nitrotype.com/garage";
  60. }
  61.  
  62. function checkIfRacePage() {
  63. if (window.location.pathname === "/race") {
  64. console.log("On race page. Checking if CAPTCHA is solved to redirect to garage...");
  65. checkIfCaptchaSolved();
  66. autoClickContinueButton();
  67.  
  68. racePageTimer = setTimeout(redirectToGarageAfterDelay, racePageStayDuration);
  69. } else {
  70. clearTimeout(racePageTimer);
  71. }
  72. }
  73.  
  74. setInterval(checkCaptchaMessage, 1000);
  75.  
  76. window.addEventListener('load', checkIfRacePage);
  77.  
  78. })();