The online racing simulator
#1 - Krayy
[CODE] Set Race Duration in Kms or Mins
One of the things that has frustrated me as a race admin is the inability to set a race by either distance or time with any great accuracy. To that end, here is an lpr script that you can use to set the race duration by either distance, measured in Kms or time, measured in mins.


<?php 
# Syntax:
# !kms <kms>
#        This will set the race duration to the number of laps that is equal to
#        the specified distance divided by track length, rounded up.
#        
# !mins <mins> [<laps>]
#        This command will cause a race to set its last lap as the lap after
#        The specific <mins> has expired. The optional second parameter allows
#        you to set the number of extra laps at the end of the race
#        e.g. "!mins 10 3" will set a rcae to run for 10 mins then add 3 laps
#        to the lap counter
?>

Note: Some of the variables in the script are not referenced as this is a modified version of my actual script that needs to use a modified LFSLapper.exe, which I will forward to GL for him to update in the future.

Also, you will need to ensure that your trackList.cfg file in your main Lapper directory has more accurate track lengths like this:

<?php 
AS1
,Aston,Aston Cadet,1.870
AS2
,Aston,Aston Club,3.077
AS3
,Aston,Aston National,5.602
AS4
,Aston,Aston Historic,8.089
AS5
,Aston,Aston GP,8.802
AS6
,Aston,Aston Grand Touring,8.002
AS7
,Aston,Aston North,5.168
BL1
,Blackwood,Blackwood GP,3.307
BL2
,Blackwood,Blackwood Rallycross,1.839
BL3
,Blackwood,Blackwood Car Park,0
FE1
,Fern Bay,Fern Bay Club,1.584
FE2
,Fern Bay,Fern Bay Green,3.086
FE3
,Fern Bay,Fern Bay Gold,3.514
FE4
,Fern Bay,Fern Bay Black,6.559
FE5
,Fern Bay,Fern Bay Rallycross,2.018
FE6
,Fern Bay,Fern Bay RallyX Green,0.745
KY1
,Kyoto,Kyoto Oval,2.980
KY2
,Kyoto,Kyoto National,5.138
KY3
,Kyoto,Kyoto GP,7.377
SO1
,South City,South City Classic,2.033
SO2
,South City,South City Sprint1,2.048
SO3
,South City,South City Sprint3,1.334
SO4
,South City,South City Long,4.029
SO5
,South City,South City Town,3.146
SO6
,South City,South City Chicane,2.917
WE1
,Westhill,Westhill International,5.180
AU1
,Autocross,Autocross Autocross,0
AU1
,Autocross,Autocross Skid Pad,0
AU1
,Autocross,Autocross Drag Strip,0
AU1
,Autocross,Autocross 8 Lane Drag,0
?>


Good luck all.
Attached files
raceDuration_lpr.txt - 5.5 KB - 209 views

FGED GREDG RDFGDR GSFDG