User Pass
Home Sign Up Contact Log In
Forum > Goal Line Blitz > Greasemonkey Scripts > Training Points calculator
Page:
 
slughead42
Don't panic!
offline
Link
 
I was trying to update this myself but I am doing something wrong. But here's what I think it needs to look like, except my modification of your script breaks something and gives the Sync error message. The bolded part is (I think) what's missing - every season rollover that the dot has left to undergo, they get a 36 TP dump.

const totalTrains = Math.floor((bankedTP + futureTP) / 2) ;
if (data.age < 160) {
totalTrains += (Math.floor(daysLeft / 40) * 18) ;
if (data.dNum > 0) {
totalTrains += 18 ;
}
}
const minBT = currentBT + (totalTrains * 2) ;
const maxBT = currentBT + (totalTrains * 6) ;

 
SeattleNiner
NINERS
offline
Link
 
Thank you. Me not having any dots makes this harder to verify.

Is it documented anywhere what the exact days are in a dot's age that they get TP? If I had this, I could use the script to output a table to compare. Even if someone has an excel sheet that is correct. If I have that I'm pretty sure I can make it accurate.
Edited by SeattleNiner on Dec 21, 2025 07:07:32
 
slughead42
Don't panic!
offline
Link
 
I kept monkeying around with your script, and I updated it as below, and it now is matching the totals that my spreadsheet gives me (which I've used successfully for years and years, so I'm 100% confident in it).

The parts in italics are the new/reworked stuff that I did. Basically, it figures how many TP dumps the dot has left in its career and then adds that in to the calculation. It's not super elegant, with the two different IF statements, but it's a special case for dots that are zero days old (because their initial 36 TP dump for rolling over into their first season is given to them at creation, so the postseason/preseason thing doesn't work for them for that first season). Anyway, this gives me the right result for my dots that are not zero days old, I may try creating a dot just to have a zero day dot to try it on.

// --- CALCULATIONS ---
const daysLeft = Math.max(0, PLATEAU_AGE - data.age);
let futureTP = daysLeft * TP_PER_DAY;

let dumpsLeft = Math.floor(daysLeft / 40) + 1;

if ( data.age < 161 ) {
futureTP = futureTP + ( dumpsLeft * 36 );
if ( data.dNum < 0 ) {
futureTP -= 36;
}
if ( data.age = 0) {
futureTP -= 36;
}
}

const totalTrains = Math.floor((bankedTP + futureTP) / 2);
const minBT = currentBT + (totalTrains * 2);
const maxBT = currentBT + (totalTrains * 6);
Edited by slughead42 on Dec 21, 2025 07:31:18
 
slughead42
Don't panic!
offline
Link
 
Originally posted by SeattleNiner
Thank you. Me not having any dots makes this harder to verify.

Is it documented anywhere what the exact days are in a dot's age that they get TP? If I had this, I could use the script to output a table to compare. Even if someone has an excel sheet that is correct. If I have that I'm pretty sure I can make it accurate.


To answer this part, for future reference/use. These are in chronological order, and should be exhaustive.

Creation: 56 TP (20 TP plus the first "rollover" 36 TP dump, so that any dot created between day 40 and day 0 of the following season is exactly the same).
Days 1-40: 4 TP each day
Rollover to day -4: 36 TP
Days 41-80: 4 TP each day
Rollover to day -4: 36 TP
Days 81-120: 4 TP each day
Rollover to day -4: 36 TP
Days 121-160: 4 TP each day
Rollover to day -4: 36 TP

For each dot's total career (i.e. until they hit plateau at day 161), they receive a total of 840 TP, which of course equates to 420 trains, or a total possible 2,520 BT from training if done exclusively on Light trains. This exactly mirrors the number of TP/trains/BTs that were available to dots under the old system before the great crash.
 
SeattleNiner
NINERS
offline
Link
 
Originally posted by slughead42
To answer this part, for future reference/use. These are in chronological order, and should be exhaustive.

Creation: 56 TP (20 TP plus the first "rollover" 36 TP dump, so that any dot created between day 40 and day 0 of the following season is exactly the same).
Days 1-40: 4 TP each day
Rollover to day -4: 36 TP
Days 41-80: 4 TP each day
Rollover to day -4: 36 TP
Days 81-120: 4 TP each day
Rollover to day -4: 36 TP
Days 121-160: 4 TP each day
Rollover to day -4: 36 TP

For each dot's total career (i.e. until they hit plateau at day 161), they receive a total of 840 TP, which of course equates to 420 trains, or a total possible 2,520 BT from training if done exclusively on Light trains. This exactly mirrors the number of TP/trains/BTs that were available to dots under the old system before the great crash.


Thank you!
 
slughead42
Don't panic!
offline
Link
 
No worries! Sorry for all the huge copy/pastes.

Anyway, when I updated the calculation part above, I noticed that although it calculates the final TP and range of BTs correctly, it now would display Age: 0 for any dot, instead of their correct age. So using the updated code below for the calculations part through the display results part, it now works correctly for me and shows the right age for the dots.

If anyone wants to test it to see if they also get what they expect from it, my proposed updates are available here:

https://greasyfork.org/en/scripts/559731-sn-s-glb-trains-remaining-with-suggested-slughead42-edits

I'm not trying to steal any credit here, Niner, just thought for beta testing it would be easier to put up the code with my changes to see whether people find it to work as I have so far. Like I said above, your JS skills are WAY past mine.
Edited by slughead42 on Dec 30, 2025 17:10:43
Edited by slughead42 on Dec 29, 2025 10:43:11
 
slughead42
Don't panic!
offline
Link
 
Just to completely tie up the post above about total BT available, dots get 12 BTs assigned to them at creation in addition to the 56 TP that they get at creation, so in total, the BTs for a dot's career are 12 + 2520, or 2,532. This is a small detail but your script correctly picks it up (I created a new day 0 dot to test on it), and it shows 2,532 maximum BT for that dot (with my suggested edits in the script, as at the link in the post just before this).
 
SeattleNiner
NINERS
offline
Link
 
I think this is good now. This calculates how many trains / BTs are left in your dot's life. It allows you to set a goal & helps you keep track as your dot grows.

The status bar is color keyed (can be modified):
- BLUE (#007bff): No goal set (Goal = 0).
- GREEN (#28a745): Safe. Minimum possible BT (2 per train) meets your goal.
- YELLOW (#ffc107): Caution. Max BT (6 per train) meets goal, but min doesn't.
- RED (#dc3545): Danger. You are within 10% of failing to meet your goal.
- BLACK (#000): Impossible. Even with 6 BT per train, you cannot hit the goal.

Modified to only refresh a dots age once a session to speed up multiple trains (although manual refresh is available).

Also modified to pull both the season/day and dots age from the home page, making loading quicker.

Also optionally changed the format of the player attributes table so you can see the value are training if it has EQ. This can be turned off to "false" in the code if you don't like it.

https://greasyfork.org/en/scripts/559755-sn-s-glb-trains-bts-remaining

Edited by SeattleNiner on Dec 21, 2025 16:41:59
 
RedneckGopher
offline
Link
 
The format looks good, on my day 0 dots it shows correct with 2532 BT, however my day 160 dot does not include the 36 upcoming at rollover
 
SeattleNiner
NINERS
offline
Link
 
Try this (sorry for the multiple edits - I am not an expert at this) https://greasyfork.org/en/scripts/559852-sn-s-glb-trains-bts-remaining
 
slughead42
Don't panic!
offline
Link
 
Originally posted by SeattleNiner
Try this (sorry for the multiple edits - I am not an expert at this) https://greasyfork.org/en/scripts/559852-sn-s-glb-trains-bts-remaining


I just updated to this new version and tried 3 dots, 40, 80, and 120 day olds, and they are all showing 18 fewer trains left than they should, so they're all not getting one rollover 36 TP dump that they should be getting. I'm not sure if it's the one they get tomorrow, or what the calculation problem is, but they all three have it.
 
slughead42
Don't panic!
offline
Link
 
If it's helpful, I just looked at a 120 day dot and an 80 day dot this morning after season rollover, and both are now showing the correct number of trains left/max BT left, so it seems like whatever is causing the miscalculation is due to the postseason days 41+ vs days -4 to 0 of the preseason, but I took a look at the code and I wasn't able to suss it out right off the jump.
 
SeattleNiner
NINERS
offline
Link
 
Try this? V6.3

https://greasyfork.org/en/scripts/559959-sn-s-glb-trains-bts-remaining
 
slughead42
Don't panic!
offline
Link
 
Sorry to say, with the update, my dots of all ages are back to showing 18 trains less than they should have.
 
slughead42
Don't panic!
offline
Link
 
So, same as above where I posted a link to a modification of SeattleNiner's great work, I'm going to do the same here. I changed the calculation part again to use a season by season type calculation instead of a day by day one, and it's working for me for dots of any age that I currently have that I test it on.

I also changed the output slightly so that, ONCE YOU ENTER THE BT GOAL FOR A DOT, it will display the number of 4XMulti trains still possible for the dot, the number of Normal trains still possible, as well as the total BT possible on Relaxed training (AKA the largest possible BT still available).

ALL CREDIT TO SEATTLE NINER, I'm just stubbornly poking around the edges. If you want to try it out, get it at the link below:

https://greasyfork.org/en/scripts/559731-sn-s-glb-trains-remaining-with-suggested-slughead42-edits

As I write this, it's on version 3.1, lots of bug fixes b/c as I said, I don't really know how to write code.

...
Edited by slughead42 on Dec 30, 2025 17:09:45
Edited by slughead42 on Dec 29, 2025 10:42:26
 
Page:
 


You are not logged in. Please log in if you want to post a reply.