This script predicts total battle stats for each Torn player.
Predictions are fast and displayed in a bunch of useful places, almost everywhere actually, using a patented handy color system.
Predictions are based on a machine learning model trained with thousands of real spies.
Predictions can also be overridden by spies (link with TornStats/YATA), so you can see the most reliable information.
Chain window : Easy retals with the color system! (click on the colored area for quick attack too!)
[image: i.ibb.co]
The first week of use is free, then it's 1 xan/15 days.
Send to me. Process is automated. You can pay in bulk.
Price might increase in the future as I keep improving it.
Discord is the place to discuss installation / question / improvement / wrong predictions / roadmap or just anything really
It has the most up to date information.
Disclaimer : Keep in mind predictions can't be 100% accurate, this script really shines to give you a super quick & relatively precise estimation.
Link to the Script - It requires ViolentMonkey/GreaseMonkey to work, see installation steps below for more info
Video showing how useful it can be in Elimination
[Script] BSP - Battle Stats Predictor
Started by TDup [2660552] on in Tools & Userscripts.
About this thread
Posts archived: 710 / 710 posts (100%) · the total is Torn's reply count + the opening post at the last fetch
Counted by TornLife from the archived posts.
- Archived posts
- 710
- Discussion span
- →
- Authority score
- 61 / 100
- Historical score
- 55 / 100
- Story score
- 70 / 100
- Engagement score
- 95 / 100
People posting, likes and official posts are not counted for this thread yet: on threads longer than one page they come from a periodic pass over the archive, which has not covered it.
Most-liked replies
- TDup [2660552]
· 58 likes ·
PART A - First you need a tool such as Tampermonkey It's what injects scripts in the appropriate pages. - On computer, if you use Chrome, install it directly from Chrome extensions. (don't forget to enable developer mode, in - … - TDup [2660552]
· 23 likes ·
API Terms of Service (ToS) Guidelines (Updated 2025 May 15th) - Data Storage - Data stored (Persistent - forever, you can ask me to manually delete) BSP User Player ID, BSP User Public API key, predictions computed for other Torn … - TDup [2660552]
· 12 likes ·
I spent some time on it already, I can't find a super trivial fix. I have something that fixes most places, but causes some wrong positioning on other pages, so I need to go through all supported pages to ensure …
Mentioned in this thread
TDup [2660552] ×3 Lewwer [2235785] ×2 kyle_b [226128] ×1 Anton [422812] ×1 Riot [974353] ×1 Blaze [1591396] ×1 Kwack [2190604] ×1 Bruv [2698166] ×1 kbat [3025679] ×1 JustJule [3040788] ×1
PART A - First you need a tool such as Tampermonkey
It's what injects scripts in the appropriate pages.
- On computer, if you use Chrome, install it directly from Chrome extensions. (don't forget to enable developer mode, in
- chrome://extensions)
- On computer, if you use Firefox, install Greasemonkey instead
- On Android, use Firefox + Tampermonkey
- On Iphone, you can use TornPDA.
[image: i.ibb.co]
Then, in chrome://extensions/ enable developer mode
[image: i.ibb.co]
In Tampermonkey detail, make sure you have "Allow User Script" enabled:
[image: i.ibb.co]
PART B - The script
Step 1: Install the script
From within the browser having Tampermonkey installed, click on this:
https://github.com/tdup-torn/userscripts/raw/master/battle_stats_predictor.user.js
It should open the script within Tampermonkey, click install.
Step 2: Open the settings panel
Now, it's installed, go on your profile page, you'll see a new option box on the top
Step 3: Create a new API key. You can use the button for that .
The key doesn't require any special right, this key will be the one sent to my server. It will be used to authenticate you, and to get info for other players you want to have prediction - in order to get their xan usage for example-Step4 : make sure you have this confirmation. Your API key is verified locally, and the BSP backend returned your subscription (1 free week for new user)
Step 5 : Configure the Color tab
It's important as it is what's going to display differently the players in Torn, depending on their stats (predictions or spies)
Generate a key with access to your battlestats, and fill it properly then press Import stats
You could also manually fill your stats if you wish. Note that those stats, or this API Key is not sent to the BSP backend. It's only stored locally on your machine.
Step 6: Take the time to understand how it works:
With the default configuration, in regular RW:
-> gray (less than 5% of your TBS) Don't touch, way too weak and wouldn't yield respect
-> white (between 5% and 35% of your TBS) Not great, but hey, you might want to unload your E at some point
-> green (between 35% and 75% of your TBS) Perfect target, you should defeat them and they would yield decent respect
-> blue (between 75% and 125% of your TBS) Same tbs as you, great FF but can be tough
-> orange (between 125% and 400% of your TBS) Stronger than you, but you can damage them
-> red (more than 400% of your TBS) : Only to assist your beasts.
[The next steps are optional, you can already check what Torn looks like now, with this script configured. Go on your chain view, any faction, RW, hall of fame, do a quick search if you are a subscriber... You should see the predictions displayed a bit everywhere now]
Step 7: In the Pages tab, select where you want BSP to be enabled.
Also, for those who don't display honor bars, make sure to uncheck it here (so the placement works properly)
I went a bit YOLO on this page stuff, you DON'T HAVE TO ENABLE IT in forums (but you can xD)
Step 8: You can enable TornStats spies
Tick the checkbox, fill your TornStats API key and validate. Then go on a faction page, and click BSP Import spies
Notice the star, along with the TBS, the star means it comes from a spy, and not a prediction (so it's "reliable", except if you have forged spies in your TornStats spies data!)
Step 9 : Enjoy, give feedback, and remember that:
- Those predictions are.. predictions. They can't be 100% accurate, so use this tool for what it is, not a cheat but a helper
- If there are issues with my script, let me know politely, it has been a serious hobby for me those past month, but it also takes time to support/fix, please understand I have a life outside of Torn
Step 10 : Advanced knowledge for TornStats spy integration
When a spy is older than the setting you have here (older than 30 days by default) .. a prediction is made. If the predicted tbs is lower than your old spy tbs, the old spy tbs is used instead. along with a specific symbol : a floppy disk [image: discord.com] ( [image: discord.com] btw, feel free to suggest another icon :p)
API Terms of Service (ToS) Guidelines (Updated 2025 May 15th)
- Data Storage -
Data stored (Persistent - forever, you can ask me to manually delete)
BSP User Player ID, BSP User Public API key, predictions computed for other Torn players.
Public HOF stats from the public thread
- Data Sharing -
Predictions are shared between all BSP users (Service owners & their customers)
Public HOF stats from the public thread
- Purpose of Use -
QoL to display battle stats gathered through spies, through public forum, through predictions
- Key Storage & Sharing -
Stored / Only TDup has access to the database / API keys are not shared. API key is used only when userscript triggers a query. (ie : there's no automated feature using a pooling of API keys)
- Key Access Level -
BSP allows user to set multiple keys, so that only the minimum required is sent to BSP server.
[Normal usage: Public] This API key is sent to BSP server and stored in BSP server database.
[Special usage - Custom API Key: battlestats] For BSP users choosing to auto import their Battle stats in the tool (for stats comparison coloring). This key is NOT sent to BSP server.
[Special usage - Custom API Key: attacks,battlestats] For BSP users choosing to opt-in to feature reverse computing FF from recent stats
(this API key is NOT stored on the server database, battle stats of the user are NOT saved and NOT shared)
[Special] For TornStats/Yata spies integration: API keys that fit those systems. Those API keys are NOT sent to BSP server.
All those API keys are independant and saved separately on the client cache.
BSP encourages through the UX to generate a different key for each usage, with proper permission on each.
BSP flowchart (as of 2025 May 15th)
[image: i.ibb.co]
Q&A
- How do I pay?
Send 1 or more xanax to TDup [2660552]
Each xanax gives 15 days worth of subscription. The process is automated so you don't have to wait for me to be online. Payment is processed within 1 minute.
- Is it legal?
Yes. It uses only API data, and an external service I created & trained with legit spies.
Also, I recently added protection so it doesn't do any API queries on pages you don't have the focus on.
- What do you mean "price might increase in the future"?
It's free for one week starting whenever you want (trying to hook you up so you can see why it's useful), then it's 1 xan / 15 days.
I received tons of feedback saying "it's way too cheap", but I want a broad adoption and young players to be able to use it.
I plan to keep working on this script for a while, and it's very likely to improve significantly (in UX, optimizations and more importantly : accuracy), and thus why price might increase in the future.
Note that if you subscribe for like 3 months right now, you obviously won't have to pay for a potential raise for this period.
- Can you predict all kind of TBS?
On March 2024, I pushed a new model that can better predict any kind of targets.
From weak players to strong ones.
For the megazord (>250SE), I'm not relying on a model, but from a simple math function, using SE as input. It's cheap but doesn't the job ok-ish.
- But, Ched changed the way gym gains are computed!
About that.. Yeah, It's a bit annoying. My current prediction model will indeed be offset with time, and predictions will be off especially for high TBS players (prediction lower than reality)
It's going to take time though, and getting new spies frequently / updating my model will mitigate this issue. I'm not too worried about that.
- But, TBS are irrelevant because balanced build and whore build are not similar
True, especially below 50m stat cap. I actually based my prediction model on the Battle Stats Score information
Problem is: normal players don't get the meaning of Battle Stats Score, so it makes little sense to display it to them.
- What is the API keys rate limit?
For now, I've set a hard lock at 50 calls/minutes per user. (max allowed by Torn is 100 calls/minute)
That being said, I've implemented different caches to reduce the required number of API calls (predictions are saved server side, and shared among users of this script with a 1 day timeout for example)
- I've heard about API keys being stolen and used to mug me!
I'm taking this topic really seriously and don't want any issue ever. I actually designed my previous project to avoid any possibility of API key breach, and there has been 0 complain ever.
I've built BSP so it can use different API Keys. The only API key sent to my backend is the global one, which requires no specific right (= I can't see your activity, your battle stats, your money).
The API key you can use in the "Color" section, is here to automate the process of getting your stats locally, to compare with other players. This key, or the stats are not sent to my backend.
Yata/TornStats integration : same thing: it's done on the client and not sent to my backend.
You can change your API key whenever you want.
You can also inspect the client (javascript) code (or ask a fellow developer player to do so), I didn't minify it for this very reason.
- What about the "upload data" thing? It sends my battle stats right?
The opt-in Upload data option (which is disabled by default), is a way to help BSP predicts players you faced. It relies on the well known way to reverse compute the Battle Score, from the result of a fight (and the FairFight value).
When you enable this option, you get credited 3 months of BSP subscription right away. (a way to recompense those turning that on).
You can turn that off whenever you want.
When you press the button, or once a day if you have the checkbox ticked, it will send your API key to BSP server, that will then
- Fetch your Battle stats.
- Fetch your last attacks (BSP only consider the most recent ones, ie : less than 48h old)
- It will then compute the Battle score of your opponents (both the ones you attacked, or attacked you)
- It will then store those battle score in the database. Those battle score will be shared with any other BSP user (even those who don't turn this opt-in feature) - The gray star display means the prediction comes this.
- It won't save your own battle score, so it won't share your battle score with other BSP users.
- It won't save that API key
- You mentioned Machine Learning, I'd love to know more!
Here's the current state:
The new model is based on 57k unique data points. Coming from spies, or from BScore calculated through faction attacks.
I'm still relying on a 3 layers approach.
- If a player has 250SE+, instead of the really bad model I previously had, I now run a simple math function to predict TBS based on SE alone (capped at 1q). It's not ideal but it's a nice improvement.
- Otherwise player gets bscore predicted through the main model, with those features: Attacks, Useractivity, Awards, Xantaken , Daysbeendonator , Refills , Statenhancersused, Revives, Lsdtaken ,Boostersused, Energydrinkused,Agenoninactive
If the player has <4000 bscore, then it goes through another model ("TheWeakModel") which has been trained with weak players only (22k data point) - I have a really better accuracy like thisBscore is then transformed into TBS, and increased a little bit, because most players aren't perfectly balanced.
If you want more info, join the Discord!
- Be honest, you have the Thief Title, you're just trying to mug me!
Nice! You either read until here (and it was long, congratz), or you noticed the Thief Title.
I spend a lot of time scripting.
I've developed a tool to know about Leslie Wheels, but outside the 2 DPs Sugarvalves sent me to appear in the newspaper, I made $0 out of a lot of hours programming. "Do it for the Science" they said
So I've a bazaar checker script sometimes running on the side, and I mug lazy players who don't self hosp when they sell expensive stuff :D
(Fun fact, this prediction tool was first created as a feature for this bazaar checker, to filter out players I couldn't beat!)
Needless to say this mugging script runs with my own key and has 0 link with this. You can always check your key usage.
My plan is actually to make $$$ with this Predictor tool, because it scales (as opposed to some occasional mugs) and it's really useful for everyone!
Mentions: TDup [2660552]
That being said, maybe I lacked revivers in my training data, and this feature is not enough impactful (I've tested and having revives decreases the predicted stats)
Edit : as discussed on Discord, prediction was off by 15%, which is still decent. (and probably more related to your inactivity than the revives I believe, but I could be wrong here)
Been using it for some time now and i fully recommend.
Keep up the innovation
You misspelled "Apple" :p
I think one of the friendly players handling Torn Intelligence Agency got it working on his IPhone.
Torn API has been broken for 12h+ now, this script cannot work without it.
Please be patient & come to the discord if you want more updates.
Thanks! :)