Function with Total Distance

Discussion on the Lua Scripting capabilities for RaceCapture/Pro. Also see the <a href="http://autosportlabs.net/RaceCapturePro_Lua_Scripting">Lua Scripting Guide</a>

Moderators: JeffC, stieg

Post Reply
wcorredor
Posts: 50
Joined: Thu Oct 27, 2016 6:29 pm

Function with Total Distance

Post by wcorredor »

Just as documented getGpsDist() returns "distance from the beginning of the logging session, or from the start finish line, if configured." Which means, once lapping, the distance gets reset to 0 every time one crosses the finish line.

Can you publish a function that always returns the distance from the start of the session? It would be very useful to calculate mpg more accurately, and predict how many laps are left with current fuel.

I am calculating total distance with lua by adding the travelled distance before it gets reset, but it is not completely precise as the last part (between ticks) gets lost. It is also more code and memory for scripting is very limited.

Post Reply