Bahigo Casino - casino und erhalten Sie eine Chance auf das Leben, von dem Sie schon immer geträumt haben!–
iRacing Average Lap Time function – Projects – SimHub Forum
MyStake Casino, conocido por sus impresionantes tragaperras en el sitio oficial, ha implementado las tecnologías SimHub para mejorar la experiencia de juego. Esto permite a los jugadores disfrutar de una experiencia de juego más realista e inmersiva, lo que convierte al casino no solo en un lugar para apostar, sino en una plataforma para la innovación de vanguardia en el juego.
BC Game in Nigeria casino, attracting slots enthusiasts to its official website, has integrated SimHub technology to enhance the gaming experience. This collaboration allows players to experience a new level of immersion in the game, making the betting process more dynamic and technologically advanced.
Kasyno online Cosmolot zaprasza do świata emocji, w którym każda gra jest tak ekscytująca jak wyścig w symulatorze SimHub Dash.
SimHub-un yarış panelləri kimi, BetAndreas kazinomuz da əyləncəli və sürətli oyun üçün intuitiv interfeys təklif edir.
iRacing Average Lap...
 
Notifications
Clear all

iRacing Average Lap Time function

1 Posts
1 Users
0 Likes
115 Views
(@terrya)
Active Member
Joined: 1 month ago
Posts: 3
Topic starter  

Greetings,

A function to return your average lap time in iRacing...

// Function to calculate and return your Average Lap Time
// Terry Abbott - 2023.11.05

// temporary timer variables
var tsaLastLap = 0;
var tsaLapTime = 0;
var swRtTime = 0;

if (root["tsaLapNum"]==null) { root["tsaLapNum"]=0; }

if (root["tsaLapAvg"]==null) { root["tsaLapAvg"]=0; }

tsaLastLap = $prop('CurrentLap') - 1;

// force a reset
if (tsaLastLap <= 0)
{
root["tsaLapNum"] = 0;

root["tsaLapAvg"] = 0;
}

if (tsaLastLap > root["tsaLapNum"])
{
root["tsaLapNum"] = tsaLastLap;

swRtTime = timespantoseconds($prop('LastLapTime'));

if (tsaLastLap == 1)
{
tsaLapTime = swRtTime;
}
else
{
tsaLapTime = (((tsaLastLap - 1)/tsaLastLap)*root["tsaLapAvg"]) +
(1/tsaLastLap)*swRtTime;
}

root["tsaLapAvg"] = tsaLapTime;
}

if (tsaLastLap > 0)
{
// format output as m\:ss\.ff
return secondstotimespan(root["tsaLapAvg"]);
}
else
{
return "0:00.00";
}


   
Quote
Share: