The online racing simulator
LFS Lapper - Schedule events
1
(49 posts, started , go to first unread)
LFS Lapper - Schedule events
I already made a simple schedule module for Lapper in the past, but for a long time I had a wish to make a system which makes server admins sit down and relaxed, once all the information was entered into a system. Recently I started coding it in Lapper and now it's time to share some information about this project with the community.

The Schedule module is build in two parts, with the first part being used my server admins, while the second part is used by the users of that server.

First of all it has the option to specify up to 8 server names, so you can just enter a schedule being logged on to one server, but will be used on another. Furter it's possible to schedule up to 14 races, for which you can specify Date,Time,Track,Car(s),Laps,a Comment and a Password. Of course all can be saved into the LFS Lapper database. (see Capture1.PNG)

The user side of things is showing the scheduled races for the server you are connected with, but when more schedules are entered into the system, you can simply click on the displayed server names, to read the other schedules as well. (see Capture2.PNG)

But that's not everything. Every night at 00:00 hour, a check is done when then next race on that specific server will be and if the right track for that race is already loaded or not. If that isn't the case, it pulls the needed trackcode from the database, changes the server to the right track, and sets all the other things like the allowed cars and DefaultTopCar as well. On the race day it self, it changes the password of the server to the specified password for that race. So an admin has to put all the details into the schedule at the start of a league season, and then the rest of the season, Lapper takes care of all the needed settings.

At the moment this new module is undergoing some final testing and I want to add a few things I just found out that would be needed to run schedules for multiple raceteams on multiple servers. After that, I will release the scripts to the community.
Attached images
Capture2.PNG
Capture1.PNG
Work is done, so here are the scripts for the Schedule and admin module.

Make sure to add the following lines into addonsused.lpr:

include( "./schedule_2.lpr");
include( "./schedule_set.lpr");

Rename the files to:

schedule_2.lpr
scheduel_set.lpr
Attached files
schedule_2.txt - 28.9 KB - 105 views
schedule_set.txt - 81.3 KB - 78 views
Nice Work! this will come in handy. Would love to see this progressed further. Eg. Wind, Qualify time, etc.
Although this is a very old thread, there is some new developement going on for the 'schedule_set' addon.
I first started cleaning out the current codebase and managed to bring it back by ~80%, before starting on some new features.
While the work is very much in progress, here's the changelog so far:

- Complete re-write of the module for more efficient code
- Added CLEAR button to clear single server name
- CLEAR and LOAD buttons are dynamic now (no server name, no buttons)
- Number of races are dynamic now, when an empty line is found, script ends
- All entered information is saved instantly, so no need to save whole form
- Added car select GUI
- Added Weather,Wind,Qual,Start order,Reset,Cruise

The car select GUI has some very nice functions.
When you select a car using the Left MouseButton (LMB) the name of the car will turn green and when you click it again using LMB, it will de-select and turn white again.
When you select a car using the Right MouseButton (RMB) the name of the car will turn red and when you click it again using RML, it will de-select and turn white again.
Green will mean that the car is available, while red means it is excluded, but those excludes are only working when using the car groups (cyan colored button).
Those car group buttons can only be clicked using the LMB and will go green when selected or white when not selected.

When pressing 'More options >>>' a new set of settings becomes available, while Password and Comment will be hidden.
You will be able to set the Weather, Wind speed, Length of Qualify, Starting order of the race, Resets of car allowed or not, Cruise (driving wrong way) allowed or not.
If you press '<<< Less options' those new settings will go hidden again and Password en Comment will be shown again.

All shown functions are working at the moment, but I have some more ideas I want to include in this update (some ideas will need the release of Lapper 7.0.4.8)

Let me know what you think about this and if there are any other things that should/could go into this module.
Attached images
Capture1.PNG
Capture2.PNG
Capture3.PNG
Capture4.PNG
Capture5.PNG
Capture6.PNG
Quote from Yisc[NL] :Although this is a very old thread, there is some new developement going on for the 'schedule_set' addon.
I first started cleaning out the current codebase and managed to bring it back by ~80%, before starting on some now features.
While the work is very much in progress, here's the changelog so far:

- Complete re-write of the module for more efficient cod
- Added CLEAR button to clear single server name
- CLEAR and LOAD buttons are dynamic now (no server name, no buttons)
- Number of races are dynamic now, when an empty line is found, script ends
- All entered information is saved instantly, so no need to save whole form
- Added car select GUI
- Added Weather,Wind,Qual,Start order,Reset,Cruise

The car select GUI has some very nice functions.
When you select a car using the Left MouseButton (LMB) the name of the car will turn green and when you click it again using LMB, it will de-select and turn white again.
When you select a car using the Right MouseButton (RMB) the name of the car will turn red and when you click it again using RML, it will de-select and turn white again.
Green will mean that the car is available, while red means it is excluded, but those excludes are only working when using the car groups (cyan colored button).
Those car group buttons can only be clicked using the LMB and will go green when selected or white when not selected.

When pressing 'More options >>>' a new set of settings becomes available, while Password and Comment will be hidden.
You will be able to set the Weather, Wind speed, Length of Qualify, Starting order of the race, Resets of car allowed or not, Cruise (driving wrong way) allowed or not.
If you press '<<< Less options' those new settings will go hidden again and Password en Comment will be shown again.

All shown functions are working at the moment, but I have some more ideas I want to include in this update (some ideas will need the release of Lapper 7.0.4.8)

Let me know what you think about this and if there are any other things that should/could go into this module.

Awesome update!

Did you change the interval in which it checks for the race start? Kind of like the one you debugged for me?
No, because that is part of the 'schedule' module.
Once, I have finished writing the 'schedule_set' module, I will go on to update the 'schedule' (which is only reading information and then action on that) module.
Quote from Yisc[NL] :No, because that is part of the 'schedule' module.
Once, I have finished writing the 'schedule_set' module, I will go on to update the 'schedule' (which is only reading information and then action on that) module.

Ok.

I just about finished the one you helped me with, and it has the feature to reset to a default race (laps, track etc) and also that timing feature. You can have the code if you want.

Edit: You actually already have it. Feel free to use some/all/none of it.
Small update today, a function to put a default value on some sort of clipboard and then use it in other fields.
In this example I pressed the D (Default) button next to '20:30 CEST' and am notified that the value is set as default time.
At that moment the D next to that value will start to blink and the other D's will dissapear.
Every line with an empty time field, will get a C button, which means C(opy) to past the saved value in that particular field.
This will save you the time of having to type the same information over and over again.
Attached images
Capture1.PNG
Capture2.PNG
Capture3.PNG
Really nice job you did there.

Thanks for your time and effort to creat this update.
This schedule system is much better than the old one for sure.
Today I fixed a bunch of bugs I came across while testing the new script.
I also changed a minor thing related to storing/deleting servernames.
I've added the C(opy) button in the server name section, so that if you want to create a schedule for the server you are currently on, you can just press the C button and have that name copy/pasted into the server name field.
I've also added the C(opy) buttons to the Weather,Wind,Qual,Start,Reset and Cruise section.

The re-write and expanding of this module is nearly finished now.
Attached images
Capture1.PNG
Capture2.PNG
What started as a re-write has turned into my best and most complex Lapper script I've written to date.
A lot of things have been changed or added since the last time I wrote about the progress.
Here's a quick summery:

- CLEAR has been changed to DELETE
- When a value is set as default, the button will go a bit brighter to show it is the default value
- Event number being red when vital information (Date,Time,Track,Cars,Laps) is missing
- ID number is automaticly created when date is entered into schedule*
- Password has been split into Event and Regular password
- Delete a whole event by clicking on the number using RIGHT mousebutton
- Events can be moved UP/DOWN by clicking on the number using LEFT mousebutton and then select which way it should move

* ID number can be linked up to the Handicap system, so that handicaps will be loaded automaticly, if needed

The things remaining on my To-Do list are:

- Add input validation when a Date is set
- Add input validation when a Time is set
- Add input validation when a Track is set
- Add input validation when a Car (or Cars) is/are set
- Add a Config screen when Set_Schedule is opened for the first time **

** Create some general settings when the schedule should be checked and server should be adjusted accordingly, Allow reset (or not) when no event is running, etc.
Attached images
Capture1.PNG
Capture2.PNG
Capture3.PNG
Capture4.PNG
Capture5.PNG
Capture6.PNG
Quote from Yisc[NL] :What started as a re-write has turned into my best and most complex Lapper script I've written to date.
A lot of things have been changed or added since the last time I wrote about the progress.
Here's a quick summery:

- CLEAR has been changed to DELETE
- When a value is set as default, the button will go a bit brighter to show it is the default value
- Event number being red when vital information (Date,Time,Track,Cars,Laps) is missing
- ID number is automaticly created when date is entered into schedule*
- Password has been split into Event and Regular password
- Delete a whole event by clicking on the number using RIGHT mousebutton
- Events can be moved UP/DOWN by clicking on the number using LEFT mousebutton and the select which way it should move

* ID number can be linked up to the Handicap system, so that handicaps will be loaded automaticly, if needed

The things remaining on my To-Do list are:

- Add input validation when a Date is set
- Add input validation when a Time is set
- Add input validation when a Track is set
- Add input validation when a Car (or Cars) is/are set
- Add a Config screen when Set_Schedule is opened for the first time **

** Create some general settings when the schedule should be checked and server should be adjusted accordingly, Allow reset (or not) when no event is running, etc.

This is going to be a must have for me... And probably everyone else too!

Can't wait to try out the finished product!
The 'Set_Schedule' module is nearly finished and therefor I have put up an Alpha version for testing.
If you are interested to see the module and want to do some testing, please go to server mentioned below.

- NO password is needed to join the server
- NO admin rights are required to test the module
- To start the module, press T and type: !ss
- It is NOT possible to drive on the server (you will get spectated)

Server: AB.nl[TST]

Let me know what you think about it and in case you found a problem (or think you have found one), let me know and give me the steps to reproduce the problem (if the Lapper logfile is inconclusive)

I will shut this server down tomorrow around 12:00 CEST, so you need to be 'quick' to be able to see and test the module.

Release notes:

- Complete re-write of the module for more efficient code
- Added DELETE button to delete single server name
- DELETE and LOAD buttons are dynamic now (no server name, no buttons)
- Number of races are dynamic now, when an empty line is found, script ends
- All entered information is saved instantly, so no need to save whole form
- Added car select GUI
- Added Weather,Wind,Qual length,Start order,Reset allowed,Cruise allowed
- Added copy-function so that several values be set as default and then copied
- Splitted password into event and regular password
- When an empty value is entered, the current value will be deleted from the database
- Added check for minimum race requirements (date,time,track,car(s),laps)
- Added input validaton for all fields
- Trackcode and car(s) can now be entered in lower case and are then automaticly put in upper case
- Module should now be multi-user
Very nice script.
I have noticed 1 small bug or this isnt one.

The deletebutton for deleting a single servername doesnt work.
I've just uploaded and activated version: 2.02 ALPHA

Release notes:

-Removed GlobalVar $storage_name_schdl and replaced it with a Set/GetCurrentPlayerVar( "storage_name_schdl" )
-Fixed a bug on data validation for Weather/Wind/Qual, which failed when a non-numeric value was entered
-Fixed a bug that stopped the deletion of a servername
Quote from Yisc[NL] :I've just uploaded and activated version: 2.02 ALPHA

Release notes:

-Removed GlobalVar $storage_name_schdl and replaced it with a Set/GetCurrentPlayerVar( "storage_name_schdl" )
-Fixed a bug on data validation for Weather/Wind/Qual, which failed when a non-numeric value was entered
-Fixed a bug that stopped the deletion of a servername

Awesome! Looking forward to this.
Quote from TechEdison :Awesome! Looking forward to this.

Have you tried it on the test server?
As there's no need to 'look forward to it' in terms of being able to see and test the script Wink
Quote from Yisc[NL] :Have you tried it on the test server?
As there's no need to 'look forward to it' in terms of being able to see and test the script Wink

Getting on to test right now. I meant looking forward to the released schedule_set/schedule combo so I can use it Tongue

You're doing awesome work here! This will be a must have for my server.

EDIT: Just messed around with it. Very cool.
I see you have, you even managed to crash Lapper Big grin , on some index problem.
Sadly the log file doesn't say where the problem occured.
So if you know what you did, you might be able to tell me te steps, so I can check what might be causing the crash.
Looks good!

Also looks like not all track codes are recognized when entering the code in the 'track' column. I tried BL1, WE1, RO1, AS1, FE1, SO1 and KY1, but only the first 3 are working.
Quote from Mazdaratie :Looks good!

Also looks like not all track codes are recognized when entering the code in the 'track' column. I tried BL1, WE1, RO1, AS1, FE1, SO1 and KY1, but only the first 3 are working.

Bug confirmed and fixed.
Version 2.0.3 ALPHA is up now with the following release note:

-Fixed a bug that stopped entering valid trackcodes for AS,FE,KY and SO tracks
Quote from Yisc[NL] :I see you have, you even managed to crash Lapper Big grin , on some index problem.
Sadly the log file doesn't say where the problem occured.
So if you know what you did, you might be able to tell me te steps, so I can check what might be causing the crash.

Oh boy uhhhh... Hmm..

Well I remember there was one thing that bugged out but i don't remember what I did lol. I messed with the server name settings a bunch so not sure if that would've caused it.
Test has ended, so server AB.nl[TST] has been closed now.
Thanks to everyone that took the time to test the new script and report bugs to me.
Started working on the last part of the 'Set_Schedule' module today.
The configuration screen has been added and is nearly complete.
Once I have finished that (probably early next week) it's about time to start working on the 'Schedule' module.
Attached images
Capture1.PNG
Capture2.PNG
Quote from Yisc[NL] :Started working on the last part of the 'Set_Schedule' module today.
The configuration screen has been added and is nearly complete.
Once I have finished that (probably early next week) it's about time to start working on the 'Schedule' module.

Yesssss these are the settings that I've waited forrr. You're awesome.
1

LFS Lapper - Schedule events
(49 posts, started )
FGED GREDG RDFGDR GSFDG