# Schedule V1.01 12-02-12 Initial release # # Schedule V1.02 20-02-12 Added multiple server options # # Schedule V1.03 25-02-12 Polished loading code # # Schedule V1.03b 26-02-12 Fixed a minor bug in close # # Schedule V1.04 22-04-13 Auto load track/car(s) on Lapper start # # Schedule V1.04b 07-05-14 ? # # Schedule V1.05 21-01-15 Auto load handicaps on Lapper start # ################################################################################# CatchEvent OnLapperStart() DelayedCommand( 15, ORS_OnLapperStart_Schedule ); EndCatchEvent CatchEvent OnNewPlayerJoin( $userName ) # Player event OnNewPlayerJoin_Schedule(); EndCatchEvent CatchEvent OnMSO( $userName, $text ) # Player event $idxOfFirtsSpace = indexOf( $text, " "); IF( $idxOfFirtsSpace == -1 ) THEN $command = $text; $argv = ""; ELSE $command = subStr( $text,0,$idxOfFirtsSpace ); $argv = trim( subStr( $text,$idxOfFirtsSpace ) ); ENDIF SWITCH( $command ) CASE "!schedule": Schedule( $KeyFlags ); BREAK; ENDSWITCH EndCatchEvent Sub ORS_OnLapperStart_Schedule() GlobalVar $schedule_version; $schedule_version = "V1.05"; GlobalVar $join_track_allowed; $join_track_allowed="false"; ### Set server_name and storage_name ### IF ($server_name_schedule == "") THEN $server_name_schedule = getLapperVar( "HostName" ); ENDIF $storage_name = "SCHEDULE_".$server_name_schedule; ### End ### ### Load scheduled races for this server instance ### $date_schedule_array[1,1] = GetStoredValue( $storage_name . "date_1" ); $time_schedule_array[1,1] = GetStoredValue( $storage_name . "time_1" ); $track_schedule_array[1,1] = GetStoredValue( $storage_name . "track_1" ); $cars_schedule_array[1,1] = GetStoredValue( $storage_name . "cars_1" ); $laps_schedule_array[1,1] = GetStoredValue( $storage_name . "laps_1" ); $comment_schedule_array[1,1] = GetStoredValue( $storage_name . "comment_1" ); $password_schedule_array[1,1] = GetStoredValue( $storage_name . "password_1" ); $race_id_schedule_array[1,1] = GetStoredValue( $storage_name . "race_id_1" ); $date_schedule_array[1,2] = GetStoredValue( $storage_name . "date_2" ); $time_schedule_array[1,2] = GetStoredValue( $storage_name . "time_2" ); $track_schedule_array[1,2] = GetStoredValue( $storage_name . "track_2" ); $cars_schedule_array[1,2] = GetStoredValue( $storage_name . "cars_2" ); $laps_schedule_array[1,2] = GetStoredValue( $storage_name . "laps_2" ); $comment_schedule_array[1,2] = GetStoredValue( $storage_name . "comment_2" ); $password_schedule_array[1,2] = GetStoredValue( $storage_name . "password_2" ); $race_id_schedule_array[1,2] = GetStoredValue( $storage_name . "race_id_2" ); $date_schedule_array[1,3] = GetStoredValue( $storage_name . "date_3" ); $time_schedule_array[1,3] = GetStoredValue( $storage_name . "time_3" ); $track_schedule_array[1,3] = GetStoredValue( $storage_name . "track_3" ); $cars_schedule_array[1,3] = GetStoredValue( $storage_name . "cars_3" ); $laps_schedule_array[1,3] = GetStoredValue( $storage_name . "laps_3" ); $comment_schedule_array[1,3] = GetStoredValue( $storage_name . "comment_3" ); $password_schedule_array[1,3] = GetStoredValue( $storage_name . "password_3" ); $race_id_schedule_array[1,3] = GetStoredValue( $storage_name . "race_id_3" ); $date_schedule_array[1,4] = GetStoredValue( $storage_name . "date_4" ); $time_schedule_array[1,4] = GetStoredValue( $storage_name . "time_4" ); $track_schedule_array[1,4] = GetStoredValue( $storage_name . "track_4" ); $cars_schedule_array[1,4] = GetStoredValue( $storage_name . "cars_4" ); $laps_schedule_array[1,4] = GetStoredValue( $storage_name . "laps_4" ); $comment_schedule_array[1,4] = GetStoredValue( $storage_name . "comment_4" ); $password_schedule_array[1,4] = GetStoredValue( $storage_name . "password_4" ); $race_id_schedule_array[1,4] = GetStoredValue( $storage_name . "race_id_4" ); $date_schedule_array[1,5] = GetStoredValue( $storage_name . "date_5" ); $time_schedule_array[1,5] = GetStoredValue( $storage_name . "time_5" ); $track_schedule_array[1,5] = GetStoredValue( $storage_name . "track_5" ); $cars_schedule_array[1,5] = GetStoredValue( $storage_name . "cars_5" ); $laps_schedule_array[1,5] = GetStoredValue( $storage_name . "laps_5" ); $comment_schedule_array[1,5] = GetStoredValue( $storage_name . "comment_5" ); $password_schedule_array[1,5] = GetStoredValue( $storage_name . "password_5" ); $race_id_schedule_array[1,5] = GetStoredValue( $storage_name . "race_id_5" ); $date_schedule_array[1,6] = GetStoredValue( $storage_name . "date_6" ); $time_schedule_array[1,6] = GetStoredValue( $storage_name . "time_6" ); $track_schedule_array[1,6] = GetStoredValue( $storage_name . "track_6" ); $cars_schedule_array[1,6] = GetStoredValue( $storage_name . "cars_6" ); $laps_schedule_array[1,6] = GetStoredValue( $storage_name . "laps_6" ); $comment_schedule_array[1,6] = GetStoredValue( $storage_name . "comment_6" ); $password_schedule_array[1,6] = GetStoredValue( $storage_name . "password_6" ); $race_id_schedule_array[1,6] = GetStoredValue( $storage_name . "race_id_6" ); $date_schedule_array[1,7] = GetStoredValue( $storage_name . "date_7" ); $time_schedule_array[1,7] = GetStoredValue( $storage_name . "time_7" ); $track_schedule_array[1,7] = GetStoredValue( $storage_name . "track_7" ); $cars_schedule_array[1,7] = GetStoredValue( $storage_name . "cars_7" ); $laps_schedule_array[1,7] = GetStoredValue( $storage_name . "laps_7" ); $comment_schedule_array[1,7] = GetStoredValue( $storage_name . "comment_7" ); $password_schedule_array[1,7] = GetStoredValue( $storage_name . "password_7" ); $race_id_schedule_array[1,7] = GetStoredValue( $storage_name . "race_id_7" ); $date_schedule_array[1,8] = GetStoredValue( $storage_name . "date_8" ); $time_schedule_array[1,8] = GetStoredValue( $storage_name . "time_8" ); $track_schedule_array[1,8] = GetStoredValue( $storage_name . "track_8" ); $cars_schedule_array[1,8] = GetStoredValue( $storage_name . "cars_8" ); $laps_schedule_array[1,8] = GetStoredValue( $storage_name . "laps_8" ); $comment_schedule_array[1,8] = GetStoredValue( $storage_name . "comment_8" ); $password_schedule_array[1,8] = GetStoredValue( $storage_name . "password_8" ); $race_id_schedule_array[1,8] = GetStoredValue( $storage_name . "race_id_8" ); $date_schedule_array[1,9] = GetStoredValue( $storage_name . "date_9" ); $time_schedule_array[1,9] = GetStoredValue( $storage_name . "time_9" ); $track_schedule_array[1,9] = GetStoredValue( $storage_name . "track_9" ); $cars_schedule_array[1,9] = GetStoredValue( $storage_name . "cars_9" ); $laps_schedule_array[1,9] = GetStoredValue( $storage_name . "laps_9" ); $comment_schedule_array[1,9] = GetStoredValue( $storage_name . "comment_9" ); $password_schedule_array[1,9] = GetStoredValue( $storage_name . "password_9" ); $race_id_schedule_array[1,9] = GetStoredValue( $storage_name . "race_id_9" ); $date_schedule_array[1,10] = GetStoredValue( $storage_name . "date_10" ); $time_schedule_array[1,10] = GetStoredValue( $storage_name . "time_10" ); $track_schedule_array[1,10] = GetStoredValue( $storage_name . "track_10" ); $cars_schedule_array[1,10] = GetStoredValue( $storage_name . "cars_10" ); $laps_schedule_array[1,10] = GetStoredValue( $storage_name . "laps_10" ); $comment_schedule_array[1,10] = GetStoredValue( $storage_name . "comment_10" ); $password_schedule_array[1,10] = GetStoredValue( $storage_name . "password_10" ); $race_id_schedule_array[1,10] = GetStoredValue( $storage_name . "race_id_10" ); $date_schedule_array[1,11] = GetStoredValue( $storage_name . "date_11" ); $time_schedule_array[1,11] = GetStoredValue( $storage_name . "time_11" ); $track_schedule_array[1,11] = GetStoredValue( $storage_name . "track_11" ); $cars_schedule_array[1,11] = GetStoredValue( $storage_name . "cars_11" ); $laps_schedule_array[1,11] = GetStoredValue( $storage_name . "laps_11" ); $comment_schedule_array[1,11] = GetStoredValue( $storage_name . "comment_11" ); $password_schedule_array[1,11] = GetStoredValue( $storage_name . "password_11" ); $race_id_schedule_array[1,11] = GetStoredValue( $storage_name . "race_id_11" ); $date_schedule_array[1,12] = GetStoredValue( $storage_name . "date_12" ); $time_schedule_array[1,12] = GetStoredValue( $storage_name . "time_12" ); $track_schedule_array[1,12] = GetStoredValue( $storage_name . "track_12" ); $cars_schedule_array[1,12] = GetStoredValue( $storage_name . "cars_12" ); $laps_schedule_array[1,12] = GetStoredValue( $storage_name . "laps_12" ); $comment_schedule_array[1,12] = GetStoredValue( $storage_name . "comment_12" ); $password_schedule_array[1,12] = GetStoredValue( $storage_name . "password_12" ); $race_id_schedule_array[1,12] = GetStoredValue( $storage_name . "race_id_12" ); $date_schedule_array[1,13] = GetStoredValue( $storage_name . "date_13" ); $time_schedule_array[1,13] = GetStoredValue( $storage_name . "time_13" ); $track_schedule_array[1,13] = GetStoredValue( $storage_name . "track_13" ); $cars_schedule_array[1,13] = GetStoredValue( $storage_name . "cars_13" ); $laps_schedule_array[1,13] = GetStoredValue( $storage_name . "laps_13" ); $comment_schedule_array[1,13] = GetStoredValue( $storage_name . "comment_13" ); $password_schedule_array[1,13] = GetStoredValue( $storage_name . "password_13" ); $race_id_schedule_array[1,13] = GetStoredValue( $storage_name . "race_id_13" ); $date_schedule_array[1,14] = GetStoredValue( $storage_name . "date_14" ); $time_schedule_array[1,14] = GetStoredValue( $storage_name . "time_14" ); $track_schedule_array[1,14] = GetStoredValue( $storage_name . "track_14" ); $cars_schedule_array[1,14] = GetStoredValue( $storage_name . "cars_14" ); $laps_schedule_array[1,14] = GetStoredValue( $storage_name . "laps_14" ); $comment_schedule_array[1,14] = GetStoredValue( $storage_name . "comment_14" ); $password_schedule_array[1,14] = GetStoredValue( $storage_name . "password_14" ); $race_id_schedule_array[1,14] = GetStoredValue( $storage_name . "race_id_14" ); ### END ### ### Get current date and split it into Year,Month,Day ### $CurrDate = getLapperVar( "ShortDate" ); $Year = subStr( $CurrDate, 6, 2); $Month = subStr( $CurrDate, 3 , 2); $Day = subStr( $CurrDate, 0 , 2); ### END ### ### Check if (and if so, which) settings have to be loaded ### $storage_name = "HCS_".$server_name_schedule; FOR ($i=1;$i<=14;$i=$i+1) IF ($date_schedule_array[1,$i] != "") THEN $Year_2 = subStr( $date_schedule_array[1,$i], 6, 2); $Month_2 = subStr( $date_schedule_array[1,$i], 3 , 2); $Day_2 = subStr( $date_schedule_array[1,$i], 0 , 2); IF ($Year_2 == $Year) THEN IF ($Month_2 == $Month) THEN IF ($Day_2 == $Day) THEN IF ( getLapperVar( "ShortTrackName" ) == $track_schedule_array[1,$i]) THEN writeline($server_name_schedule . " - Only password needs to be set"); cmdLFS("/pass " . $password_schedule_array[1,$i]); cmdLFS("/canreset no"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); $join_track_allowed="true"; break; ELSE writeline($server_name_schedule . " - Track and password needs to be set"); cmdLFS("/end"); cmdLFS("/track " . $track_schedule_array[1,$i]); cmdLFS("/cars " . $cars_schedule_array[1,$i]); cmdLFS("/laps " . $laps_schedule_array[1,$i]); cmdLFS("/qual 240"); cmdLFS("/pass " . $password_schedule_array[1,$i]); cmdLFS("/canreset no"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); $join_track_allowed="true"; break; ENDIF ENDIF IF ($Day_2 > $Day) THEN IF ( getLapperVar( "ShortTrackName" ) != $track_schedule_array[1,$i]) THEN writeline($server_name_schedule . " - Next race is: ".$date_schedule_array[1,$i]); cmdLFS("/end"); cmdLFS("/track " . $track_schedule_array[1,$i]); cmdLFS("/cars " . $cars_schedule_array[1,$i]); cmdLFS("/laps " . $laps_schedule_array[1,$i]); cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); $join_track_allowed="true"; break; ELSE cmdLFS("/cars " . $cars_schedule_array[1,$i]); cmdLFS("/laps " . $laps_schedule_array[1,$i]); cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); $join_track_allowed="true"; break; ENDIF ENDIF ELSE IF ($Month_2 > $Month) THEN IF ( getLapperVar( "ShortTrackName" ) != $track_schedule_array[1,$i]) THEN writeline($server_name_schedule . " - Next race is: ".$date_schedule_array[1,$i]); cmdLFS("/end"); cmdLFS("/track " . $track_schedule_array[1,$i]); cmdLFS("/cars " . $cars_schedule_array[1,$i]); cmdLFS("/laps " . $laps_schedule_array[1,$i]); cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); $join_track_allowed="true"; break; ELSE cmdLFS("/cars " . $cars_schedule_array[1,$i]); cmdLFS("/laps " . $laps_schedule_array[1,$i]); cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); $join_track_allowed="true"; break; ENDIF ENDIF ENDIF ELSE IF ($Year_2 > $Year) THEN IF ( getLapperVar( "ShortTrackName" ) != $track_schedule_array[1,$i]) THEN writeline($server_name_schedule . " - Next race is: ".$date_schedule_array[1,$i]); cmdLFS("/end"); cmdLFS("/track " . $track_schedule_array[1,$i]); cmdLFS("/cars " . $cars_schedule_array[1,$i]); cmdLFS("/laps " . $laps_schedule_array[1,$i]); cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); $join_track_allowed="true"; break; ELSE cmdLFS("/cars " . $cars_schedule_array[1,$i]); cmdLFS("/laps " . $laps_schedule_array[1,$i]); cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); $join_track_allowed="true"; break; ENDIF ENDIF ENDIF ENDIF IF ($i == 14 && $join_track_allowed == "false") THEN GlobalMsg ( "^7No scheduled race found" ); $join_track_allowed="true"; ENDIF ENDFOR ### END ### EndSub Sub Schedule ( $KeyFlags ) ### Set server_name and storage_name ### IF ($server_name_schedule == "") THEN $server_name_schedule = getLapperVar( "HostName" ); ENDIF $storage_name = "SCHEDULE_".$server_name_schedule; ### End ### $server_name_1 = GetStoredValue( "SERVER_NAME_1" . "server_name_1" ); $server_name_2 = GetStoredValue( "SERVER_NAME_2" . "server_name_2" ); $server_name_3 = GetStoredValue( "SERVER_NAME_3" . "server_name_3" ); $server_name_4 = GetStoredValue( "SERVER_NAME_4" . "server_name_4" ); $server_name_5 = GetStoredValue( "SERVER_NAME_5" . "server_name_5" ); $server_name_6 = GetStoredValue( "SERVER_NAME_6" . "server_name_6" ); $server_name_7 = GetStoredValue( "SERVER_NAME_7" . "server_name_7" ); $server_name_8 = GetStoredValue( "SERVER_NAME_8" . "server_name_8" ); $date_schedule_array[1,1] = GetStoredValue( $storage_name . "date_1" ); $time_schedule_array[1,1] = GetStoredValue( $storage_name . "time_1" ); $track_schedule_array[1,1] = GetStoredValue( $storage_name . "track_1" ); $cars_schedule_array[1,1] = GetStoredValue( $storage_name . "cars_1" ); $laps_schedule_array[1,1] = GetStoredValue( $storage_name . "laps_1" ); $comment_schedule_array[1,1] = GetStoredValue( $storage_name . "comment_1" ); $date_schedule_array[1,2] = GetStoredValue( $storage_name . "date_2" ); $time_schedule_array[1,2] = GetStoredValue( $storage_name . "time_2" ); $track_schedule_array[1,2] = GetStoredValue( $storage_name . "track_2" ); $cars_schedule_array[1,2] = GetStoredValue( $storage_name . "cars_2" ); $laps_schedule_array[1,2] = GetStoredValue( $storage_name . "laps_2" ); $comment_schedule_array[1,2] = GetStoredValue( $storage_name . "comment_2" ); $date_schedule_array[1,3] = GetStoredValue( $storage_name . "date_3" ); $time_schedule_array[1,3] = GetStoredValue( $storage_name . "time_3" ); $track_schedule_array[1,3] = GetStoredValue( $storage_name . "track_3" ); $cars_schedule_array[1,3] = GetStoredValue( $storage_name . "cars_3" ); $laps_schedule_array[1,3] = GetStoredValue( $storage_name . "laps_3" ); $comment_schedule_array[1,3] = GetStoredValue( $storage_name . "comment_3" ); $date_schedule_array[1,4] = GetStoredValue( $storage_name . "date_4" ); $time_schedule_array[1,4] = GetStoredValue( $storage_name . "time_4" ); $track_schedule_array[1,4] = GetStoredValue( $storage_name . "track_4" ); $cars_schedule_array[1,4] = GetStoredValue( $storage_name . "cars_4" ); $laps_schedule_array[1,4] = GetStoredValue( $storage_name . "laps_4" ); $comment_schedule_array[1,4] = GetStoredValue( $storage_name . "comment_4" ); $date_schedule_array[1,5] = GetStoredValue( $storage_name . "date_5" ); $time_schedule_array[1,5] = GetStoredValue( $storage_name . "time_5" ); $track_schedule_array[1,5] = GetStoredValue( $storage_name . "track_5" ); $cars_schedule_array[1,5] = GetStoredValue( $storage_name . "cars_5" ); $laps_schedule_array[1,5] = GetStoredValue( $storage_name . "laps_5" ); $comment_schedule_array[1,5] = GetStoredValue( $storage_name . "comment_5" ); $date_schedule_array[1,6] = GetStoredValue( $storage_name . "date_6" ); $time_schedule_array[1,6] = GetStoredValue( $storage_name . "time_6" ); $track_schedule_array[1,6] = GetStoredValue( $storage_name . "track_6" ); $cars_schedule_array[1,6] = GetStoredValue( $storage_name . "cars_6" ); $laps_schedule_array[1,6] = GetStoredValue( $storage_name . "laps_6" ); $comment_schedule_array[1,6] = GetStoredValue( $storage_name . "comment_6" ); $date_schedule_array[1,7] = GetStoredValue( $storage_name . "date_7" ); $time_schedule_array[1,7] = GetStoredValue( $storage_name . "time_7" ); $track_schedule_array[1,7] = GetStoredValue( $storage_name . "track_7" ); $cars_schedule_array[1,7] = GetStoredValue( $storage_name . "cars_7" ); $laps_schedule_array[1,7] = GetStoredValue( $storage_name . "laps_7" ); $comment_schedule_array[1,7] = GetStoredValue( $storage_name . "comment_7" ); $date_schedule_array[1,8] = GetStoredValue( $storage_name . "date_8" ); $time_schedule_array[1,8] = GetStoredValue( $storage_name . "time_8" ); $track_schedule_array[1,8] = GetStoredValue( $storage_name . "track_8" ); $cars_schedule_array[1,8] = GetStoredValue( $storage_name . "cars_8" ); $laps_schedule_array[1,8] = GetStoredValue( $storage_name . "laps_8" ); $comment_schedule_array[1,8] = GetStoredValue( $storage_name . "comment_8" ); $date_schedule_array[1,9] = GetStoredValue( $storage_name . "date_9" ); $time_schedule_array[1,9] = GetStoredValue( $storage_name . "time_9" ); $track_schedule_array[1,9] = GetStoredValue( $storage_name . "track_9" ); $cars_schedule_array[1,9] = GetStoredValue( $storage_name . "cars_9" ); $laps_schedule_array[1,9] = GetStoredValue( $storage_name . "laps_9" ); $comment_schedule_array[1,9] = GetStoredValue( $storage_name . "comment_9" ); $date_schedule_array[1,10] = GetStoredValue( $storage_name . "date_10" ); $time_schedule_array[1,10] = GetStoredValue( $storage_name . "time_10" ); $track_schedule_array[1,10] = GetStoredValue( $storage_name . "track_10" ); $cars_schedule_array[1,10] = GetStoredValue( $storage_name . "cars_10" ); $laps_schedule_array[1,10] = GetStoredValue( $storage_name . "laps_10" ); $comment_schedule_array[1,10] = GetStoredValue( $storage_name . "comment_10" ); $date_schedule_array[1,11] = GetStoredValue( $storage_name . "date_11" ); $time_schedule_array[1,11] = GetStoredValue( $storage_name . "time_11" ); $track_schedule_array[1,11] = GetStoredValue( $storage_name . "track_11" ); $cars_schedule_array[1,11] = GetStoredValue( $storage_name . "cars_11" ); $laps_schedule_array[1,11] = GetStoredValue( $storage_name . "laps_11" ); $comment_schedule_array[1,11] = GetStoredValue( $storage_name . "comment_11" ); $date_schedule_array[1,12] = GetStoredValue( $storage_name . "date_12" ); $time_schedule_array[1,12] = GetStoredValue( $storage_name . "time_12" ); $track_schedule_array[1,12] = GetStoredValue( $storage_name . "track_12" ); $cars_schedule_array[1,12] = GetStoredValue( $storage_name . "cars_12" ); $laps_schedule_array[1,12] = GetStoredValue( $storage_name . "laps_12" ); $comment_schedule_array[1,12] = GetStoredValue( $storage_name . "comment_12" ); $date_schedule_array[1,13] = GetStoredValue( $storage_name . "date_13" ); $time_schedule_array[1,13] = GetStoredValue( $storage_name . "time_13" ); $track_schedule_array[1,13] = GetStoredValue( $storage_name . "track_13" ); $cars_schedule_array[1,13] = GetStoredValue( $storage_name . "cars_13" ); $laps_schedule_array[1,13] = GetStoredValue( $storage_name . "laps_13" ); $comment_schedule_array[1,13] = GetStoredValue( $storage_name . "comment_13" ); $date_schedule_array[1,14] = GetStoredValue( $storage_name . "date_14" ); $time_schedule_array[1,14] = GetStoredValue( $storage_name . "time_14" ); $track_schedule_array[1,14] = GetStoredValue( $storage_name . "track_14" ); $cars_schedule_array[1,14] = GetStoredValue( $storage_name . "cars_14" ); $laps_schedule_array[1,14] = GetStoredValue( $storage_name . "laps_14" ); $comment_schedule_array[1,14] = GetStoredValue( $storage_name . "comment_14" ); $CurrDate = getLapperVar( "ShortDate" ); $Year = subStr( $CurrDate, 6, 2); $Month = subStr( $CurrDate, 3 , 2); $Day = subStr( $CurrDate, 0 , 2); ### Set initial values for left/right and top/bottom coordinates ### $left_right_schedule = 1; $top_bottom_schedule = 30; ### End ### ### Draw the Schedule GUI ### openPrivButton( "schedule_gui_bg",$left_right_schedule,$top_bottom_schedule,162,118,5,-1,16,""); openPrivButton( "schedule_title",$left_right_schedule+1,$top_bottom_schedule+1,80,5,5,-1,32,"^7Schedule system " . $schedule_version ); openPrivButton( "schedule_server_name",$left_right_schedule+81,$top_bottom_schedule+1,80,5,5,-1,32,"^7Server name: " . getLapperVar( "HostName" ) ); IF ( $server_name_1 != "") THEN openPrivButton( "schedule_server_name_1",$left_right_schedule+1,$top_bottom_schedule+11,39,5,5,-1,32,"^3".$server_name_1 ); IF ( $server_name_1 == $server_name_schedule) THEN openPrivButton( "schedule_server_name_1_activate",$left_right_schedule+40,$top_bottom_schedule+11,15,5,5,-1,32,"^2LOADED" ); ELSE openPrivButton( "schedule_server_name_1_activate",$left_right_schedule+40,$top_bottom_schedule+11,15,5,5,-1,32,"^3LOAD",load_server_name_1 ); ENDIF ENDIF IF ( $server_name_2 != "") THEN openPrivButton( "schedule_server_name_2",$left_right_schedule+55,$top_bottom_schedule+11,38,5,5,-1,32,"^3".$server_name_2 ); IF ( $server_name_2 == $server_name_schedule) THEN openPrivButton( "schedule_server_name_2_activate",$left_right_schedule+93,$top_bottom_schedule+11,15,5,5,-1,32,"^2LOADED" ); ELSE openPrivButton( "schedule_server_name_2_activate",$left_right_schedule+93,$top_bottom_schedule+11,15,5,5,-1,32,"^3LOAD",load_server_name_2 ); ENDIF ENDIF IF ( $server_name_3 != "") THEN openPrivButton( "schedule_server_name_3",$left_right_schedule+108,$top_bottom_schedule+11,38,5,5,-1,32,"^3".$server_name_3 ); IF ( $server_name_3 == $server_name_schedule) THEN openPrivButton( "schedule_server_name_3_activate",$left_right_schedule+146,$top_bottom_schedule+11,15,5,5,-1,32,"^2LOADED" ); ELSE openPrivButton( "schedule_server_name_3_activate",$left_right_schedule+146,$top_bottom_schedule+11,15,5,5,-1,32,"^3LOAD",load_server_name_3 ); ENDIF ENDIF IF ( $server_name_4 != "") THEN openPrivButton( "schedule_server_name_4",$left_right_schedule+1,$top_bottom_schedule+16,39,5,5,-1,32,"^3".$server_name_4 ); IF ( $server_name_4 == $server_name_schedule) THEN openPrivButton( "schedule_server_name_4_activate",$left_right_schedule+40,$top_bottom_schedule+16,15,5,5,-1,32,"^2LOADED" ); ELSE openPrivButton( "schedule_server_name_4_activate",$left_right_schedule+40,$top_bottom_schedule+16,15,5,5,-1,32,"^3LOAD",load_server_name_4 ); ENDIF ENDIF IF ( $server_name_5 != "") THEN openPrivButton( "schedule_server_name_5",$left_right_schedule+55,$top_bottom_schedule+16,38,5,5,-1,32,"^3".$server_name_5 ); IF ( $server_name_5 == $server_name_schedule) THEN openPrivButton( "schedule_server_name_5_activate",$left_right_schedule+93,$top_bottom_schedule+16,15,5,5,-1,32,"^2LOADED" ); ELSE openPrivButton( "schedule_server_name_5_activate",$left_right_schedule+93,$top_bottom_schedule+16,15,5,5,-1,32,"^3LOAD",load_server_name_5 ); ENDIF ENDIF IF ( $server_name_6 != "") THEN openPrivButton( "schedule_server_name_6",$left_right_schedule+108,$top_bottom_schedule+16,38,5,5,-1,32,"^3".$server_name_6 ); IF ( $server_name_6 == $server_name_schedule) THEN openPrivButton( "schedule_server_name_6_activate",$left_right_schedule+146,$top_bottom_schedule+16,15,5,5,-1,32,"^2LOADED" ); ELSE openPrivButton( "schedule_server_name_6_activate",$left_right_schedule+146,$top_bottom_schedule+16,15,5,5,-1,32,"^3LOAD",load_server_name_6 ); ENDIF ENDIF IF ( $server_name_7 != "") THEN openPrivButton( "schedule_server_name_7",$left_right_schedule+1,$top_bottom_schedule+21,39,5,5,-1,32,"^3".$server_name_7 ); IF ( $server_name_7 != "" && $server_name_7 == $server_name_schedule) THEN openPrivButton( "schedule_server_name_7_activate",$left_right_schedule+40,$top_bottom_schedule+21,15,5,5,-1,32,"^2LOADED" ); ELSE openPrivButton( "schedule_server_name_7_activate",$left_right_schedule+40,$top_bottom_schedule+21,15,5,5,-1,32,"^3LOAD",load_server_name_7 ); ENDIF ENDIF IF ( $server_name_8 != "") THEN openPrivButton( "schedule_server_name_8",$left_right_schedule+55,$top_bottom_schedule+21,38,5,5,-1,32,"^3".$server_name_8 ); IF ( $server_name_8 == $server_name_schedule) THEN openPrivButton( "schedule_server_name_8_activate",$left_right_schedule+93,$top_bottom_schedule+21,15,5,5,-1,32,"^2LOADED" ); ELSE openPrivButton( "schedule_server_name_8_activate",$left_right_schedule+93,$top_bottom_schedule+21,15,5,5,-1,32,"^3LOAD",load_server_name_8 ); ENDIF ENDIF openPrivButton( "schedule_number",$left_right_schedule+1,$top_bottom_schedule+31,5,5,5,-1,32,"^2#" ); openPrivButton( "schedule_date",$left_right_schedule+6,$top_bottom_schedule+31,15,5,5,-1,32,"^2Date" ); openPrivButton( "schedule_time",$left_right_schedule+21,$top_bottom_schedule+31,15,5,5,-1,32,"^2Time" ); openPrivButton( "schedule_track",$left_right_schedule+36,$top_bottom_schedule+31,15,5,5,-1,32,"^2Track" ); openPrivButton( "schedule_cars",$left_right_schedule+51,$top_bottom_schedule+31,50,5,5,-1,32,"^2Cars" ); openPrivButton( "schedule_laps",$left_right_schedule+101,$top_bottom_schedule+31,15,5,5,-1,32,"^2Laps" ); openPrivButton( "schedule_comment",$left_right_schedule+116,$top_bottom_schedule+31,45,5,5,-1,32,"^2Comment" ); $top_bottom_schedule = 66; FOR ($i=1;$i<=14;$i=$i+1) IF ($date_schedule_array[1,$i] != "") THEN $Year_2 = subStr( $date_schedule_array[1,$i], 6, 2); $Month_2 = subStr( $date_schedule_array[1,$i], 3 , 2); $Day_2 = subStr( $date_schedule_array[1,$i], 0 , 2); IF ($Year_2 == $Year) THEN IF ($Month_2 == $Month) THEN IF ($Day_2 > $Day) THEN $color="^7"; ELSE IF ($Day_2 == $Day) THEN $color="^7"; ELSE $color="^8"; ENDIF ENDIF ELSE IF ($Month_2 > $Month) THEN $color="^7"; ELSE $color="^8"; ENDIF ENDIF ELSE IF ($Year_2 > $Year) THEN $color="^7"; ELSE $color="^8"; ENDIF ENDIF IF ($i < 10) THEN $number="0".$i; ELSE $number=$i; ENDIF openPrivButton( "schedule_number_".$i,$left_right_schedule+1,$top_bottom_schedule,5,5,5,-1,96,$color . $number.": " ); openPrivButton( "schedule_date_".$i,$left_right_schedule+6,$top_bottom_schedule,15,5,5,-1,32,$color . $date_schedule_array[1,$i] ); openPrivButton( "schedule_time_".$i,$left_right_schedule+21,$top_bottom_schedule,15,5,5,-1,32,$color . $time_schedule_array[1,$i] ); openPrivButton( "schedule_track_".$i,$left_right_schedule+36,$top_bottom_schedule,15,5,5,-1,32,$color . $track_schedule_array[1,$i] ); openPrivButton( "schedule_cars_".$i,$left_right_schedule+51,$top_bottom_schedule,50,5,5,-1,32,$color . $cars_schedule_array[1,$i] ); openPrivButton( "schedule_laps_".$i,$left_right_schedule+101,$top_bottom_schedule,15,5,5,-1,32,$color . $laps_schedule_array[1,$i] ); openPrivButton( "schedule_comment_".$i,$left_right_schedule+116,$top_bottom_schedule,45,5,5,-1,32,$color . $comment_schedule_array[1,$i] ); $top_bottom_schedule=$top_bottom_schedule+5; ELSE IF ($i < 10) THEN $number="0".$i; ELSE $number=$i; ENDIF openPrivButton( "schedule_number_".$i,$left_right_schedule+1,$top_bottom_schedule,5,5,5,-1,96,"^7" . $number.": " ); $top_bottom_schedule=$top_bottom_schedule+5; ENDIF ENDFOR $top_bottom_schedule = 141; openPrivButton( "schedule_close",$left_right_schedule+1,$top_bottom_schedule+1,160,5,5,-1,32,"^3Close",schedule_close ); EndSub Sub load_server_name_1 ( $KeyFlags,$id ) $server_name_schedule=$server_name_1; schedule_close ( $KeyFlags,$id ); Schedule ( $KeyFlags ); EndSub Sub load_server_name_2 ( $KeyFlags,$id ) $server_name_schedule=$server_name_2; schedule_close ( $KeyFlags,$id ); Schedule ( $KeyFlags ); EndSub Sub load_server_name_3 ( $KeyFlags,$id ) $server_name_schedule=$server_name_3; schedule_close ( $KeyFlags,$id ); Schedule ( $KeyFlags ); EndSub Sub load_server_name_4 ( $KeyFlags,$id ) $server_name_schedule=$server_name_4; schedule_close ( $KeyFlags,$id ); Schedule ( $KeyFlags ); EndSub Sub load_server_name_5 ( $KeyFlags,$id ) $server_name_schedule=$server_name_5; schedule_close ( $KeyFlags,$id ); Schedule ( $KeyFlags ); EndSub Sub load_server_name_6 ( $KeyFlags,$id ) $server_name_schedule=$server_name_6; schedule_close ( $KeyFlags,$id ); Schedule ( $KeyFlags ); EndSub Sub load_server_name_7 ( $KeyFlags,$id ) $server_name_schedule=$server_name_7; schedule_close ( $KeyFlags,$id ); Schedule ( $KeyFlags ); EndSub Sub load_server_name_8 ( $KeyFlags,$id ) $server_name_schedule=$server_name_8; schedule_close ( $KeyFlags,$id ); Schedule ( $KeyFlags ); EndSub Sub schedule_close ( $KeyFlags,$id ) closePrivButton("schedule_gui_bg"); closePrivButton("schedule_title"); closePrivButton("schedule_server_name"); closePrivButton("schedule_number"); closePrivButton("schedule_date"); closePrivButton("schedule_time"); closePrivButton("schedule_track"); closePrivButton("schedule_cars"); closePrivButton("schedule_laps"); closePrivButton("schedule_comment"); FOR ($i=1;$i<=14;$i=$i+1) closePrivButton("schedule_server_name_".$i); closePrivButton("schedule_server_name_".$i."_activate"); closePrivButton("schedule_number_".$i); closePrivButton("schedule_date_".$i); closePrivButton("schedule_time_".$i); closePrivButton("schedule_track_".$i); closePrivButton("schedule_cars_".$i); closePrivButton("schedule_laps_".$i); closePrivButton("schedule_comment_".$i); ENDFOR IF ( $id == "schedule_close" ) THEN $server_name_schedule = ""; ENDIF closePrivButton("schedule_close"); EndSub Sub Schedule_trackcheck () ### Set server_name and storage_name ### $server_name_schedule = getLapperVar( "HostName" ); $storage_name = "SCHEDULE_".$server_name_schedule; ### End ### $date_schedule_array[1,1] = GetStoredValue( $storage_name . "date_1" ); $time_schedule_array[1,1] = GetStoredValue( $storage_name . "time_1" ); $track_schedule_array[1,1] = GetStoredValue( $storage_name . "track_1" ); $cars_schedule_array[1,1] = GetStoredValue( $storage_name . "cars_1" ); $laps_schedule_array[1,1] = GetStoredValue( $storage_name . "laps_1" ); $comment_schedule_array[1,1] = GetStoredValue( $storage_name . "comment_1" ); $password_schedule_array[1,1] = GetStoredValue( $storage_name . "password_1" ); $race_id_schedule_array[1,1] = GetStoredValue( $storage_name . "race_id_1" ); $date_schedule_array[1,2] = GetStoredValue( $storage_name . "date_2" ); $time_schedule_array[1,2] = GetStoredValue( $storage_name . "time_2" ); $track_schedule_array[1,2] = GetStoredValue( $storage_name . "track_2" ); $cars_schedule_array[1,2] = GetStoredValue( $storage_name . "cars_2" ); $laps_schedule_array[1,2] = GetStoredValue( $storage_name . "laps_2" ); $comment_schedule_array[1,2] = GetStoredValue( $storage_name . "comment_2" ); $password_schedule_array[1,2] = GetStoredValue( $storage_name . "password_2" ); $race_id_schedule_array[1,2] = GetStoredValue( $storage_name . "race_id_2" ); $date_schedule_array[1,3] = GetStoredValue( $storage_name . "date_3" ); $time_schedule_array[1,3] = GetStoredValue( $storage_name . "time_3" ); $track_schedule_array[1,3] = GetStoredValue( $storage_name . "track_3" ); $cars_schedule_array[1,3] = GetStoredValue( $storage_name . "cars_3" ); $laps_schedule_array[1,3] = GetStoredValue( $storage_name . "laps_3" ); $comment_schedule_array[1,3] = GetStoredValue( $storage_name . "comment_3" ); $password_schedule_array[1,3] = GetStoredValue( $storage_name . "password_3" ); $race_id_schedule_array[1,3] = GetStoredValue( $storage_name . "race_id_3" ); $date_schedule_array[1,4] = GetStoredValue( $storage_name . "date_4" ); $time_schedule_array[1,4] = GetStoredValue( $storage_name . "time_4" ); $track_schedule_array[1,4] = GetStoredValue( $storage_name . "track_4" ); $cars_schedule_array[1,4] = GetStoredValue( $storage_name . "cars_4" ); $laps_schedule_array[1,4] = GetStoredValue( $storage_name . "laps_4" ); $comment_schedule_array[1,4] = GetStoredValue( $storage_name . "comment_4" ); $password_schedule_array[1,4] = GetStoredValue( $storage_name . "password_4" ); $race_id_schedule_array[1,4] = GetStoredValue( $storage_name . "race_id_4" ); $date_schedule_array[1,5] = GetStoredValue( $storage_name . "date_5" ); $time_schedule_array[1,5] = GetStoredValue( $storage_name . "time_5" ); $track_schedule_array[1,5] = GetStoredValue( $storage_name . "track_5" ); $cars_schedule_array[1,5] = GetStoredValue( $storage_name . "cars_5" ); $laps_schedule_array[1,5] = GetStoredValue( $storage_name . "laps_5" ); $comment_schedule_array[1,5] = GetStoredValue( $storage_name . "comment_5" ); $password_schedule_array[1,5] = GetStoredValue( $storage_name . "password_5" ); $race_id_schedule_array[1,5] = GetStoredValue( $storage_name . "race_id_5" ); $date_schedule_array[1,6] = GetStoredValue( $storage_name . "date_6" ); $time_schedule_array[1,6] = GetStoredValue( $storage_name . "time_6" ); $track_schedule_array[1,6] = GetStoredValue( $storage_name . "track_6" ); $cars_schedule_array[1,6] = GetStoredValue( $storage_name . "cars_6" ); $laps_schedule_array[1,6] = GetStoredValue( $storage_name . "laps_6" ); $comment_schedule_array[1,6] = GetStoredValue( $storage_name . "comment_6" ); $password_schedule_array[1,6] = GetStoredValue( $storage_name . "password_6" ); $race_id_schedule_array[1,6] = GetStoredValue( $storage_name . "race_id_6" ); $date_schedule_array[1,7] = GetStoredValue( $storage_name . "date_7" ); $time_schedule_array[1,7] = GetStoredValue( $storage_name . "time_7" ); $track_schedule_array[1,7] = GetStoredValue( $storage_name . "track_7" ); $cars_schedule_array[1,7] = GetStoredValue( $storage_name . "cars_7" ); $laps_schedule_array[1,7] = GetStoredValue( $storage_name . "laps_7" ); $comment_schedule_array[1,7] = GetStoredValue( $storage_name . "comment_7" ); $password_schedule_array[1,7] = GetStoredValue( $storage_name . "password_7" ); $race_id_schedule_array[1,7] = GetStoredValue( $storage_name . "race_id_7" ); $date_schedule_array[1,8] = GetStoredValue( $storage_name . "date_8" ); $time_schedule_array[1,8] = GetStoredValue( $storage_name . "time_8" ); $track_schedule_array[1,8] = GetStoredValue( $storage_name . "track_8" ); $cars_schedule_array[1,8] = GetStoredValue( $storage_name . "cars_8" ); $laps_schedule_array[1,8] = GetStoredValue( $storage_name . "laps_8" ); $comment_schedule_array[1,8] = GetStoredValue( $storage_name . "comment_8" ); $password_schedule_array[1,8] = GetStoredValue( $storage_name . "password_8" ); $race_id_schedule_array[1,8] = GetStoredValue( $storage_name . "race_id_8" ); $date_schedule_array[1,9] = GetStoredValue( $storage_name . "date_9" ); $time_schedule_array[1,9] = GetStoredValue( $storage_name . "time_9" ); $track_schedule_array[1,9] = GetStoredValue( $storage_name . "track_9" ); $cars_schedule_array[1,9] = GetStoredValue( $storage_name . "cars_9" ); $laps_schedule_array[1,9] = GetStoredValue( $storage_name . "laps_9" ); $comment_schedule_array[1,9] = GetStoredValue( $storage_name . "comment_9" ); $password_schedule_array[1,9] = GetStoredValue( $storage_name . "password_9" ); $race_id_schedule_array[1,9] = GetStoredValue( $storage_name . "race_id_9" ); $date_schedule_array[1,10] = GetStoredValue( $storage_name . "date_10" ); $time_schedule_array[1,10] = GetStoredValue( $storage_name . "time_10" ); $track_schedule_array[1,10] = GetStoredValue( $storage_name . "track_10" ); $cars_schedule_array[1,10] = GetStoredValue( $storage_name . "cars_10" ); $laps_schedule_array[1,10] = GetStoredValue( $storage_name . "laps_10" ); $comment_schedule_array[1,10] = GetStoredValue( $storage_name . "comment_10" ); $password_schedule_array[1,10] = GetStoredValue( $storage_name . "password_10" ); $race_id_schedule_array[1,10] = GetStoredValue( $storage_name . "race_id_10" ); $date_schedule_array[1,11] = GetStoredValue( $storage_name . "date_11" ); $time_schedule_array[1,11] = GetStoredValue( $storage_name . "time_11" ); $track_schedule_array[1,11] = GetStoredValue( $storage_name . "track_11" ); $cars_schedule_array[1,11] = GetStoredValue( $storage_name . "cars_11" ); $laps_schedule_array[1,11] = GetStoredValue( $storage_name . "laps_11" ); $comment_schedule_array[1,11] = GetStoredValue( $storage_name . "comment_11" ); $password_schedule_array[1,11] = GetStoredValue( $storage_name . "password_11" ); $race_id_schedule_array[1,11] = GetStoredValue( $storage_name . "race_id_11" ); $date_schedule_array[1,12] = GetStoredValue( $storage_name . "date_12" ); $time_schedule_array[1,12] = GetStoredValue( $storage_name . "time_12" ); $track_schedule_array[1,12] = GetStoredValue( $storage_name . "track_12" ); $cars_schedule_array[1,12] = GetStoredValue( $storage_name . "cars_12" ); $laps_schedule_array[1,12] = GetStoredValue( $storage_name . "laps_12" ); $comment_schedule_array[1,12] = GetStoredValue( $storage_name . "comment_12" ); $password_schedule_array[1,12] = GetStoredValue( $storage_name . "password_12" ); $race_id_schedule_array[1,12] = GetStoredValue( $storage_name . "race_id_12" ); $date_schedule_array[1,13] = GetStoredValue( $storage_name . "date_13" ); $time_schedule_array[1,13] = GetStoredValue( $storage_name . "time_13" ); $track_schedule_array[1,13] = GetStoredValue( $storage_name . "track_13" ); $cars_schedule_array[1,13] = GetStoredValue( $storage_name . "cars_13" ); $laps_schedule_array[1,13] = GetStoredValue( $storage_name . "laps_13" ); $comment_schedule_array[1,13] = GetStoredValue( $storage_name . "comment_13" ); $password_schedule_array[1,13] = GetStoredValue( $storage_name . "password_13" ); $race_id_schedule_array[1,13] = GetStoredValue( $storage_name . "race_id_13" ); $date_schedule_array[1,14] = GetStoredValue( $storage_name . "date_14" ); $time_schedule_array[1,14] = GetStoredValue( $storage_name . "time_14" ); $track_schedule_array[1,14] = GetStoredValue( $storage_name . "track_14" ); $cars_schedule_array[1,14] = GetStoredValue( $storage_name . "cars_14" ); $laps_schedule_array[1,14] = GetStoredValue( $storage_name . "laps_14" ); $comment_schedule_array[1,14] = GetStoredValue( $storage_name . "comment_14" ); $password_schedule_array[1,14] = GetStoredValue( $storage_name . "password_14" ); $race_id_schedule_array[1,14] = GetStoredValue( $storage_name . "race_id_14" ); $CurrDate = getLapperVar( "ShortDate" ); $Year = subStr( $CurrDate, 6, 2); $Month = subStr( $CurrDate, 3 , 2); $Day = subStr( $CurrDate, 0 , 2); $storage_name = "HCS_".$server_name_schedule; FOR ($i=1;$i<=14;$i=$i+1) IF ($date_schedule_array[1,$i] != "") THEN $Year_2 = subStr( $date_schedule_array[1,$i], 6, 2); $Month_2 = subStr( $date_schedule_array[1,$i], 3 , 2); $Day_2 = subStr( $date_schedule_array[1,$i], 0 , 2); IF ($Year_2 == $Year) THEN IF ($Month_2 == $Month) THEN IF ($Day == $Day_2) THEN IF ( getLapperVar( "ShortTrackName" ) == $track_schedule_array[1,$i]) THEN writeline($server_name_schedule . " - Only password needs to be set"); cmdLFS("/pass " . $password_schedule_array[1,$i]); cmdLFS("/canreset no"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF break; ELSE writeline($server_name_schedule . " - Track and password needs to be set"); cmdLFS("/track " . $track_schedule_array[1,$i]); cmdLFS("/cars " . $cars_schedule_array[1,$i]); cmdLFS("/laps " . $laps_schedule_array[1,$i]); cmdLFS("/qual 240"); cmdLFS("/pass " . $password_schedule_array[1,$i]); cmdLFS("/canreset no"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF break; ENDIF ENDIF IF ($Day_2 > $Day) THEN IF ( getLapperVar( "ShortTrackName" ) != $track_schedule_array[1,$i]) THEN writeline($server_name_schedule . " - Next race is: ".$date_schedule_array[1,$i]); cmdLFS("/track " . $track_schedule_array[1,$i]); cmdLFS("/cars " . $cars_schedule_array[1,$i]); cmdLFS("/laps " . $laps_schedule_array[1,$i]); cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); break; ELSE cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); break; ENDIF ENDIF ELSE IF ($Month_2 > $Month) THEN IF ( getLapperVar( "ShortTrackName" ) != $track_schedule_array[1,$i]) THEN writeline($server_name_schedule . " - Next race is: ".$date_schedule_array[1,$i]); cmdLFS("/track " . $track_schedule_array[1,$i]); cmdLFS("/cars " . $cars_schedule_array[1,$i]); cmdLFS("/laps " . $laps_schedule_array[1,$i]); cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); break; ELSE cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); break; ENDIF ENDIF ENDIF ELSE IF ($Year_2 > $Year) THEN IF ( getLapperVar( "ShortTrackName" ) != $track_schedule_array[1,$i]) THEN writeline($server_name_schedule . " - Next race is: ".$date_schedule_array[1,$i]); cmdLFS("/track " . $track_schedule_array[1,$i]); cmdLFS("/cars " . $cars_schedule_array[1,$i]); cmdLFS("/laps " . $laps_schedule_array[1,$i]); cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); break; ELSE cmdLFS("/qual 240"); cmdLFS("/pass practice"); cmdLFS("/canreset yes"); IF ($race_id_schedule_array[1,$i] != "") THEN $race_id_handicaps = GetStoredValue( $storage_name . "race_id" ); IF ($race_id_handicaps == $race_id_schedule_array[1,$i]) THEN $class_indicator = GetStoredValue( $storage_name . "class_indicator" ); $number_of_classes = GetStoredValue( $storage_name . "number_of_classes" ); $number_of_cars = GetStoredValue( $storage_name . "number_of_cars" ); $car_1 = GetStoredValue( $storage_name . "car_1" ); $car_2 = GetStoredValue( $storage_name . "car_2" ); $car_3 = GetStoredValue( $storage_name . "car_3" ); $car_4 = GetStoredValue( $storage_name . "car_4" ); $mass_1_1 = GetStoredValue( $storage_name . "mass_1_1" ); $mass_1_2 = GetStoredValue( $storage_name . "mass_1_2" ); $mass_1_3 = GetStoredValue( $storage_name . "mass_1_3" ); $mass_1_4 = GetStoredValue( $storage_name . "mass_1_4" ); $mass_1_5 = GetStoredValue( $storage_name . "mass_1_5" ); $mass_2_1 = GetStoredValue( $storage_name . "mass_2_1" ); $mass_2_2 = GetStoredValue( $storage_name . "mass_2_2" ); $mass_2_3 = GetStoredValue( $storage_name . "mass_2_3" ); $mass_2_4 = GetStoredValue( $storage_name . "mass_2_4" ); $mass_2_5 = GetStoredValue( $storage_name . "mass_2_5" ); $mass_3_1 = GetStoredValue( $storage_name . "mass_3_1" ); $mass_3_2 = GetStoredValue( $storage_name . "mass_3_2" ); $mass_3_3 = GetStoredValue( $storage_name . "mass_3_3" ); $mass_3_4 = GetStoredValue( $storage_name . "mass_3_4" ); $mass_3_5 = GetStoredValue( $storage_name . "mass_3_5" ); $mass_4_1 = GetStoredValue( $storage_name . "mass_4_1" ); $mass_4_2 = GetStoredValue( $storage_name . "mass_4_2" ); $mass_4_3 = GetStoredValue( $storage_name . "mass_4_3" ); $mass_4_4 = GetStoredValue( $storage_name . "mass_4_4" ); $mass_4_5 = GetStoredValue( $storage_name . "mass_4_5" ); $intake_1_1 = GetStoredValue( $storage_name . "intake_1_1" ); $intake_1_2 = GetStoredValue( $storage_name . "intake_1_2" ); $intake_1_3 = GetStoredValue( $storage_name . "intake_1_3" ); $intake_1_4 = GetStoredValue( $storage_name . "intake_1_4" ); $intake_1_5 = GetStoredValue( $storage_name . "intake_1_5" ); $intake_2_1 = GetStoredValue( $storage_name . "intake_2_1" ); $intake_2_2 = GetStoredValue( $storage_name . "intake_2_2" ); $intake_2_3 = GetStoredValue( $storage_name . "intake_2_3" ); $intake_2_4 = GetStoredValue( $storage_name . "intake_2_4" ); $intake_2_5 = GetStoredValue( $storage_name . "intake_2_5" ); $intake_3_1 = GetStoredValue( $storage_name . "intake_3_1" ); $intake_3_2 = GetStoredValue( $storage_name . "intake_3_2" ); $intake_3_3 = GetStoredValue( $storage_name . "intake_3_3" ); $intake_3_4 = GetStoredValue( $storage_name . "intake_3_4" ); $intake_3_5 = GetStoredValue( $storage_name . "intake_3_5" ); $intake_4_1 = GetStoredValue( $storage_name . "intake_4_1" ); $intake_4_2 = GetStoredValue( $storage_name . "intake_4_2" ); $intake_4_3 = GetStoredValue( $storage_name . "intake_4_3" ); $intake_4_4 = GetStoredValue( $storage_name . "intake_4_4" ); $intake_4_5 = GetStoredValue( $storage_name . "intake_4_5" ); writeline( "Handicaps for race ID ".$race_id_schedule_array[1,$i]." have been loaded" ); ENDIF ENDIF setConfigVar( DefaultTopCar, $cars_schedule_array[1,$i] ); break; ENDIF ENDIF ENDIF ENDIF ENDFOR EndSub Sub OnNewPlayerJoin_Schedule() IF ($join_track_allowed == "false") THEN cmdLFS("/spec " . GetCurrentPlayerVar("UserName") ); Privmsg ( "^7Lapper is currently busy setting track/cars/password" ); ENDIF EndSub