rblxmytrsc

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

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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
  }
})();