Skip to content
TORNLIFE More

[Script] OC2 Delay Tracker

Started by Hitter [2625699] on in Tools & Userscripts.

4 replies · 244 views · thread synced · 4 days ago · View on torn.com
About this thread

Posts archived: 5 / 5 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
5
Discussion span
→
People posting
2
Likes on archived posts
8
Authority score
36 / 100
Historical score
20 / 100
Story score
33 / 100
Engagement score
57 / 100
Hitter [2625699]

Hello guys, so i recently developed a script that automatically tracks every faction member that delays oc's for whatever reason

 

How it works:

 

Its based on google sheets. Ive set up a trigger every 5 mins and it runs the code collects all the data on the logs sheet and basically takes it all and sums it to another sheet.

 

[image: i.ibb.co][image: i.ibb.co]

 

So in the first pic is the logs page which keeps track of everything and in the second pic ive set it up so it will show the 4 latest delays and it will show the total data for every person in the faction. It also makes sure to include/exclude people that joined/left the faction (without taking their name off the logs page tho beause thats to much work tbh)

 

 

MORE TECHNICAL THINGS AND COMMENTS

 

Script uses single players api key which also has faction api access. Because api dosent allow players to pull data about the exact condition of the crime (ex. member unavailable etc.), it does call api.torn.com/v2/faction/crimes?cat=planning&filters=ready_at...> and basically checks the time that every crime should be initiated once full and if its <= it gets every players conditions and once it finds people in hosp/jail/traveling/missing an item it puts their name in the log page.

 

I also tried it to make a stand alone extension that runs on torn that does the exact same thing so tracker can be more convinient, but i couldnt exactly code something that runs when the player who has it is offline.

 

I decided to work around it so i built an in torn extension which pulls the data from the sheet and displays it in the faction page. 
[image: i.ibb.co]

[image: i.ibb.co]

 

This extension does not require players putting their api key to view the data as it only shows the data presented by the google sheets web server in json which have already been collected by the sheets script using 1 api key. For safety reasons anyone who uses the extension has to put a certain password to access all of it .

 

Final Comments

 

This is my first torn script and also first time working with Js/google apps script although im pretty good at using VBA and python i manged to make this work. I tried to be as specific as possible on how these things work, it might not be perfect but it runs great.

 

Feel free to make any suggestion and comments about it as im always trying to improve everything.

 

*My english is not great so for any questions or clarifications you can mail me

 

Hitter,

Hitter [2625699]

thats now a bad idea it whould be more efficient that way cuz you can see how much "damage" a player did based on total delay time in every oc. havent really thought about that but i like the idea of it i might try to add something like it. Thanks for the suggestion