rblxmytrsc

Edit displayed balance and Robux amounts on the Roblox My Transactions page (local to your browser).

Vous devrez installer une extension telle que Tampermonkey, Greasemonkey ou Violentmonkey pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey ou Violentmonkey pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey ou Userscripts pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey pour installer ce script.

Vous devrez installer une extension de gestionnaire de script utilisateur pour installer ce script.

(J'ai déjà un gestionnaire de scripts utilisateur, laissez-moi l'installer !)

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

(J'ai déjà un gestionnaire de style utilisateur, laissez-moi l'installer!)

// ==UserScript==
// @name         rblxmytrsc
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Edit displayed balance and Robux amounts on the Roblox My Transactions page (local to your browser).
// @author       mememe
// @license      MIT
// @match        https://roblox.com
// @grant        none
// ==/UserScript==

(() => {
  'use strict';

  // Configuration: set the values you want to display
  const CONFIG = {
    balance: 1043000,   // New balance value to display (e.g., 1000)
    incoming: 0,     // New value for all Incoming Robux amounts
    outgoing: -10483      // New value for all Outgoing Robux amounts
  };

  // Tiny logger (optional)
  const log = (...args) => {
    try { console.log('[RobloxTx Editor]', ...args); } catch { /* no-op */ }
  };

  // Apply edits to balance
  function patchBalance() {
    // Look for any element that mentions "My Balance" or "Balance:"
    const candidates = Array.from(document.querySelectorAll('*')).filter(el =>
      el.textContent && /My Balance|Balance:/i.test(el.textContent)
    );

    if (candidates.length === 0) return false;

    // Update the first suitable element's visible digits after the balance label
    for (const el of candidates) {
      const orig = el.textContent;
      // Try to replace a number that follows the balance label
      const updated = orig.replace(/(My Balance|Balance:)\s*(Ⓒ)?\s*\d+/i, (_, prefix) => {
        return `${prefix ? 'My Balance' : 'Balance:'} Ⓒ ${CONFIG.balance}`;
      });
      if (updated !== orig) {
        el.textContent = updated;
        log('Balance updated:', updated);
        return true;
      }
    }
    return false;
  }

  // Generic helper: attempt to patch amounts inside a section identified by a header
  function patchAmountsInSection(headerRegex, newValue) {
    // Find a header element that matches the given header text
    const headerEl = Array.from(document.querySelectorAll('*')).find(n =>
      n.textContent && headerRegex.test(n.textContent)
    );
    if (!headerEl) return false;

    // Find a container that likely holds the section (closest common ancestor)
    const section = headerEl.closest('section, div, table, tbody, article');
    if (!section) return false;

    // Replace any Robux-like amounts inside that section
    // Pattern matches symbols like Ⓒ or similar followed by digits (e.g., Ⓒ 60 or 60)
    section.querySelectorAll('*').forEach(node => {
      if (typeof node.textContent === 'string') {
        const before = node.textContent;
        node.textContent = before.replace(/Ⓒ?\s*-?\d+/g, `Ⓒ ${newValue}`);
      }
    });

    log(`Patched section "${headerEl.textContent.trim()}" with value ${newValue}`);
    return true;
  }

  // Convenience wrappers for incoming/outgoing sections
  function patchIncoming() {
    // Try known header text for Incoming Robux
    return patchAmountsInSection(/Incoming Robux/i, CONFIG.incoming);
  }

  function patchOutgoing() {
    // Try multiple possible headers that could indicate outgoing transactions
    // Depending on the exact page structure, adjust the headerRegex as needed
    const anyHeader = /Outgoing Robux|Purchases|Total/i;
    return patchAmountsInSection(anyHeader, CONFIG.outgoing);
  }

  // Run edits (on load and on DOM mutations)
  function applyEdits() {
    const b = patchBalance();
    const inr = patchIncoming();
    const out = patchOutgoing();

    // If you want, you can log what happened
    log('Edits applied:', { balancePatched: b, incomingPatched: inr, outgoingPatched: out });
  }

  // Initial run
  window.addEventListener('load', applyEdits, { once: true });

  // Re-apply if the page content changes (e.g., dynamic loading)
  const observer = new MutationObserver(() => {
    // Debounce a bit to avoid excessive work
    clearTimeout(window.__robloxTxDebounce);
    window.__robloxTxDebounce = setTimeout(applyEdits, 200);
  });
  try {
    observer.observe(document.body, { childList: true, subtree: true });
  } catch {
    // If MutationObserver fails for any reason, ignore
  }
})();