Skip to content
TORNLIFE More

Torn War Stuff Enhanced

Started by xentac [3354782] on in Tools & Userscripts.

91 replies · 8.08k views · thread synced · 8 days ago · View on torn.com
About this thread

Posts archived: 92 / 92 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
92
Discussion span
→
Authority score
40 / 100
Historical score
45 / 100
Story score
61 / 100
Engagement score
85 / 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.

xentac [3354782]

TL;DR - Install Torn War Stuff Enhanced for even better war monitoring! This script only affects the Ranked War and Raid box at the top of the faction pages.

 

[image: reallybad.ninja]

 

Do you already use the Torn War Stuff script to monitor your wars and wish it just did more? Do you wish you could see who is coming out of the hospital next or which targets can be hit to keep a chain going?

 

Check out Torn War Stuff Enhanced by me, xentac! Features adopted from the original Torn War Stuff script

  • Sort opposing faction members by time left in hospital
  • Add traveling information
  • Highlight targets with < 5 minutes left on their timers

 

The enhanced script adds all these features:

  • Count time down instead of giving it in TCT
  • Highlights targets in foreign hospitals (no other script seems to do this!)
  • Works on both opposing and your own faction! (most scripts don't do this)
  • Supports jail timers
  • Addresses time skew so your device time won't make you miss someone coming out of the hospital
  • Adds Tampermonkey menu for API key configuration and uses the default Torn PDA key

 

There are also a few technical improvements that might make people happier as well

  • Doesn't use setInterval, so processing only happens when the tab is visible (shouldn't overload the torn api with multiple tabs open, torn pda is happier too)
  • Doesn't rewrite the DOM except to add data variables and sort rows so Torn's react auto-updating should be less affected (Torn still sometimes breaks their auto-updating all by themselves so this will not be perfect)
  • Uses a single purpose update loops, so rows should only be in one state and not flick back and forth between numbers.
  • Properly handles error codes returned by Torn API (don't get your IP blocked for entering an incorrect API key)

 

I've also worked with Weav3r so FF Scouter V2 works with as many war scripts as I can find (except Potato War Timer, talk to me if you want to make it compatible!). Feel free to install this one and it will automatically disable Weav3r's updates.

 

Setup

 

Torn PDA will automatically use your Torn PDA key to poll faction data. The script should make about 12 req/minute and updates status within about 9 seconds of changes.

 

Use the tampermonkey menu to enter your key while on the faction page.

 

[image: reallybad.ninja]

 

Improvements and bug reports

 

Feel free to reach out if you find any problems or anything you'd like to add. I've been using this script personally every week (in my previous faction) for a few months as has everyone else in a few other factions. I expect most of the bugs have been worked out, but I'm sure people will find many more.

 

I do have less time to work on this now, but the script is also available on github if anyone wants to submit pull requests!

xentac [3354782]

I probably wasn't specific enough. This only updates the war box (or raid box) at the top of a faction page, not the faction member list.

EllaWhen [2681497]

Great script! I did notice that in the war my faction is currently in, this script breaks the sorting for my faction in the war box. I tried sorting by score for example and a bunch of people with 0 score are at the top despite there being people with higher score further down the list. Disabling this script fixed it so I know that this script is the cause. Not a huge deal for me, just wanted to bring it to your attention in case anyone else might be experiencing this as well

 

Edit: Nevermind I think I figured it out, false alarm! It just sorts by score in each category I think (online, hosp, traveling)

IvyGrace [3697171]

 

 

I don't seem to have the set API Key option for this plugin or a lot of other ones. I'm on Chrome on Ubuntu. Do I need to enable some functionality?

 

Edit: I had to go into chrome and enable user scripts to run in the extension menu. 

mahir_r [2747394]

Amazing, thank you. Using it well on laptop with chrome.

 

question - on mobile I use iPhone and safari to play and Userscripts as my script manager. On the faction page I have no idea how to add my public key, cos it’s not as simple as tampermonkey on chrome giving a little area for input (like your screenshots accurately show). Any chance of getting it to work? Or instead of you can suggest an alternate script manager that works better with your script? I’m open to that too.

mahir_r [2747394]

Oh one piece of feedback:

 

on faction war page I have filtered out abroad and travelling (I have hospital and okay set to view) with Torntools filters. However your script manages to bypass that filter in the instance someone overseas is in hospital. The color coordination is working so I do know to ignore them, but ideally if your script didn’t bypass that filter in this instance, it would make life easier. In terms of watching the behaviour, the second the abroad person left the abroad hosp, they were filtered out by my TT filter once again.

xentac [3354782]

I just tested this and I believe you are mistaken. TT considers foreign hospitals as hospitals (they show up as "Hospital" in the status column as well). This is one of the reasons I added the colour distinction.

xentac [3354782]

Ah, I found it. I just checked their code and they don't even support the registerMenuCommand feature... I'll think about a good place to put that configuration, but I've done my best to not modify too much...

mahir_r [2747394]

Ok im glad you found it, cos i wouldve been no help in giving techniacl info.

Noted on the hospital thing, it was a small issue, and im just glad the colors are there! I had a feeling that was the case. Maybe torn side they should add an extra filter for abroad hospital.

Zorru [3260708]

Hi, awesome script!

As someone already complained about not being able to enter API key in mobile, then you could improve your script by adding a button to profile page for entering the API key. For example [Script] BSP - Battle Stats Predictor | Tools & Userscripts | … is handling the case that way.

As workaround i modified the script locally and hardcoded my API key into it, but it's not very user-friendly nor security aware approach i guess.

Mentions: [Script] BSP - Battle Stats Predictor