Yes you can do this, but you can't have an array with multiple dimensions combined
$ar[1] = 12;
$ar[1,1] = 12;
Error on execution
if you want use the same name array, you must unset var before
$ar[1] = 12;
$unset( $ar );
$ar[1,1] = 12;
Correct but $ar[1] is lost
Gai-Luron
PS: All built-in variable ( $userName, $TrackName, $PBLtime, etc... ) for the previous version can be retreived with
GetCurrentPlayerVar()
GetPlayerVar();
GetLapperVar()
ConfVar["name_of_conf_var"];
New Beta version of LFSLapper done by Yisc ( Scripts and Docs ) and Gai-Luron ( Code ). Download in the first post: test version
Many changes in this version, all old config files are obsolete, you can find all modifications in changes.txt in doc folder
Some changes
- Add include command to include other script into lapper config file
- default script writen by Yisc included in this version
Change track script
PitBoard script
PitWindows script
SafetyCar script
- Use of sqllite3 Database to store Drift and PB file, export file for FTP with .elp extension ( format changed )
- Now all command !command are in silent mode
- One LFSLapper can handle one or more LFS Servers, no syncing needed between 2 or more LFS server
- No limitation on LFS Server handled by one LFSLapper ( Only CPU Power )
- Add a config file with a list of all tracks available on LFS, with length
- Scripting language upgraded, renamed to GLScript. Quick reference docs coming soon
FOR ... BREAK ... ENDFOR
WHILE ... BREAK ... ENDWHILE
SWITCH ... CASE ... DEFAULT ... ENDSWITCH
Add Multidimensional Array in GLScript
Add numerous built-in functions. Take a look to reference.doc ( download reference. zip. To be finished )
- New events actions
Event OnNewGapPlayerBehind() // When a new gap are available for player behind you
Event OnNewGapPlayerBefore() // When a new gap are available for player before you
Event OnQualStart() // triggered when qualify start
Event OnPit( ) // when you are teleported to pit shift+P
Event OnChangeTyres( $FL_Changed, $FR_Changed, $RL_Changed, $RR_Changed )
Event OnNewPlayerJoin() // New PLayer joining race or leaving pits ( After Shift + P )
Event OnFinish // triggered when a player finish a race or qualification
Event OnResult // Triggered when result are available after a race or
qualification
- Ability to use 1 to 10 PB to calculate an AVG PB
- Lapper can send a notification via mail when Lapper crash
you must configure this values
$adminEmail = ""; // Email address to sent email to
$smtpServer = ""; // smtp server used
$loginMail = ""; // login connection to smtp server
$passMail = ""; // Pass connection to smtp server
- Instance of Lapper will automaticly restart when there is a crash. When it restarts 4 times within a short period of time, the instance will be stopped.
In case of crash you receive a notification via mail each time
- Admin LFSLapper via console command on console windows, coming soon a GUI interface to administrate LFSLapper remotely
- LFSLapper can store your script variables in a database to reuse them
- Add new command openPrivTextButton, to open a button who query an input string
- Add function TextPrivButton( "id_button", "new text"); to change one button text
- Complete Group management system for the authorization to use commands
- In timed button, you can put in string text : %txt% to view the countdown in the button
Thank's for your answer, i know now yours reasons.
Good Dev.
Gai-Luron
PS: I'am not a master , if you take a look at Lapper source, you can see that is so dirty code. it's my first object and c# application ( i work on a new version of Lapper with, in part, code a little cleaned ). your code seem more clean and most oriented object, good! continue in this way
Good Idea for this tracker, it's seem's very good. but i have two questions
1) Why do you have two version with one limited?
2) Why don't you release source? (Easy to retreive in C#)
I think you have a good reason for not release sources, but for the LFS community it's very interesting to have access to this file. Not to copy it, it's many year i release source for Lapper and only one person copy it. This is an old story and it is solved.
Continue your good job. Most programmer's make insim app for LFS, better is
$NickName is the nickname of the player doing action. In this case You. You can display argv to show username. But for now, what you want it's not possible ( $NickName of the banned user ). For now
Using Sqlite (database) instead of a text file seems to work well on the test server. I don't use Sqlite now with the drift database and syncing between two Lapper no longer work (for now).
I started big changes on the script parser. I rewrite it!. It is not easy because it's the first time I code this kind of thing. FOR ... BREAK ... ENDFOR and WHILE ... BREAK ... ENDWHILE work currently in my development version. For SWITCH ... CASE ... BREAK ... ENDSWITCH is not a priority as easily achievable with IF ... THEN ... ELSE ... ENDIF. In future version it will be possible to call a function with arguments and this function will return a value.
I think also implement Array vars in the next version. To access to the variables of the current racer use $CurPlayer [idVar]. Example $ CurPlayer [ "nickname"] for $nickname or $CurPlayer [ "LapDones"] for numbers of laps. Unfortunately the newer language scripts are no longer compatible with the older version.
Be patient because my work will not let me much free time and I program the short time I have left.
You can test new Lapper at server "Champ CILF2009 Test" ( The new international championship organised by LFS France ).
For now, i don't release it because it's on dev and many internal modification are to be tested. For now drift database and sync don't work yet. But you can see i continue to dev it. Major modification is the use of sqlite, real SQL database in place of txt file. this can offer much power for the future extensions.
An other ability is to set the number of PB used to calculate an Average PB. Usefull if you don't wan't a PB do with lucky.
Try with this, i think this work. The goal is to trigger onToLowHandicap everytime and test value for the handicap in the event.
# This high value are to force onTolowHandicap every time for the XFG
$HandicapCars = "XFG:1000:1000";
Event OnToLowHandicap()
IF ($P_Mass != 20)
THEN
OnToLowHandicap2();
ENDIF
IF ($P_TRes != 10)
THEN
OnToLowHandicap3();
ENDIF
EndEvent
Sub OnToLowHandicap2()
cmdLFS("/spec " . $Nickname );
cmdLFS("/msg " . $Nickname . "^3 spectated for to low handicap" );
cmdLFS("/msg ^3need " . $H_Mass . " kg "!");
End Sub
Sub OnToLowHandicap3()
cmdLFS("/spec " . $Nickname );
cmdLFS("/msg " . $Nickname . "^3 spectated for to low handicap" );
cmdLFS("/msg ^3need " . $H_TRes . "% of intake restriction!");
End Sub
Sorry, but i'am no very present on this forum. But i have no much time with Open Race Trophy. Then i make improvement because LFS France do a new international championship who need special modification on Lapper. Be Patient
For now i work on ... nothing, because i manage the Open Race Trophy. You can made change if you want. I never implement this functionnality because i don't understand why guys want using Lapper with AI. But if you want do it, you can
I change the version in the makefile, but the last digit are the build version ( compilation number ), not the version. Maybe i compile LFSstat, but the version here is the last.