Torn Chat 3.0 Integrated Search Feature

Adds search to Torn Chats.

作者
TheeeUnknown
日安装量
0
总安装量
2
评分
0 0 0
版本
1.2
创建于
2025-04-14
更新于
2025-04-15
大小
34.1 KB
许可证
CC BY-SA 4.0
适用于

Torn Chat 3.0 with Search Capabilities

This UserScript adds a simple, streamlined search functionality directly into Torn's Chat 3.0 interface. It focuses on the core task of finding messages within the currently loaded chat history.

⚠️ IMPORTANT WARNING: Compatibility ⚠️

This script is designed for the Classic chat view and may NOT function correctly if you have Torn's native "Show user avatars" or "Use message bubbles" options enabled in your Chat Settings. Please disable these options for the script to work reliably.

✨ Key Features:

  • 🔍 In-Chat Search Bar: Adds a dedicated search input and button directly within supported chat windows (Global, Trade, Company, Poker, Staff, Private DMs, (not tested on poker or staff) and Faction once ID is provided).
  • 📊 Floating Results Panel: Displays search results in a separate panel.
    • Shows sender (with clickable profile link) and message content.
    • Highlights your search query within the results.
    • Panel is draggable – place it wherever works best for you! (Position is saved after dragging).
  • 💾 Export Results: Easily export the currently displayed search results to a simple text file.
  • 🔢 Message Count: See a count of currently loaded messages next to the search bar.
  • 📌 Persistent Toggle: The panel toggle button in the main chat footer bar should reliably reappear if removed by page updates (checked every 3 seconds).

⚙️ How to Install:

  1. Install a UserScript Manager: You need an extension for your browser that can run UserScripts. Popular choices include:
  2. Install the Script: Click the green "Install this script" button on this Greasy Fork page.
  3. Confirm Installation: Your UserScript manager will pop up asking you to confirm the installation. Review the permissions (it needs access to torn.com pages) and click "Install".

🚀 How to Use:

  1. Ensure Classic View: Make sure "User avatars" and "Message Bubbles" are disabled in your Torn Chat Settings.
  2. Set Faction ID (One Time): The first time you visit your Preferences page (/preferences.php) or Faction page (/factions.php) after installing, the script will prompt you to enter your numeric Faction ID. Enter only the numbers (e.g., 14365), and the script will save it. If you cancel or enter invalid text, it will ask again the next time you visit one of those pages until it's set.
  3. Open a supported chat window. Allow a moment (5 Seconds) for the script to initialize.
  4. Scroll up in the chat window to load the messages you want to include in your search.
  5. A search bar will appear above the text input area.
  6. Type your search query into the input field.
  7. Click the search icon button.
  8. The Search Results panel will pop up (or update) displaying matching messages.
  9. Clicking a sender's name in the results panel will take you to their profile.
  10. Use the Export Results button in the panel if needed.

(Image Credit: TR0LL [2561502])

⚠️ Known Limitations & Notes:

  • Faction Chat Setup: Requires visiting /preferences.php or /factions.php once to trigger the prompt and save your Faction ID. If the ID changes (e.g., changing factions), you may need to clear the stored value in your UserScript manager's storage for the script (chatHelper_factionId_v2) to be prompted again.
  • Initialization Delay: There's roughly a 5-second delay after page load before the script scans for open chats, and internal checks run every 3 seconds. The search bar appearance might vary slightly.
  • Search Scope: The search only covers messages that are currently loaded in the chat window. Scroll up to load more history before searching.
  • No Dark Mode: This script does not support Torn's dark mode. The panel uses a default light theme.
  • No Settings (Mostly): There is no settings UI. The panel's position is saved after you drag it, but its visibility state is not saved between page loads (it always starts hidden).
  • Simplicity: This is a functional, lightweight script focused on basic search.
  • Torn Updates: Future Torn updates could break this script if they significantly change chat element structures or class names.

➕ More Scripts by TR0LL:

Want to see more? Check out other scripts here: https://greasyfork.org/en/users/1431907-theeeunknown


Enjoy the searching!