Torn Faction Organized Crime Metrics

Uses Torn API to list Organized Crime metrics for your faction.

作者
Canixe
今日安裝
0
安裝總數
5
評價
0 0 0
版本
1.0.1
建立日期
2025-09-13
更新日期
2025-09-17
尺寸
33.1 KB
授權條款
未知
腳本執行於

Torn Faction OC Crime Metrics

Adds a compact panel to the Faction page that pulls your faction’s completed organized crimes (via the Torn API) and shows clean metrics: success vs fail, respect, money to members/faction, a grand total, and an OC breakdown with income, items, and net.

Access needed: a Torn API key with Limited Access.


Features

  • On-demand – the panel stays collapsed and does nothing until you need it to.
  • Date range selection – pick From/To in the header to calculate metrics for the set date-range.
  • OC Metrics
    • Crime metrics with Success / Fail and success rate
    • Respect metrics with total earned, per day, and per OC.
    • Economic metrics with money paid to members, money earned by faction, and estimates for item values using market value

Installation & Use

  1. Install a userscript manager (e.g., Tampermonkey).
  2. Open Torn → Faction https://www.torn.com/factions.php
  3. Click the panel’s API key pill and paste your key.
    The key requires Limited Access.
  4. Choose a date window.
  5. Press ▶ Run. The panel fetches and computes metrics, then displays KPI tiles and the OC breakdown.
    Use ■ Stop to cancel a long range.

How It Works

  1. Crimes:
    https://api.torn.com/v2/faction/crimes?cat=completed&filter=executed_at&from=...&to=...&sort=DESC&key=...&comment=TF-OC-Crime-Metrics
  2. News (member payouts):
    https://api.torn.com/v2/faction/news?cat=depositFunds&sort=DESC&from=...&to=...&key=...
    • The news window’s upper bound extends to the latest rewards.payout.paid_at among fetched crimes, so late payments aren’t missed.
    • Parses each news row’s crimeId and “balance by $X” to attribute member payouts to the correct OC.
  3. Items (names & market value):
    https://api.torn.com/v2/torn/items?key=...
    • Uses each item’s value.market_price to estimate item rewards; cached for 24 hours.

Troubleshooting

  • “Torn API error …” → Check your key; it must have Limited Access. Rate limits may require a short wait.
  • No crimes shown → No completed OCs in the chosen window (times are UTC).

Privacy & Scope

  • Runs only on the Faction page.
  • Stores your API key locally (userscript storage).
  • Contacts only 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.