rblxmytrsc

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

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

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