Skip to content
TORNLIFE More

[Script] Torn Pray Timer

Started by Mythia02 [2669499] on in Tools & Userscripts.

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

Posts archived: 6 / 6 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
6
Discussion span
→
People posting
4
Likes on archived posts
13
Authority score
37 / 100
Historical score
31 / 100
Story score
38 / 100
Engagement score
61 / 100
Mythia02 [2669499]

Found out from this post that we can get merits named 'Forgiven', which you could get it by praying for around 2 weeks.
Someplayer and most of them said on that post,

It's not that you have to pray once a day, you have to pray within 24 hours of the previous time.

Don't know wheter it's true or not, because I do not have it yet either. I assumes that it is true and i wrote this script for easier to me to get these merit.

tl;dr If you having trouble when reading too long, you could just redirect to summary in the bottom of post or download it directly by clicking the biggest button on here

[image: s3.amazonaws.com]
Additional status label and time - PRAY


The script is useful for displaying the elapsed time after we click the pray button. For example in the picture the text shows that i was clicked the pray button for around 11 hours. If i clicked the pray button again, the time will come back to zero. With this all you need is just pray in torn city church before time runs out without worrying wheter you already do it or not, checking logs manually, or set stopwatch outside.

These scripts has 2 types:

API | NON - API

In API, you will need to enter Full Access API which could read your in-game logs.

[image: s3.amazonaws.com]

By fetching api the data of your log category 'church' will be loaded into script, and will be saved to defined browser local storage

[image: s3.amazonaws.com]
[image: s3.amazonaws.com]



Meanwhile the NON-API one doesn't needed to enter API, it creates time based when you clicked on the pray button

[image: s3.amazonaws.com]


However, even it is a good script there is some problem

For API one, I've set the script to label to toggle remove timer after clicking the pray button.
I don't know why, but when i'm clicking the button which should act to fetching and changing the content of local storage, but it is not and its makes the timer still only load the time data from local storage, not the newest log one.
Now the only option is when you clicked the pray button, the timer will empty, reload the page manually, and click the PRAY label for fetching the new timestamp of the church log. No need to do it in order. Just to ensure that the data brought from local storage is new data from the log, so the timer will runs.

For NON-API one, unlike API one which added label as 'toggle', the NON-API one will act to show prompt, ask user to remove or not when time still in runs. When the timer are empty, the label will act to show alert that you haven't prayed yet and forcing you to go church.


On both NON-API and API the timer can still run as long as local storage is still available. However, the NON-API one only could run in one device or browser because of script only saves timestamp data on local storage once when you clicked the button.
If you delete it by clicking PRAY label or delete it on application/local storage manually, the timer will empty and do not run even you know when is your last click.
You will need to activate it again by clicking the pray button for script to make local storage data of timestamp when you clicked the button.

SUMMARY

How to use

API

  1. Download script and use with tampermonkey or something like that
  2. Make FULL ACCESS API
  3. Copy API to script
  4. Run Timer/fetch: Click PRAY label, or Click Pray button in the Church page
  5. Turn Off timer: Click PRAY label if the timer is on, or automated turn off if the timer are >= 24 hours
  6. Configure settings as you like (its up to you and you will figure it out what to do)[image: s3.amazonaws.com]

NON-API

  1. Download the script
  2. Run Timer: Click the pray button in the Church page
  3. Reset Timer: Click label when the timer are running. Timer will be automatically emptied if more that 24 hours
  4. Configure setting as you like.


DIFFERENCE BETWEEN API AND NON-API
API - Timer still can running even you are using different device as long as you use same script and not over than 24 hours from last church pray log.

NON-API - Timer does not run in another device even you are using same script, only could run in the device which you clicked the button at. And timer will automatically stopped and unable to run if over than 24 hours of last click except if you click the pray button again.

That's all I can say, thanks for reading.
I'm sorry there are no videos, because my laptops are potatoes.
Enjoy the script.
Cheers

Mentions: church merit

Titanic_ [2968477]
I don't know why, but when i'm clicking the button which should act to fetching and changing the content of local storage, but it is not and its makes the timer still only load the time data from local storage, not the newest log one.

The eventlistener you added to the pray button starttimer and will fail the check - if (!localStorage.getItem(STORAGE_NAME)) - so it goes straight to else removetimer. did you mean to put startfetching in the eventlistenr?
Mythia02 [2669499]
I put the startFetching in the startTimer for not type the script again in other event listener so the function can be ran.
I'm use this:
startButton.addEventListener('click', startTimer);
lblPrayTime.addEventListener('click', startTimer);
startTimer(){ await startFetching timestamp blablabla

instead of this:
startButton.addEventListener('click', ()=>{ await startFecting timestamp blablabla });
lblPrayTime.addEventListener('click', ()=>{ await startFecting timestamp blablabla});
Is that what is causing the problem?
Lixie [2783331]

10:02:58 - 01/06/24 You were awarded the honor: Forgiven

10:02:58 - 01/06/24
You used 5 energy praying at the church
19 HOURS AGO
14:05:45 - 31/05/24
You used 5 energy praying at the church
1 DAY AGO
05:46:20 - 31/05/24
You used 5 energy praying at the church
11:06:23 - 30/05/24
You used 5 energy praying at the church
2 DAYS AGO
15:23:45 - 29/05/24
You used 5 energy praying at the church
3 DAYS AGO
16:12:17 - 28/05/24
You used 5 energy praying at the church
4 DAYS AGO
06:03:35 - 28/05/24
You used 5 energy praying at the church
13:06:25 - 27/05/24
You used 5 energy praying at the church
5 DAYS AGO
04:22:35 - 27/05/24
You used 5 energy praying at the church
14:02:17 - 26/05/24
You used 5 energy praying at the church
6 DAYS AGO
07:22:53 - 26/05/24
You used 5 energy praying at the church
17:09:24 - 25/05/24
You used 5 energy praying at the church
12:44:33 - 25/05/24
You used 5 energy praying at the church
7 DAYS AGO
15:38:13 - 24/05/24
You used 5 energy praying at the church
8 DAYS AGO
02:28:34 - 24/05/24
You used 5 energy praying at the church
14:00:09 - 23/05/24
You used 5 energy praying at the church
13:58:12 - 23/05/24
You used 5 energy praying at the church
9 DAYS AGO
05:26:47 - 23/05/24
You used 5 energy praying at the church
19:00:38 - 22/05/24
You used 5 energy praying at the church
10 DAYS AGO
07:46:48 - 22/05/24
You used 5 energy praying at the church
16:20:37 - 21/05/24
You used 5 energy praying at the church
11 DAYS AGO
10:37:56 - 20/05/24
You used 5 energy praying at the church

 

R+ nice script