TTRS Hack Panel (Clean)

Fixed syntax + working

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         TTRS Hack Panel (Clean)
// @namespace    https://example.com/ttrs-helper
// @version      6.6
// @description  Fixed syntax + working
// @author       You
// @license      MIT
// @match        https://play.ttrockstars.com/*
// @grant        none
// ==/UserScript==

(function () {
  'use strict';

  let delayMs = 500;
  let tickHandle = null;
  let autoEnabled = false;
  let hidden = false;

  // ===== GUI =====
  const gui = document.createElement('div');
  gui.style.position = 'fixed';
  gui.style.top = '20px';
  gui.style.right = '20px';
  gui.style.background = '#222';
  gui.style.color = '#fff';
  gui.style.padding = '10px';
  gui.style.zIndex = '99999';

  const status = document.createElement('div');
  status.textContent = 'OFF (M)';
  gui.appendChild(status);

  document.body.appendChild(gui);

  // ===== Overlay =====
  const overlay = document.createElement('div');
  overlay.style.position = 'fixed';
  overlay.style.top = '0';
  overlay.style.left = '0';
  overlay.style.width = '100%';
  overlay.style.height = '100%';
  overlay.style.background = 'rgba(0,0,0,0.8)';
  overlay.style.color = '#0f0';
  overlay.style.display = 'none';
  overlay.style.alignItems = 'center';
  overlay.style.justifyContent = 'center';
  overlay.style.fontSize = '40px';
  overlay.style.zIndex = '100000';
  overlay.textContent = 'RUNNING';
  document.body.appendChild(overlay);

  function tick() {
    const x = window.innerWidth / 2;
    const y = window.innerHeight / 2;
    const el = document.elementFromPoint(x, y);
    if (el) el.click();
  }

  function start() {
    autoEnabled = true;
    status.textContent = 'ON';
    overlay.style.display = 'flex';
    tickHandle = setInterval(tick, delayMs);
  }

  function stop() {
    autoEnabled = false;
    status.textContent = 'OFF';
    overlay.style.display = 'none';
    clearInterval(tickHandle);
  }

  // ===== CONTROLS =====
  document.addEventListener('keydown', (e) => {

    if (e.key.toLowerCase() === 'm') {
      autoEnabled ? stop() : start();
    }

    if (e.key === 'Tab') {
      e.preventDefault();
      hidden = true;
      gui.style.display = 'none';
      overlay.style.display = 'none';
    }

    if (e.key === 'Escape') {
      hidden = false;
      gui.style.display = 'block';
      if (autoEnabled) overlay.style.display = 'flex';
    }

  });

})();