您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Track faction respect with draggable interface
# Torn Faction Respect Tracker
A Tampermonkey userscript for tracking faction respect statistics in Torn City. Generate detailed Excel reports analyzing your faction's offensive and defensive performance during wars and conflicts.
## Features
### 📊 Comprehensive Analysis
- **Defense Tracking**: Monitor incoming attacks, respect lost, and overseas attacks received
- **Offense Tracking**: Track outgoing attacks, respect gained, chain attacks, warlord bonuses, and overseas operations
- **Enemy Identification**: Automatically identifies attacks against specified enemy faction members
- **Detailed Metrics**: Analyzes attack modifiers including overseas bonuses, chain participation, and warlord effects
### 💾 Data Persistence
- **Auto-Save Inputs**: All form fields automatically save as you type
- **Position Memory**: Modal window and button positions persist across page loads
- **State Restoration**: Modal reopens automatically if it was open when navigating to a new page
- **Cross-Page Functionality**: Works seamlessly across all Torn City pages
### 🎨 User Interface
- **Draggable Button**: Orange "Run Script" button can be positioned anywhere on screen
- **Draggable Modal**: Dark-themed GUI window (#232323) can be moved freely
- **Always Accessible**: Window stays on top without forcing focus, allowing you to copy/paste from the page
- **Clean Design**: Modern dark theme with intuitive form layout
### 📥 Export Options
- **Excel Reports**: Generates professional `.xlsx` files with formatted data
- **Automatic Download**: Reports download directly to your browser's download folder
## Usage
### Getting Started
1. **Open the Interface**: Click the orange "Run Script" button
2. **Enter Your Data**:
- **API Key**: Your Torn Limited API key ([Get one here](https://www.torn.com/preferences.php#tab=api))
- **Enemy Faction ID**: The ID of the opposing faction (e.g., 15961)
- **Start Time**: Format: `HH:MM:SS - DD/MM/YY` (e.g., `20:00:00 - 09/10/25`)
- **End Time**: Format: `HH:MM:SS - DD/MM/YY` (e.g., `15:56:10 - 11/10/25`)
3. **Click "Run Report"**: The script will fetch data and generate your report
4. **Download**: The Excel file will automatically download to your default downloads folder
## Report Contents
### Defense Columns
- **Total Attacks Received**: Number of incoming attacks on each member
- **Total Respect Lost (Enemy Gained)**: Respect the enemy faction gained from attacks
- **Attacks Received Overseas**: Number of incoming attacks while member was overseas
- **Respect Lost Overseas**: Respect lost specifically from overseas attacks
### Offense Columns
- **Total Attacks Made**: Number of outgoing attacks by each member
- **Total Respect Gained**: Respect earned from successful attacks
- **Attacks In (vs Enemy)**: Attacks made against the specified enemy faction
- **Attacks Out (Outside)**: Attacks made against targets outside the enemy faction
- **Outside w/ Chain**: Non-enemy attacks made while faction chain was active
- **Attacks Overseas**: Number of attacks made while overseas
- **Respect Gained Overseas**: Respect earned from overseas attacks
- **Attacks w/ Warlord**: Attacks made with warlord bonus active
### Summary Row
A totals row at the bottom aggregates all statistics across all members for quick faction-wide analysis.
## Troubleshooting
### "Please enter an API key" Error
- Ensure you've created a Limited Access API key in Torn
- Check that you've copied the entire key without extra spaces
### No Attacks Found
- Verify the time format is correct (HH:MM:SS - DD/MM/YY)
- Ensure the time range covers when attacks actually occurred
- Remember all times are in UTC (Torn City Time)
### Report Not Downloading
- Check your browser's download settings
- Look in your Downloads folder for files named `faction_report_*.xlsx`
- If using Firefox, ensure downloads are not blocked for the Torn domain
### Modal Not Draggable
- Try clicking on the dark background area, not on inputs or buttons
- Ensure you're using the latest version of the script
- Check browser console (F12) for any error messages
### Script Not Loading
- Verify Tampermonkey is installed and enabled
- Check that the script is enabled in Tampermonkey dashboard
- Make sure you're on a Torn City page (the script runs on `*://*/*`)
## API Rate Limits
The script respects Torn's API rate limits:
- Uses the v2 API endpoint for optimal performance
- Fetches up to 100 attacks per page
- Automatically paginates through results (up to 100 pages)
- Shows progress updates during data fetching
## Privacy & Security
- **API Key**: Your API key is stored locally using Tampermonkey's storage (never sent anywhere except Torn's official API)
- **Data Processing**: All analysis happens locally in your browser
- **No External Servers**: No data is sent to any third-party servers
- **Open Source**: The script code is fully visible and auditable
## Changelog
### Version 10001 (Initial Release)
- Draggable button and modal interface
- Persistent storage for positions, inputs, and modal state
- Excel report generation with comprehensive statistics
- Defense and offense tracking
- Enemy faction identification
- Overseas and warlord bonus analysis
- Dark themed UI (#232323)
- Auto-save functionality
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址