<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Need programming help to finish my dash. Invalid times in Assetto Corsa. - Dashboard Templates				            </title>
            <link>https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/</link>
            <description>All about SimHub!</description>
            <language>en-US</language>
            <lastBuildDate>Mon, 15 Jun 2026 14:16:48 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Need programming help to finish my dash. Invalid times in Assetto Corsa.</title>
                        <link>https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/paged/2/#post-6842</link>
                        <pubDate>Tue, 04 Apr 2023 21:06:20 +0000</pubDate>
                        <description><![CDATA[Okay, Finally I made a Personal Best Laptime Delta, probably it&#039;s not very accurate because this is not the way to calculate the delta, but it seems it make the work.
 
I made a code that ...]]></description>
                        <content:encoded><![CDATA[<p>Okay, Finally I made a Personal Best Laptime Delta, probably it's not very accurate because this is not the way to calculate the delta, but it seems it make the work.</p>
<p> </p>
<p>I made a code that reads the My Documents\Assetto Corsa\personalbest.ini file and reads car@track record and grab the TIME=, then transform it to seconds.milliseconds. We calculate delta = EstimatedLapTime - PersonalBestLaptime. We format it to have only 2 decimals, and we add a "+" if it's possitive.</p>
<pre contenteditable="false">root.BestLap = 0;
root.Car = ucase($prop('CarId'));
root.Track = ucase($prop('TrackCode'));
root.Estimated = timespantoseconds($prop('PersistantTrackerPlugin.EstimatedLapTime'));
root.Delta = 0;

root.Key = "\r\nDATE=\r\nTIME=";

root.Content = readtextfile('F:\\Documentos\\Assetto Corsa\\personalbest.ini');

root.Regex = new RegExp("\\*?TIME=(\\d+)", "i");
root.Match = root.Regex.exec(root.Content);

if (root.Match) {
  root.BestLap = parseInt(root.Match);
}

root.Time = root.BestLap.toString();
root.Seconds = root.Time.slice(0, -3);
root.Milliseconds = root.Time.slice(-3);
root.FormattedTime = root.Seconds + "." + root.Milliseconds;
root.Delta = root.Estimated - root.FormattedTime;

root.Delta = root.Delta.toFixed(2);

if (root.Delta &gt; 0) {
  root.Delta = "+" + root.Delta;
}

return root.Delta;</pre>]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/dashboard-templates/">Dashboard Templates</category>                        <dc:creator>bartun</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/paged/2/#post-6842</guid>
                    </item>
				                    <item>
                        <title>RE: Need programming help to finish my dash. Invalid times in Assetto Corsa.</title>
                        <link>https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6835</link>
                        <pubDate>Mon, 03 Apr 2023 20:48:31 +0000</pubDate>
                        <description><![CDATA[Okay, new file found.
 
My Documents &gt; Assetto Corsa &gt; Personalbest.ini
 
It shows something like this:

DATE=1680542334000
TIME=58001

[KS...]]></description>
                        <content:encoded><![CDATA[<p>Okay, new file found.</p>
<p> </p>
<p>My Documents &gt; Assetto Corsa &gt; Personalbest.ini</p>
<p> </p>
<p>It shows something like this:</p>
<pre contenteditable="false">
DATE=1680542334000
TIME=58001


DATE=1680544212913
TIME=61494


DATE=1680544860305
TIME=62898


DATE=1680545328561
TIME=57147</pre>
<p> </p>
<p>With this code, I was able to grab the TIME= of the specified CAR@TRACK in personalbest.ini and It was working, but I made a new personal best, and stopped working, now shows value 0.</p>
<pre contenteditable="false">root.BestLap = 0;
root.Car = ucase($prop('CarId'));
root.Track = ucase($prop('TrackCode'));

var key = "\r\nTIME=";

var content = readtextfile('F:\\Documentos\\Assetto Corsa\\personalbest.ini');

var regex = new RegExp(key + "(\\d+)");
var match = regex.exec(content);

if (match) {
  root.BestLap = parseInt(match);
}

return root.BestLap;</pre>]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/dashboard-templates/">Dashboard Templates</category>                        <dc:creator>bartun</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6835</guid>
                    </item>
				                    <item>
                        <title>RE: Need programming help to finish my dash. Invalid times in Assetto Corsa.</title>
                        <link>https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6834</link>
                        <pubDate>Mon, 03 Apr 2023 19:55:05 +0000</pubDate>
                        <description><![CDATA[@romainrob Thank you so much, again. This formula works great , but finally I can&#039;t do it.
Sidekick creates other files but not the personal best files, but If i go to Content Manager &gt; ...]]></description>
                        <content:encoded><![CDATA[<p>@romainrob Thank you so much, again. This formula works great , but finally I can't do it.</p>
<p>Sidekick creates other files but not the personal best files, but If i go to Content Manager &gt; Lap Times &gt; Sources, and I click on Export to Sidekick, then all the personal best times of all the cars in all maps appears in Sidekick folder, so I am gonna try to search in the assetto corsa folder any file that save all the personal best times.. crossing fingers.</p>
<p>I really need to have Personal best time + Personal best time delta instead of Session, but I don't know what to do. My brain is gonna explode. 😆 😆 </p>]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/dashboard-templates/">Dashboard Templates</category>                        <dc:creator>bartun</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6834</guid>
                    </item>
				                    <item>
                        <title>RE: Need programming help to finish my dash. Invalid times in Assetto Corsa.</title>
                        <link>https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6833</link>
                        <pubDate>Mon, 03 Apr 2023 16:05:55 +0000</pubDate>
                        <description><![CDATA[@bartun Maybe. Try to build the path to the file with the car model and track name.Something like that:readtextfile(&#039;d:\\...pathtothefile...\\personal_best\\&#039;+$prop(&#039;CarModel&#039;)+&#039;-&#039;+$prop(&#039;Tr...]]></description>
                        <content:encoded><![CDATA[@bartun Maybe. Try to build the path to the file with the car model and track name.<br />Something like that:<br />readtextfile(<span style="color: #a0522d">'d:\\...pathtothefile...\\personal_best\\'</span>+$prop(<span style="color: #a0522d">'CarModel'</span>)+<span style="color: #a0522d">'-'</span>+$prop(<span style="color: #a0522d">'TrackName'</span>)+<span style="color: #a0522d">'_pb.ini'</span>)]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/dashboard-templates/">Dashboard Templates</category>                        <dc:creator>Romainrob</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6833</guid>
                    </item>
				                    <item>
                        <title>RE: Need programming help to finish my dash. Invalid times in Assetto Corsa.</title>
                        <link>https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6831</link>
                        <pubDate>Mon, 03 Apr 2023 13:12:36 +0000</pubDate>
                        <description><![CDATA[@romainrob I am using &quot;Sidekick app&quot;, it storages automatically the best lap in a file. For example, yesterday I made 3 test laps with Ferrari FXX K, in Monza Junior track.
 
First lap was...]]></description>
                        <content:encoded><![CDATA[<p>@romainrob I am using "Sidekick app", it storages automatically the best lap in a file. For example, yesterday I made 3 test laps with Ferrari FXX K, in Monza Junior track.</p>
<p> </p>
<p>First lap was 1:05:284 doing cut.</p>
<p>Second lap was 1:08:511 without doing cut.</p>
<p>Third lap was 1:13:647 without doing cut.</p>
<p> </p>
<p>Sidekick saved an archive called "ks_ferrari_fxx_k_ks_monza66-junior_pb.ini" on "assettocorsa\apps\python\Sidekick\personal_best"</p>
<p> </p>
<p>Opening the file with Notepad, shows this:</p>
<p> </p>
<pre contenteditable="false">€L68511
.</pre>
<p> </p>
<p>Avoiding that weird icons, the first 2 numbers are the seconds and third last numbers are the milliseconds of the best lap without doing cut, in that track (Monza Junior) with that car (Ferrari FXX K).</p>
<p>It would be possible then to load that file deppending of the car name and the track name and detect that best time in Simhub?</p>
<p>Something like this is on my head:</p>
<pre contenteditable="false">open file "assettocorsa\apps\python\Sidekick\personal_best\*_*.ini"
read the file and apply point or comma between 3rd and 4th number starting from right, so we have time in seconds (68.511) with the "Ferrari FXX K" on "Monza Junior", then we can transform this to time, 1:08:511.

With that time formated, we can show Best absolute lap without doing cut, thanks to Sidekick is creating files of our best laps without doing cuts.

With the same time in seconds (68.511) we can make our own delta, calculating estimatedLapTimeInSeconds - bestTimeInSeconds.</pre>]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/dashboard-templates/">Dashboard Templates</category>                        <dc:creator>bartun</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6831</guid>
                    </item>
				                    <item>
                        <title>RE: Need programming help to finish my dash. Invalid times in Assetto Corsa.</title>
                        <link>https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6830</link>
                        <pubDate>Mon, 03 Apr 2023 09:35:35 +0000</pubDate>
                        <description><![CDATA[@bartun Hi, idk how CM stores lap times.You can read a text file with a formula using readtextfile() but you can&#039;t write one, so you won&#039;t be able to save new lap times.]]></description>
                        <content:encoded><![CDATA[@bartun Hi, idk how CM stores lap times.<br />You can read a text file with a formula using readtextfile() but you can't write one, so you won't be able to save new lap times.]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/dashboard-templates/">Dashboard Templates</category>                        <dc:creator>Romainrob</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6830</guid>
                    </item>
				                    <item>
                        <title>RE: Need programming help to finish my dash. Invalid times in Assetto Corsa.</title>
                        <link>https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6828</link>
                        <pubDate>Sun, 02 Apr 2023 22:00:35 +0000</pubDate>
                        <description><![CDATA[Okay, with a little help of ChatGPT I finally have custom delta of the best session lap without CUT register.
var time = $prop(&#039;GameRawData.Graphics.BestTime&#039;);
var parts = time.split(&quot;:&quot;)...]]></description>
                        <content:encoded><![CDATA[<p>Okay, with a little help of ChatGPT I finally have custom delta of the best session lap without CUT register.</p>
<pre contenteditable="false">var time = $prop('GameRawData.Graphics.BestTime');
var parts = time.split(":");
var minutes = parseInt(parts);
var secondss = parseInt(parts);
var miliseconds = parseInt(parts);
var totalTime = minutes * 60 + seconds + miliseconds / 1000;
var estimated = timespantoseconds($prop('PersistantTrackerPlugin.EstimatedLapTime'));
var delta = estimated - totalTime;

var deltaString = delta.toFixed(2);
if (delta &gt; 0) {
  deltaString = "+" + deltaString;
}

root.Delta = deltaString;

return root.Delta;</pre>
<p> </p>
<p>Now, it's time to think if its possible to create the same with best lap record in each map with each car + delta for that record lap, I think that's not possible. The Fx should load the best lap ever made in that car and in that map, getting the info on a local file in my computer, or loading the info from Content Manager, then in "Fx" check lap validity each time I make a lap, and if lap is valid and lap is record, it should save the record on the .txt overwriting it. Or if is possible to get the time of Content Manager it should way easier, but I think both are not possible, right? @romainrob</p>
<p> </p>
<p>Maybe we will have to live with the information (record + delta of the session) and not with the absolute record lap + delta to the absolute record lap..?</p>]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/dashboard-templates/">Dashboard Templates</category>                        <dc:creator>bartun</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6828</guid>
                    </item>
				                    <item>
                        <title>RE: Need programming help to finish my dash. Invalid times in Assetto Corsa.</title>
                        <link>https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6822</link>
                        <pubDate>Sat, 01 Apr 2023 09:14:51 +0000</pubDate>
                        <description><![CDATA[var estimate = timespantoseconds($prop(&#039;GameRawData.Graphics.BestTime&#039;));return estimate;
RESULT: null
 
var estimate = $prop(&#039;GameRawData.Graphics.BestTime&#039;);return estimate;
RESULT: 1:...]]></description>
                        <content:encoded><![CDATA[<p><span>var</span> estimate = timespantoseconds($prop(<span>'GameRawData.Graphics.BestTime'</span>));<br /><span>return</span> estimate;</p>
<p>RESULT: null</p>
<p> </p>
<p><span>var</span> estimate = $prop(<span>'GameRawData.Graphics.BestTime'</span>);<br /><span>return</span> estimate;</p>
<p>RESULT: 1:28:334</p>
<p> </p>
<p>I can't understand xD</p>
<p>I will try in future make an ALL BEST TIME + ALL BEST TIME DELTA checking both for valid and invalid laps, but while I do that, I would like to have BestSessionTime, BestSessionTimeDelta and BestSessionTimeDeltaProgress, but I think that's not possible (Maybe BestSessionTimeDeltaProgress is possible checking if estimated lap time is increasing or decreasing)</p>
<p>I am so sad to be honest. Why Assetto Corsa give wrong values and doesn't check if lap is valid or not to register it? It's so hard coding all this only for make useful the display with Simhub..</p>]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/dashboard-templates/">Dashboard Templates</category>                        <dc:creator>bartun</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6822</guid>
                    </item>
				                    <item>
                        <title>RE: Need programming help to finish my dash. Invalid times in Assetto Corsa.</title>
                        <link>https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6821</link>
                        <pubDate>Sat, 01 Apr 2023 09:11:04 +0000</pubDate>
                        <description><![CDATA[@romainrob I understand now, wow, thank you soooo much, really. 
I am trying to make my own best session time delta, I don&#039;t know if It&#039;s logic or not, but I am trying 
My actual code is:...]]></description>
                        <content:encoded><![CDATA[<p>@romainrob I understand now, wow, thank you soooo much, really. </p>
<p>I am trying to make my own best session time delta, I don't know if It's logic or not, but I am trying </p>
<p>My actual code is:</p>
<pre contenteditable="false">var deltasession = secondstotimespan(timespantoseconds($prop('PersistantTrackerPlugin.EstimatedLapTime')) - timespantoseconds($prop('GameRawData.Graphics.BestTime')));

return deltasession;</pre>
<p>I transform to seconds the "$prop('PersistantTrackerPlugin.EstimatedLapTime')<span>" and the best session valid time "$prop('GameRawData.Graphics.BestTime')" to seconds to calculate the difference, but result is not logic. Seems that "$prop('GameRawData.Graphics.BestTime')" can't transform to seconds.</span></p>
<p> </p>
<p>I tried this code to transform "$prop('PersistantTrackerPlugin.EstimatedLapTime')"<span> to seconds and It works:</span></p>
<pre contenteditable="false">var bestlapsession = $prop('GameRawData.Graphics.BestTime');

if (bestlapsession == null) {
	bestlapsession = '0';
}

function timespantoseconds(timespan) {
  if (typeof timespan !== 'string' || timespan.length &lt; 8) {
    throw new Error('El argumento debe ser una cadena de texto válida en formato "mm:ss:fff".');
  }
  var timeParts = timespan.split(":");
  var totalSeconds = parseInt(timeParts) * 60 + parseInt(timeParts) + parseFloat(timeParts) / 1000;
  return totalSeconds;
}

var bestlapseconds = timespantoseconds(bestlapsession);

return bestlapseconds;</pre>
<p>But I don't know how to make both work together and make the calculation of "ESTIMATED - BEST SESSION LAP" to show the difference in +0.00;-0.00</p>
<p> </p>
<p>Coding is haaaaaaard</p>]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/dashboard-templates/">Dashboard Templates</category>                        <dc:creator>bartun</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6821</guid>
                    </item>
				                    <item>
                        <title>RE: Need programming help to finish my dash. Invalid times in Assetto Corsa.</title>
                        <link>https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6809</link>
                        <pubDate>Fri, 31 Mar 2023 07:45:30 +0000</pubDate>
                        <description><![CDATA[Hi, you&#039;re welcome. And I&#039;m not laughing, I&#039;ve been there, I know the feeling...I don&#039;t know if there is a reliable way to tell to detect invalid lap in AC.Here are some commentaries if it c...]]></description>
                        <content:encoded><![CDATA[<p>Hi, you're welcome. And I'm not laughing, I've been there, I know the feeling...<br />I don't know if there is a reliable way to tell to detect invalid lap in AC.<br /><br />Here are some commentaries if it can help you understand it<br /><br />var tyresout = $prop('GameRawData.Physics.NumberOfTyresOut');<br />var lap = $prop('CurrentLap')<br /><br />//Inialise the root variables with their default values (the 1st time the Fx runs)<br />if (root.lapValid == null){ // if root.lapValid == null, we know the Fx runs for the 1 time<br />root.lapValid = true;<br />root.lapOld = lap;<br />}<br /><br />// Reset the lap validity on lap change<br />if (root.lapOld != lap) { // If the current lap value changed<br />root.lapValid = true; // Set the lap to Valid<br />}<br /><br />root.lapOld = lap; // Store the current lap value as 'old' to compare it the next frame<br /><br />if (tyresout &gt; 2){<br />root.lapValid = false; // Set the lap to invalid<br />}<br /><br />return root.lapValid ? '#FFFFFFFF' : '#FFFF0000'; //return a color or another depending on root.lapValid <br />//condition ? trueresult : falseresult (another syntax of the if function)<br /><br />It should be possible to control the visibility of the splash screen in a similar way, if you find a proper way to detect invalid laps.</p>]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/dashboard-templates/">Dashboard Templates</category>                        <dc:creator>Romainrob</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/dashboard-templates/need-programming-help-to-finish-my-dash-invalid-times-in-assetto-corsa/#post-6809</guid>
                    </item>
							        </channel>
        </rss>
		