Skip to content
TORNLIFE More

[Userscript] NPC Loot Timers

Started by Lugburz [2386297] on in Tools & Userscripts.

163 replies · 8.88k views · thread synced · 4 days ago · View on torn.com
About this thread

Posts archived: 164 / 164 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
164
Discussion span
→
Authority score
60 / 100
Historical score
45 / 100
Story score
61 / 100
Engagement score
86 / 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

Mentioned in this thread

Lazerpent [2112641] ×2 Tiny [21] ×1 xedx [2100735] ×1 Player 2386297 [2386297] ×1

Lugburz [2386297]
This is to help loot hunters.
The script adds a countdown timer till desired loot level (4 by default) on the NPC profile page and the sidebar. This will save you from going to YATA for loot info.
Currently supported NPCs are Duke, Leslie, Scrooge, Jimmy, and - since version 0.2.19 - Fernando.

Big thanks to Kivou for the API!

Changelog:
  • Version 0.3.2 adds scheduled attack timer (via Loot Rangers discord).
  • Version 0.2.16 uses new YATA API which has replaced the one that had been causing too many requests to the server.
  • Version 0.2.10 adds ability to set loot level for each NPC individually (still set to 4 by default)
  • Version 0.2.9 improves topbar timers layout for phone mode.
  • Version 0.2.7 allows to show/hide topbar timers as well as sidebar timers.
  • Version 0.2.3 adds topbar timers.
  • Version 0.2.2 adds a "show/hide" button for the sidebar timers and caches the API response.
  • Version 0.2.1 changes the timer color to orange when there's less than 10 minutes left and red when less than 5 minutes left.
  • Version 0.2.0 adds NPC timers to the sidebar.

https://github.com/f2404/torn-userscripts/raw/master/npc_profile_loot_timer.user.js


PS. Please consider sending a donation if you like the script. This is a great and way of saying "thank you" that also encourages me to create and publish more useful scripts. ;)

[image: i.imgur.com]

[image: i.imgur.com]

[image: i.imgur.com]

Script configuration (need to edit the script from the tampermonkey dashboard):
[image: i.imgur.com]
cankles [2137519]
Thanks for this. Is it possible to add all timers to the left information pane? It would be pretty cool to see at a glance which npc is coming up.
Kivou [2000607]
Are you doing a call to the API every time?
I didn't check the script but maybe you could store the timing locally and make a new call if last refresh older than next level 4?
Lugburz [2386297]
I only call the API when the page loads.
But I think it's a good idea to store timestamps locally, thanks!

One thing that I (and other people) have noticed is that there's a delay after an NPC gets defeated. Basically, new timer won't start for a few minutes, and the old one is still counting to loot level V although the NPC is already in hospital. It's the same on the yata page as well. Can anything be done about that?
Kivou [2000607]
Yes, the timers are updated every 10 minutes on a crontab.
I could do the following things to reduce it:
- update every minutes (which would lead to a maximum of 1 minute delay)
- not running a crontab but something based on timers (which would fail if NPC are hosped at different timings).

So overall since the update is only necessary once / NPC when he's hosp, an update / minutes is a bit overkill imo.
And also, the 10 minutes delay after being hosp is not that of a big deal...
Smokey123 [248901] Helper
Big ask but is there anyway you can move the timers to just above the Home sidebar and below the doctorn quick links?

(or anyone able to supply a code I can add in to this to allow me to do this myself?)
Lugburz [2386297]
I've been debating with myself on what is the best location for the timers...
I will try your suggestion.
Shindig [865748] Officer Officer
Omg, I love it, thanks!!!

Edit: could they turn orange at 10 minutes and red at 5? Maybe background behind that NPC's name?
Smokey123 [248901] Helper
Love the changes and yes timers are good where they are now ty!!

Orange would be a good idea. (What about the blinking effect like we get when the rules are updated?)
Lugburz [2386297]
I've changed the links to open the attacking page and added timer colors as suggested.
Please update to version 0.2.1!
Untouchable [1360035] Committee Committee
My sidebar is too cluttered atm but I love this, think I'm going to make some edits and put it in the topbar where announcements go, they are very rare anyway
Lugburz [2386297]
Please post a screenshot once you've done that, I'm curious how it will look like!

I'm thinking of adding a toggle to hide/show timers in the sidebar, do you think it would be helpful?