######################################################################### # Event triggered when lapper start ######################################################################### Event OnLapperStart() GlobalVar $pitb ; $pitb = "0" ; GlobalVar $origL ; $origL = "50" ; GlobalVar $origT ; $origT = "40" ; GlobalVar $PBorigL ; $PBorigL = "1" ; GlobalVar $PBorigT ; $PBorigT = "70" ; GlobalVar $PB2Left ; $PB2Left = "0" ; EndEvent ######################################################################### # Splitting # ######################################################################### Event OnSplit1() IF ($pitb == "1" ) THEN IF ($DiffSectorSplit1 > "0.00.50") THEN openPrivButton( "1st_split",$PBorigL + $PB2Left + 1,$PBorigT + 41,30,4,4,10,16,"^1you've lost^8: " . $DiffSectorSplit1 ); ENDIF IF ($DiffSectorSplit1 < "-0.00.00") THEN openPrivButton( "1st_split",$PBorigL + $PB2Left + 1,$PBorigT + 41,30,4,4,10,16,"^2you've gained^8: " . $DiffSectorSplit1 ); ENDIF ENDIF EndEvent Event OnSplit2() IF ($pitb == "1" ) THEN IF ($DiffSectorSplit2 > "0.00.50") THEN openPrivButton( "2nd_split",$PBorigL + $PB2Left + 1,$PBorigT + 41,30,4,4,10,16,"^1you've lost^8: " . $DiffSectorSplit2 ); ENDIF IF ($DiffSectorSplit2 < "-0.00.00") THEN openPrivButton( "2nd_split",$PBorigL + $PB2Left + 1,$PBorigT + 41,30,4,4,10,16,"^2you've gained^8: " . $DiffSectorSplit2 ); ENDIF ENDIF EndEvent Event OnSplit3() IF ($pitb == "1" ) THEN IF ($DiffSectorSplit3 > "0.00.50") THEN openPrivButton( "3rd_split",$PBorigL + $PB2Left + 1,$PBorigT + 41,30,4,4,10,16,"^1you've lost^8: " . $DiffSectorSplit3 ); ENDIF IF ($DiffSectorSplit3 < "-0.00.00") THEN openPrivButton( "3rd_split",$PBorigL + $PB2Left + 1,$PBorigT + 41,30,4,4,10,16,"^2you've gained^8: " . $DiffSectorSplit3 ); ENDIF ENDIF EndEvent Event OnLap() IF ($pitb == "1" ) THEN IF ($DiffSectorSplitLast > "0.00.50") THEN openPrivButton( "last_split",$PBorigL + $PB2Left + 1,$PBorigT + 41,30,4,4,10,16,"^1you've lost^8: " . $DiffSectorSplitLast ); ENDIF IF ($DiffSectorSplitLast < "-0.00.00") THEN openPrivButton( "last_split",$PBorigL + $PB2Left + 1,$PBorigT + 41,30,4,4,10,16,"^2you've gained^8: " . $DiffSectorSplitLast ); ENDIF ENDIF EndEvent ######################################################################### # SPB Splitting # ######################################################################### # Private Messages that are send on spb. # Message on lower split : Message on upper split # Local var #----------------------------------------------------------------- $ShowSplitPB = true; Event OnSpbSplit1() IF( $isBestSectorSplit1 == 1 ) THEN $color = "^2"; ELSE $color = "^1"; ENDIF IF ($pitb == "1" ) THEN openPrivButton( "pitboard_total",$PBorigL + $PB2Left,$PBorigT,32,50,5,-1,32,""); openPrivButton( "pitboard_txt",$PBorigL + $PB2Left + 1,$PBorigT + 1,30,4,4,-1,32,"Pitboard" . "&" . $Nickname); closePrivButton("sec2_txt&sec3_txt&final_txt"); openPrivButton( "sec1_txt",$PBorigL + $PB2Left + 1,$PBorigT + 9,15,4,4,-1,16,"Time sector 1:" . "&" . $color . $SectorSplit1); IF ( $SectorSplit1 < $BestSectorSplit1) THEN openPrivButton( "best_s1_txt",$PBorigL + $PB2Left + 16,$PBorigT + 9,15,4,4,-1,16,"Best sector 1:" . "&" . $SectorSplit1); openPrivButton( "best_lap_txt",$PBorigL + $PB2Left + 16,$PBorigT + 33,15,4,4,-1,16,"Best poss. lap:" . "&" . $color . $Tpb); ELSE openPrivButton( "best_s1_txt",$PBorigL + $PB2Left + 16,$PBorigT + 9,15,4,4,-1,16,"Best sector 1:" . "&" . $BestSectorSplit1); openPrivButton( "best_lap_txt",$PBorigL + $PB2Left + 16,$PBorigT + 33,15,4,4,-1,16,"Best poss. lap:" . "&" . $Tpb); ENDIF ELSE openPrivButton( "id_spb",50,55,100,10,10,5,0,$typ . " ^7SP1" . ": " . $SectorSplit1 . " " . $color . "(" . $DiffSectorSplit1 . ")" . "&^7TPB:" . $Tpb); ENDIF EndEvent Event OnSpbSplit2() IF( $isBestSectorSplit2 == 1 ) THEN $color = "^2"; ELSE $color = "^1"; ENDIF IF ($pitb == "1" ) THEN openPrivButton( "sec2_txt",$PBorigL + $PB2Left + 1,$PBorigT + 17,15,4,4,-1,16,"Time sector 2:" . "&" . $color . $SectorSplit2); IF ( $SectorSplit2 < $BestSectorSplit2) THEN openPrivButton( "best_s2_txt",$PBorigL + $PB2Left + 16,$PBorigT + 17,15,4,4,-1,16,"Best sector 2:" . "&" . $SectorSplit2); openPrivButton( "best_lap_txt",$PBorigL + $PB2Left + 16,$PBorigT + 33,15,4,4,-1,16,"Best poss. lap:" . "&" . $color . $Tpb); ELSE openPrivButton( "best_s2_txt",$PBorigL + $PB2Left + 16,$PBorigT + 17,15,4,4,-1,16,"Best sector 2:" . "&" . $BestSectorSplit2); openPrivButton( "best_lap_txt",$PBorigL + $PB2Left + 16,$PBorigT + 33,15,4,4,-1,16,"Best poss. lap:" . "&" . $Tpb); ENDIF ELSE openPrivButton( "id_spb",50,55,100,10,10,5,0,$typ . " ^7SP2" . ": " . $SectorSplit2 . " " . $color . "(" . $DiffSectorSplit2 . ")" . "&^7TPB:" . $Tpb); ENDIF EndEvent Event OnSpbSplit3() IF( $isBestSectorSplit3 == 1 ) THEN $color = "^2"; ELSE $color = "^1"; ENDIF IF ($pitb == "1" ) THEN openPrivButton( "sec3_txt",$PBorigL + $PB2Left + 1,$PBorigT + 25,15,4,4,-1,16,"Time sector 3:" . "&" . $color . $SectorSplit3); IF ( $SectorSplit3 < $BestSectorSplit3) THEN openPrivButton( "best_s3_txt",$PBorigL + $PB2Left + 16,$PBorigT + 25,15,4,4,-1,16,"Best sector 3:" . "&" . $SectorSplit3); openPrivButton( "best_lap_txt",$PBorigL + $PB2Left + 16,$PBorigT + 33,15,4,4,-1,16,"Best poss. lap:" . "&" . $color . $Tpb); ELSE openPrivButton( "best_s3_txt",$PBorigL + $PB2Left + 16,$PBorigT + 25,15,4,4,-1,16,"Best sector 3:" . "&" . $BestSectorSplit3); openPrivButton( "best_lap_txt",$PBorigL + $PB2Left + 16,$PBorigT + 33,15,4,4,-1,16,"Best poss. lap:" . "&" . $Tpb); ENDIF ELSE openPrivButton( "id_spb",50,55,100,10,10,5,0,$typ . " ^7SP3" . ": " . $SectorSplit3 . " " . $color . "(" . $DiffSectorSplit3 . ")" . "&^7TPB:" . $Tpb); ENDIF EndEvent Event OnSpbLast() IF( $isBestSectorSplitLast == 1 ) THEN $color = "^2"; ELSE $color = "^1"; ENDIF IF ($pitb == "1" ) THEN openPrivButton( "final_txt",$PBorigL + $PB2Left + 1,$PBorigT + 25,15,4,4,-1,16,"Time sector 3:" . "&" . $color . $SectorSplitLast); IF ( $SectorSplitLast < $BestSectorSplitLast) THEN openPrivButton( "best_final_txt",$PBorigL + $PB2Left + 16,$PBorigT + 25,15,4,4,-1,16,"Best sector 3:" . "&" . $SectorSplitLast); openPrivButton( "best_lap_txt",$PBorigL + $PB2Left + 16,$PBorigT + 33,15,4,4,-1,16,"Best poss. lap:" . "&" . $color . $Tpb); ELSE openPrivButton( "best_final_txt",$PBorigL + $PB2Left + 16,$PBorigT + 25,15,4,4,-1,16,"Best sector 3:" . "&" . $BestSectorSplitLast); openPrivButton( "best_lap_txt",$PBorigL + $PB2Left + 16,$PBorigT + 33,15,4,4,-1,16,"Best poss. lap:" . "&" . $Tpb); ENDIF openPrivButton( "last_lap_txt",$PBorigL + $PB2Left + 1,$PBorigT + 33,15,4,4,-1,16,"Last lap:" . "&" . $LapTime); ELSE openPrivButton( "id_spb",50,55,100,10,10,5,0,$typ . " ^7SPL: " . $SectorSplitLast . " " . $color . "(" . $DiffSectorSplitLast . ")&^7TPB:" . $Tpb . " Avg:" . $AvgSpeed . " " . $UnitSpeed ); ENDIF EndEvent ################################################################# # Actions to do on splits relative to trackinfo.cfg. You can override this in the track/car section # If more actions, separate them with ':'. If different action by split time, separate them with ':' ################################################################# # Local variable # {SplitTime} - Split time ################################################################# Sub TRI_split1_0() IF ($pitb == "1" ) THEN closeGlobalButton("great_1st_split&good_1st_split&great_2nd_split&good_2nd_split&great_3rd_split&good_3rd_split&great_lap&good_lap"); openGlobalButton( "great_1st_split",$PBorigL + $PB2Left + 1,$PBorigT + 45,30,4,4,10,16,"^2Great ^71st split " . $Nickname ); ELSE cmdLFS( "/msg Great 1st split (" . $SplitTime . ") by " . $Nickname . "^8!" ); ENDIF EndSub Sub TRI_split1_1() IF ($pitb == "1" ) THEN closeGlobalButton("great_1st_split&good_1st_split&great_2nd_split&good_2nd_split&great_3rd_split&good_3rd_split&great_lap&good_lap"); openGlobalButton( "good_1st_split",$PBorigL + $PB2Left + 1,$PBorigT + 45,30,4,4,10,16,"^3Good ^71st split " . $Nickname ); ELSE cmdLFS( "/msg Good 1st split (" . $SplitTime . ") by " . $Nickname . "^8!" ); ENDIF EndSub Sub TRI_split2_0() IF ($pitb == "1" ) THEN closeGlobalButton("great_1st_split&good_1st_split&great_2nd_split&good_2nd_split&great_3rd_split&good_3rd_split&great_lap&good_lap"); openGlobalButton( "great_2nd_split",$PBorigL + $PB2Left + 1,$PBorigT + 45,30,4,4,10,16,"^2Great ^72nd split " . $Nickname ); ELSE cmdLFS( "/msg Great 2nd split (" . $SplitTime . ") by " . $Nickname . "^8!" ); ENDIF EndSub Sub TRI_split2_1() IF ($pitb == "1" ) THEN closeGlobalButton("great_1st_split&good_1st_split&great_2nd_split&good_2nd_split&great_3rd_split&good_3rd_split&great_lap&good_lap"); openGlobalButton( "good_2nd_split",$PBorigL + $PB2Left + 1,$PBorigT + 45,30,4,4,10,16,"^3Good ^72nd split " . $Nickname ); ELSE cmdLFS( "/msg Good 2nd split (" . $SplitTime . ") by " . $Nickname . "^8!" ); ENDIF EndSub Sub TRI_split3_0() IF ($pitb == "1" ) THEN closeGlobalButton("great_1st_split&good_1st_split&great_2nd_split&good_2nd_split&great_3rd_split&good_3rd_split&great_lap&good_lap"); openGlobalButton( "great_3rd_split",$PBorigL + $PB2Left + 1,$PBorigT + 45,30,4,4,10,16,"^2Great ^73rd split " . $Nickname ); ELSE cmdLFS( "/msg Great 3rd split (" . $SplitTime . ") by " . $Nickname . "^8!" ); ENDIF EndSub Sub TRI_split3_1() IF ($pitb == "1" ) THEN closeGlobalButton("great_1st_split&good_1st_split&great_2nd_split&good_2nd_split&great_3rd_split&good_3rd_split&great_lap&good_lap"); openGlobalButton( "good_3rd_split",$PBorigL + $PB2Left + 1,$PBorigT + 45,30,4,4,10,16,"^3Good ^73rd split " . $Nickname ); ELSE cmdLFS( "/msg Good 3rd split (" . $SplitTime . ") by " . $Nickname . "^8!" ); ENDIF EndSub Sub TRI_lap_0() IF ($pitb == "1" ) THEN closeGlobalButton("great_1st_split&good_1st_split&great_2nd_split&good_2nd_split&great_3rd_split&good_3rd_split&great_lap&good_lap"); openGlobalButton( "great_lap",$PBorigL + $PB2Left + 1,$PBorigT + 45,30,4,4,10,16,"^2Great ^7lap " . $Nickname ); ELSE cmdLFS( "/msg Great lap (" . $LapTime . ") by " . $Nickname . "^8!" ); ENDIF EndSub Sub TRI_lap_1() IF ($pitb == "1" ) THEN closeGlobalButton("great_1st_split&good_1st_split&great_2nd_split&good_2nd_split&great_3rd_split&good_3rd_split&great_lap&good_lap"); openGlobalButton( "good_lap",$PBorigL + $PB2Left + 1,$PBorigT + 45,30,4,4,10,16,"^3Good ^7lap " . $Nickname ); ELSE cmdLFS( "/msg Great lap (" . $LapTime . ") by " . $Nickname . "^8!" ); ENDIF EndSub ######################################################################### # Action # ######################################################################### # Action to do on a special command typed in message line # $allow is optional if you wish to specify users, that are allowed to execute action # You can specify more users if you separated them by ',' # You can use a file to specify users, one user per line (example : $allow = "&./your_file.flt";) # If ! before a name, force nickName authentification if UseUsernameForAuthentication=true # If ! before a name, force userName authentification if UseUsernameForAuthentication=false # You can use regexp expression in userName pattern, type regex=your regular expression # Example : if UseUsernameForAuthentication=true # !regex=^\[COP\].* # Find all user with a nickname that begins with [COP] # regex=^Gai.* # Find all user with a username that begins with Gai # See regular expression on web for more info how it work # Use & sign at end of patterns #------------------------------------------------------------------- $UseUsernameForAuthentication = true; Register MsgAction("!pitboard",MA_pitboard); Sub MA_pitboard() openPrivButton( "pitboard",$origL,$origT,30,5,5,-1,96,"^2Pitboard :"); openPrivButton( "pitboardleft",$origL,$origT + 5,10,5,5,-1,96,"^3Left",MA_pitboardleft); openPrivButton( "pitboardright",$origL + 10,$origT + 5,10,5,5,-1,96,"^3Rigth",MA_pitboardrigth); openPrivButton( "pitboardoff",$origL + 20,$origT + 5,10,5,5,-1,96,"^3OFF",MA_pitboardoff); EndSub Sub MA_pitboardleft() $PB2Left = "0" ; closePrivButton("pitboard&pitboardleft&pitboardright&pitboardoff"); closeGlobalButton("pitboard_total&pitboard_txt&sec2_txt&sec3_txt&final_txt&sec1_txt&best_s1_txt&best_lap_txt&best_s2_txt&best_s3_txt&best_final_txt&best_lap_txt&last_lap_txt"); openPrivButton( "pitboard_total",$PBorigL + $PB2Left,$PBorigT,32,50,5,-1,32,""); openPrivButton( "pitboard_txt",$PBorigL + $PB2Left + 1,$PBorigT + 1,30,4,4,-1,32,"Pitboard" . "&" . $Nickname); $pitb = "1" ; EndSub Sub MA_pitboardrigth() $PB2Left = "166" ; closePrivButton("pitboard&pitboardleft&pitboardright&pitboardoff"); closeGlobalButton("pitboard_total&pitboard_txt&sec2_txt&sec3_txt&final_txt&sec1_txt&best_s1_txt&best_lap_txt&best_s2_txt&best_s3_txt&best_final_txt&best_lap_txt&last_lap_txt"); openPrivButton( "pitboard_total",$PBorigL + $PB2Left,$PBorigT,32,50,5,-1,32,""); openPrivButton( "pitboard_txt",$PBorigL + $PB2Left + 1,$PBorigT + 1,30,4,4,-1,32,"Pitboard" . "&" . $Nickname); $pitb = "1" ; EndSub Sub MA_pitboardoff() closePrivButton("pitboard&pitboardleft&pitboardright&pitboardoff"); closeGlobalButton("pitboard_total&pitboard_txt&sec2_txt&sec3_txt&final_txt&sec1_txt&best_s1_txt&best_lap_txt&best_s2_txt&best_s3_txt&best_final_txt&best_lap_txt&last_lap_txt"); $pitb = "2" ; EndSub