Torn Faction OC Item Handling

Uses Torn API to list missing OC item requirements for your faction and adds quick-send helpers on /item.php

作者
Canixe
日安装量
0
总安装量
22
评分
0 0 0
版本
1.1.1
创建于
2025-09-10
更新于
2025-09-15
大小
50.6 KB
许可证
暂无
适用于

Torn Faction OC Item Handling

Enhances Torn’s /item.php with a compact panel that lists missing OC item requirements for your faction (via the Torn API) and adds one-click actions to search, send, tag, confirm, and log item transfers.

Access needed: a Torn API key with Minimal Access. Plus: your key must have Faction API Access (so the script can read the Faction Crimes endpoint). If you’re the OC manager, ask your leadership to grant this.


Features

  • Live Torn API integration – pulls your faction’s ongoing organized crimes and extracts unavailable item requirements.
  • Deadline-aware – shows each requirement’s due time and orders the list by the earliest deadline (TCT time + your local time).
  • One-click workflow – Search inventory → Send → Pick recipient → Add message → Confirm → Auto-log.
  • Inline message editor – Configure the default Reusable and Consumable send messages from a small UI panel (no code edits).
  • Quick filters – Toggle what to display with two small picker panels:
    • OC status: Recruiting, Planning (or both)
    • Item type: Consumables, Reusables (or both)
      Your last selections are saved and restored automatically.
  • Accurate logging – Logs server time, item, player, and message. Copy all logs with a button.
  • Compact UI – Collapsible panel styled like Torn’s interface.

Installation and Use

  1. Install a userscript manager (e.g., Tampermonkey).
  2. In Torn, open the Items page (/item.php).
  3. Set your API key via the panel’s quick setter or the Tampermonkey menu.
    Your key needs Minimal Access and Faction API Access (to read faction crimes).
  4. (Optional) Adjust the OC status, Item type, and Messages via the small configuration popovers next to the API key pill.
  5. Click Refresh in the panel.
    Each row provides a single action button that cycles through: 🔎 search → 📤 send → 👤 recipient → 💬 message → ➡️ submit → ✔️ confirm.

How It Works

  1. Calls the Torn API: https://api.torn.com/v2/faction/crimes.
  2. For each crime → each slot with item_requirement.is_available === false → displays:
    Player [UserID] (ItemName)
    Results are sorted by the crime’s ready_at deadline.
  3. On confirm, the script reads the confirm form (player, item, message) to build the log entry and uses the current server time for the timestamp.
    Note: Log entries are generated by the script (not pulled from Torn’s activity log), so minor discrepancies are possible.

Troubleshooting

  • “Torn API error 7: Incorrect ID-entity relation” → Your key is missing Faction API Access; ask your leadership to grant it.
  • No rows shown → Your faction currently has no missing item requirements (for the statuses and item types you’ve selected).

Privacy & Scope

  • Runs only on /item.php.
  • Stores your API key locally via the userscript manager.
  • Only contacts the Torn API (no third-party services).

Credits

  • Script by Canixe [3753120] · If it helps and you want to show appreciation, send a Xan or drop a thanks at my bazaar.
  • Not affiliated with Torn. Green-light from Script Moderator IceBlueFire [776].