For now no, but in the future Yes! I change config file also for this .
In next stage i planned to add
- control flow
IF ... THEN ... ELSE ... ENDIF
- Loop methods
WHILE ... ENDWHILE
FOR ... STEP ... NEXT
Now In event and sub you can use +-/* in expression or attribution to local var
Exemple
$toto = (12 + 3)*4 + $OtherVar;
Many thank's for your tests men. I look it quickly.
Today i construct my barbecue and i have no time to look for your request. But don't worry i fix the bugs
New beta version of Lapper, with new config file with more detailed syntax error. If someone can help me to do a tutorial for config file You can't use your old LFSLapper and trackInfo cfg file.
Example config file
######################################################################### # Connect messages # ######################################################################### # Message that is shown to players when they connect to the server. #-----------------------------------------------------------------
Event OnConnect() openPrivButton( "welc",25,50,150,15,12,-1,0,"^7Welcome " . $Nickname . " to ^1LFSLapper ^7powered server !&^2Type ^7!help ^2after leaving garage to see commands." ); openPrivButton( "pos",25,80,150,10,8,-1,0,"^7Your actual friendly Position (all visitors) : ^7" . $Posabs . "&^2Your actual League prequalify Position : " . $Posqual . " ^6Estimate Pool : " . $Groupqual . "&Don't use swearwords on this server" . "&respect other player" . "&otherwise you can be banned " ); openPrivButton( "clos",78,120,20,10,10,-1,32,"Accept",OnConnectClose ); openPrivButton( "ref",103,120,20,10,10,-1,32,"Deny",OnConnectCloseKick ); http("http://www.frh-team.net/reglapper/getserver2.php" ); EndEvent Sub OnConnectClose() closePrivButton("welc&pos&clos&ref"); EndSub Sub OnConnectCloseKick() closePrivButton("welc&pos&clos&ref"); cmdLFS("/kick " . $Username ); EndSub
######################################################################### # Scheduled actions # ######################################################################### # Actions that are executed on schedule. Use '|' for next schedule/action pair and to separate schedule from action. # If more schedules or actions, separate them with ':'. # # ss mm hh dd MM YYYY #-------------------------------------------------------------------
Register ScheduleAction( "0 0 0 * * *", SA_mid ); Sub SA_mid() cmdLFS("/rcm Midnight warning to all working men!"); cmdLFS("/rcm_all"); EndSub
######################################################################### # Action # ######################################################################### # Action to do on 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 user separated by ',' # 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 # Exemple : if UseUsernameForAuthentication=treu # !regex=^\[COP\].* # Find all user who nickname begin with [COP] # regex=^Gai.* # Find all user who username begin with Gai # See regular expression on web for more info how it work # Use & sign at end of patterns, if you wish to specify a file containing users, that are allowed to execute action. users separate by \n #-------------------------------------------------------------------
/* List of All variable who can be used in Players event
$Nickname -> Nickname $Username -> UserName $Laps -> Number of Lap done on current track and current Car $SessLaps -> Session Number of Lap done on current track and current Car $TotalPitTime -> Total Time stop in pit place $Car -> Current car of Player $Posabs -> Current absolute position $Posqual -> Current qualification position $Groupqual -> Current group qualification $SwearWordsRem -> Remaining retry before SwearWordsAction2 triggered $H_Mass -> User mass required on this server $H_TRes -> User intake restriction required on this server $P_Mass -> Current Player Mass $P_TRes -> Current player restriction $SplitTime -> Last Split time do by player $CurSplit -> Split duration for the last sector $BestSplit -> Best Split duration for the last sector $DiffSplit -> CurSplit - BestSplit $BestSpeed -> Best Speed do on this combo by player $UnitSpeed -> Unit of the Speed of the current player $Tpb -> Theorical PB $DriftScore -> Drift score $typ -> {typ} - = "Sess" if split PB for Session "PB" if split PB for PB file; $AngleVelocity -> Last Angle velocity in degrees $LastDriftScore -> Last drift score $AccelerationStartSpeed -> Starting speed $AccelerationEndSpeed -> Ending speed $AccelerationTime -> Acceleration time achieved from start to end speed $MaxAllowedLapTime1 -> Max Allowed Time before trigger Event OnMaxAllowedLapTime1 $MaxAllowedLapTime2 -> Max Allowed Time before trigger Event OnMaxAllowedLapTime2 $Dist -> Distance done on current combo/track by player $SessDist -> Distance done on current combo/track by player on current session
List of All variable who can be used in all events
$ShortTime -> Server Time in short format $LongTime -> Server Time in long format $ShortDate -> Datein short format $LongDate -> Datein long format
Additionnal Variable can be used in lapTimeAction. See trackInfo.cfg
$LapTime -> Current Lap Time
Additionnal Variable can be used in OnSpbLastLow or OnSpbLastUp.
$AvgSpeed -> Current Lap Time
Additionnal Variable can be used in OnBeginPit.
$Work -> Work do on current car player after Pit
Additionnal Variable can be used in votation. $Vote -> Number player who have voted to restart, qualify or end $Players -> Number player can vote ( player on track ) $Remain -> How many vote remain after votation conclude $Need -> How many vote to do action qualify, restart or end
Additionnal Variable can be used in OnNotMatchFlags.
$RequiredFlags -> Flag required on this server $PlayerFlags -> Flag for the current player
Additionnal Variable can be used in OnFastDriveOnPitL1 or OnFastDriveOnPitL2. $RemainFDIP -> Remain count for fast drive in pit
Additionnal Variable can be used in OnAuthReached . $auth -> Authorization reached
*/
/* Command block to run when a LFS Special event is triggered Event EventId() ... EndEvent
Command block used by backcall command like button or scheduled action or when receive a command by player Sub SubId() ... EndSub
Register MsgAction("!test",MA_test); You can register à sub function tu call when player type special text Firts arg = text typed in Second arg = Sub to call when player type this text
Register ScheduleAction( "0 0 0 * * *", SA_mid ); You can register à sub function to call when time is reached Firts arg = cron format ss mm hh dd MM YYYY Second arg = Sub to call when player type this text
Command allowed on Event and Sub
cmdLFS("Command_text"); To send a command to Lapper, see command.txt in LFS Doc
privMsg( "Message_text"); Tosend a private Message to the player who have triggered Event
openPrivButton( "help",25,28,150,10,5,-1,0,"^2Commands list" ); openPrivButton( "help",25,28,150,10,5,-1,0,"^2Commands list", backcall ); Open a button for the current player 1 - Unique id for this button 2 - Left coordinate for this button ( 0-200 ) 3 - Top coordinate for this button ( 0-200 ) 4 - Weigth this button ( 0-200 ) 5 - Heigth this button ( 0-200 ) 6 - Space between line in multiline button 7 - Duration in Second of the display button, -1 -> Don't automatically close 8 - Format of the button, look at insim.txt for value 9 - Button caption, for multiline, separate each line with & 10 - Option name of the backcalled sub
closePrivButton("welc&pos&clos&ref"); Close one or more button, you specify id of the button to close, multiple id separated by &
openGlobalButton( "bargr1",60,1,10,6,6,30,96,"Restart:" ); Same as openPrivButton, but open button for all player connected
closePrivButton("welc&pos&clos&ref"); Same as closePrivButton, but close button for all player connected
For now in gbut command use gbut with timer set instead /rcm if /rcm_all don't work in button.
I don't think i fix it because change in config file for the next release
Open source
LFSLapper is Open source ( i haved some problem in past in reason of this choice )! For now, there is not a Dev Team, i am alone and I have no idea how to manage a dev Team! At this time i try to completely change the cfg file for future extensions and it's a hard work with many internal change in LFSLapper. I have solved a part of problems, but there is much work. ( i hope this change don't benefit to other dev without care of the initial developper )
Manage system league
I think that is not a work for lapper to manage league system. I think this function will be done by an external automated programm like this ( www.liguesfr.com ). Lapper have sufficient functionnality for now to help an external programm to manage League.
I made this PHP/SQL league programm for FRH Team, PLFS Team and LFS France , but for now i don't want release source because i can't maintain this for more than one or 2 users. I haven't time to do tutorial, automated install, etc... sorry
Request Feature
I add requested feature if i think that feature are a good idea and if it's possible to do this on Lapper due to Lapper or LFS restrictions.
I put here an exemple of the new format for the cfg file. For now the reader work and give a complete infos about error in this file. The parsing is done by 'lex'. Lex is a lexical analyser writed for Linux. You can put here your ideas about syntax!
Next i will have to write lexical and grammatical parsing for event code with lex/yacc tools. The new configuration file will be easier to write and maintain. Be patient
I write this post to inform you that I plain to do major changes to the syntax of the configuration file. For now, this file is not very clear. The syntax is sometimes different depending on variables.
Your syntax is some lines is wrong, cmd separator is '|' and not ':'
Replace
with
- if you want DO NOT REMOVE OTHER DRIVERS FROM THE START GRID. appear when you click on accept . In this case command in quoted string is for the button
or
if you want DO NOT REMOVE OTHER DRIVERS FROM THE START GRID. appear when you connect. In this case command is not in quoted string and it's not a command for the button but for the onConnect var
Replace ' with "
with
Replace close with close1 if you want to close your closebutton