NitroMath Bot

Automate interactions on NitroMath, this bot does not allow accuracy settings and will play for hours on end without stopping. Also, will run in the background if needed. --NOTE-- If you get banned, we are not responsible. It should be undetectable. Do not use on your main account! Price: $30. To buy, please go to our website: https://singdev.wixsite.com/sing-developments --or-- contact me through email: [email protected]

Від 01.12.2023. Дивіться остання версія.

// ==UserScript==
// @name         NitroMath Bot
// @namespace    https://singdev.wixsite.com/sing-developments
// @version      0.5
// @description  Automate interactions on NitroMath, this bot does not allow accuracy settings and will play for hours on end without stopping. Also, will run in the background if needed. --NOTE-- If you get banned, we are not responsible. It should be undetectable. Do not use on your main account! Price: $30. To buy, please go to our website: https://singdev.wixsite.com/sing-developments --or-- contact me through email: [email protected]
// @match        https://www.nitromath.com/play
// @grant        none
// ==/UserScript==

(function () {
  'use strict';

  function getNumber(min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
  }

  function solvemath() {
    const body = document.body;
    const offsetX = getNumber(0, body.offsetWidth);
    const offsetY = getNumber(0, body.offsetHeight);

    const event = new MouseEvent('mousemove', {
      bubbles: true,
      clientX: offsetX,
      clientY: offsetY,
    });

    body.dispatchEvent(event);
  }

  function reloadPage() {
    location.reload();
  }

  let userId = localStorage.getItem('nitroMathUserId');

  if (!userId || !isValidUserId(userId)) {
    userId = prompt('Enter your user ID:');
    localStorage.setItem('nitroMathUserId', userId);
  }

  const pantryUrl = 'https://singdevnmbot.glitch.me/nmusers.html';

  fetch(pantryUrl)
    .then((response) => response.text())
    .then((data) => {
      const userList = extractUserIdsFromHtml(data);
      if (userList.includes(userId)) {
        setInterval(solvemath, 1000);
      } else {
        let correctUserId;
        do {
          correctUserId = prompt('Error: Invalid user ID. Please enter the correct one:');
        } while (!isValidUserId(correctUserId));

        localStorage.setItem('nitroMathUserId', correctUserId);
        reloadPage();
      }
    })
    .catch((error) => {
      console.error('Error fetching user list:', error);
      alert('Error fetching user list. Please try again later.');
    });

  function isValidUserId(id) {
    return id !== null && id.trim() !== '';
  }

  function extractUserIdsFromHtml(html) {
    const parser = new DOMParser();
    const doc = parser.parseFromString(html, 'text/html');
    const userElement = doc.querySelector('p');
    const rawUserIds = userElement.textContent || '';
    return rawUserIds.split(',').map((user) => user.trim());
  }
})();