# CASE Commands - Test # Original button and sub programming by Yisc[NL] # Standard CASE Commands ######################## # Tested #------ # "!lapperversion": = Lapper Var # "!lfsversion": # "!ver": - this is same as !lapperversion # "!plate": # "!track": # "!name": # "!lytinfo": # "!laps": # "!distance": # Untested #--------- # "!dstats": # "!dstatsqual": # "!getwr": # "!groupcmdlfs": # "!groupqual": # "!hand": # "!lfsmode": # "!myconfig": # "!mypb": # "!pos": # "!ps": # "!racetime": # "!spb": # "!stats": # "!statsqual": # "!term": # "!test": # "!time": # "!usertop": # Not required or tested #------------------------- # "!license": - only shows status as 'on' # "!drf": # "!drfnear": # "!drfnearqual": # "!drfqual": # "!kick": # "!pit": # "!reload": # "!acars": # "!allowedcars": # "!node": # "!zone": # "!auth": # "!ban": # "!cleanspb": # "!tud": ## Only want for drivers to be able to use once left track CatchEvent OnLeaveRace( $userName ) # Player event openPrivButton( "button_shortcut",6,153,24,6,5,-1,32,"^1Button Shortcuts",Button_Shortcuts); EndCatchEvent CatchEvent OnNewPlayerJoin( $userName ) closeButtonRegex (GetCurrentPlayerVar("UserName"), "button_*"); # close buttons when rejoining track EndCatchEvent Sub Button_Shortcuts( $KeyFlags,$id ) $buttonLeft = 1; $buttonTop = 151; $buttonWidth = 15; ClosePrivButton ("button_shortcut"); openPrivButton( "button_back",1,$buttonTop,$buttonWidth+17,34,4,-1,32,""); openPrivButton( "button_lapper_version",2,$buttonTop+1,$buttonWidth,4,4,-1,16,"^8Lapper Version",Button_lapper_version); openPrivButton( "button_lfs_version",17,$buttonTop+1,$buttonWidth,4,4,-1,16,"^8LFS version",Button_lfs_version ); openPrivButton( "button_name",2,$buttonTop+5,$buttonWidth,4,4,-1,16,"^8My Nickname",Button_name ); openPrivButton( "button_plate",17,$buttonTop+5,$buttonWidth,4,4,-1,16,"^8Number Plate",Button_plate ); openPrivButton( "button_track",2,$buttonTop+9,$buttonWidth,4,4,-1,16,"^8Track Name",Button_track ); openPrivButton( "button_laps",17,$buttonTop+9,$buttonWidth,4,4,-1,16,"^8Lap Done",Button_laps ); openPrivButton( "button_lyteinfo",2,$buttonTop+13,$buttonWidth,4,4,-1,16,"^8Layout Info",Button_lyteinfo ); openPrivButton( "button_distance",17,$buttonTop+13,$buttonWidth,4,4,-1,16,"^8Distance Done",Button_distance ); openPrivButton( "button_close",2,$buttonTop+29,$buttonWidth+$buttonWidth,4,4,-1,32,"^8CLOSE", Button_Close); EndSub Sub Button_Close ( $KeyFlags,$id ) closeButtonRegex (GetCurrentPlayerVar("UserName"), "button_*"); # close buttons EndSub Sub Button_lapper_version ( $KeyFlags,$id ) lapperVersion(); # Works because Lapper Var EndSub Sub Button_lfs_version ( $KeyFlags,$id ) PrivMsg ( "^7LFS version is: ^1" . GetLapperVar( "lfsversion" ) ); EndSub Sub Button_name ( $KeyFlags,$id ) PrivMsg ( "^7Your nickname is: " . GetCurrentPlayerVar( "NickName" ) ); EndSub Sub Button_plate ( $KeyFlags,$id ) PrivMsg( "^7Your Numberplate is: ^1" . GetCurrentPlayerVar( "NumberPlate" ) ); EndSub Sub Button_track ( $KeyFlags,$id ) PrivMsg( "^7Track in use: ^1" . GetLapperVar( "ShortTrackName" ) . " = " . GetLapperVar( "LongTrackName" ) ); EndSub Sub Button_laps ( $KeyFlags,$id ) PrivMsg ( "^7Laps done on " . GetCurrentPlayerVar( "Car" ) . "/" . GetLapperVar( "ShortTrackName" ) . " = " . GetCurrentPlayerVar( "Laps" ) . ", session = " . GetCurrentPlayerVar( "SessLaps" ) ); EndSub Sub Button_lyteinfo ( $KeyFlags,$id ) getlayoutinfo(); # Works but output only goes to the console of the LFS server (when using DCon) EndSub Sub Button_distance ( $KeyFlags,$id ) privMsg(langEngine( "%{main_dist}%" ,GetCurrentPlayerVar( "Car" ) ,GetLapperVar("ShortTrackName") ,ToPlayerUnit( GetCurrentPlayerVar("Dist") ) ,GetCurrentPlayerVar("UnitDist") ,ToPlayerUnit( GetCurrentPlayerVar("SessDist") ) ,GetCurrentPlayerVar("UnitDist") )); EndSub