rblxmytrsc

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

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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
  }
})();