Hey everyone,
I made a userscript that tracks Torn events and shows countdowns directly in the clock dropdown. It's called eventsTracker.
What it does:
Shows upcoming events with countdowns when you toggle the clock. You can see multiple events at once, and it handles both events that haven't started yet and ones currently running.
Features:
- Multi-event display* - See up to 2 events simultaneously
- Two display modes - Toggle between icons and full event names (click icon/event name to switch)
- Smart caching - Doesn't spam the API, respects rate limits
- Visual alerts** - New or upcoming Events get a pulsing animation
- Color coding - Active events are red, upcoming are yellow, future ones white
- Persistent storage - Remembers your API key and preferences
Setup:
- Install the script
- Open the clock - you'll see "Click → Enter MINIMAL API key"
- enter your API and confirm
- Done
The script fetches events once per 30 minutes to stay well under API limits. If you want to force a refresh, long-press the timer for 1 second.
Technical stuff:
Uses fuzzy matching for event names (handles typos and variations in the API)
Calculates event times for recurring events (more on this below)
Has a cleanup system that removes old event data every week
Caches SVG icons to reduce DOM operations
Event prediction system: Since Torn's events API is often incomplete or inaccurate, the script predicts event dates based on patterns (Easter calculations, recurring dates, etc.) and validates API data when available. Falls back to predictions if API data is missing or implausible.
*Multi-event display: Shows up to 2 events when there's both an active event and an upcoming one starting within 7 days. If multiple events are active at once, shows the 2 ending soonest.
**Visual alerts: Clock flashes red when an event starts, yellow when an event enters the 7-day window. For events ending in less than 1 hour: event's icon pulse.
Notes:
This was inspired by ljovcheg [3191064]'s eventsTimer script, but I rewrote everything from scratch with different features. The code is completely different.
If you find bugs or have suggestions, let me know. The script works for me but I'm sure there are edge cases I haven't hit yet.
Only tested on Torn PDA.
Link: Install
Mentions: Ljovcheg [3191064]