The online racing simulator
Release: LFSLapper V7.0.9.4
Hello Lapperusers,

Here's a new version of LFSLapper that contains multiple new features.
Some of the features require LFS Version D50 or higher(Client and Host)

See the summary of changes below.

See you on the track.


+---------------------------------------------------------------+
|Changes from 7.0.9.3 to 7.0.9.4
+---------------------------------------------------------------+
=================================================
New:
=================================================
1: New Discord Feature MentionDiscordUser()

$DiscordChannelID = "123456789";
$DiscordUserID = "123456789";

MentionDiscordUser($DiscordChannelID,$DiscordUserID);

2: New Function: GetListOfDirectories();

#Get list of directories
$ListOfDirectories = GetListOfDirectories("");

#Get NumberOfDirectories
$DirCount = $ListOfDirectories["NumberOfDirectories"];

#Get through all the directories
FOR($i = 0; $i < ToNum($DirCount); $i = $i + 1)

$NameOfDir = $ListOfDirectories[$i,"DirName"];
$CreationDateOfDir = $ListOfDirectories[$i,"DirCreated"];
$LastAccessedOfDir = $ListOfDirectories[$i,"DirAccessed"];

privmsg("NameOfDir: ".$NameOfDir);
privmsg("CreationDateOfDir: ".$CreationDateOfDir);
privmsg("LastAccessedOfDir: ".$LastAccessedOfDir);

ENDFOR

3: New Function: SetPlayerHandicap(); LFS Version (Client & Host) D50 or higher
Set handicaps for multiple players at once, only when the player is On Track

UserName are capital sensitive.
Mass value 0 - 200
Intake value 0 - 50

SetPlayerHandicap("UserName1:Mass:Intake,UserName2:Mass2:Intake");
SetPlayerHandicap("Bass-Driver:200:50,finland69:100:10");

4: New Function: GetListPlayerHandicap(); LFS Version (Client & Host) D50 or higher
This function executes Event: OnPlayerHandicap(), see below

5: New Event: OnPlayerHandicap(); LFS Version (Client & Host) D50 or higher

#Event will execute when the players handicap has been changed by command or by insim: SetPlayerHandicap()
#LFS Commands:
#/h_mass username X - set added mass for user's car
#/h_tres username X - set restriction for user's car

#$userName = Username of player
#$Flags: 1 = Mass Changed
#$Flags: 2 = Intake Changed
#$Flags: 3 = Both Handicaps Changed

$H_Mass = Current value mass
$H_Tres = Current value Intake restriction

Event OnPlayerHandicap( $userName,$Flags,$H_Mass,$H_Tres) # Player event
globalmsg("Handicap has been changed");
globalmsg("UserName: ".$userName);
globalmsg("Flags: ".$Flags);
globalmsg("Intake Res: ".$H_Tres);
globalmsg("Mass: ".$H_Mass);
EndEvent
=================================================
Update:
=================================================
1: New buttonfunction: Display button in garage.
I've been looking to display the button in the garagemenu
I think its a nice workaround without breaking the buttonfunctions.

Type the number 255 to the ButtonStyle parameter to display the button in the garage.

Example:

openPrivButton( "test",50,60,100,15,0,-1,32+64+255, "Test" );

=================================================
Fix:
=================================================
1: Potential fix for LFSlapper crash when modsystem isnt available from LFS.net

=================================================
Known Issues:
=================================================
1: No encoded characters in (clickable) textbuttons


EDIT: New LFSLapper.exe without debuglines.
https://www.lfs.net/forum/post/2067050#post2067050
Attached files
LFSLapper V7.0.9.4.zip - 6.4 MB - 679 views
Congrats on another release.
Thank you,

Some functions were created for the TimeAttack addon in the beginning of this year. And since then, i didn't do much on LFSLapper.
I had figure out where to add new functions etc LOL.

The biggest challenge was displaying the buttons in the garagemenu.
Adding new parameters breaks all buttonfunctions. So that is a nogo.
So i came up with manipulating the BStyle value. Its working, but i prefer a new parameter that you could set 1 or 0.
nice update, I wonder if there is still a solution to the character problem (^H - ^S - ^K etc.)
i hope there is. I did some tests in the past with encoding the characters, but did not get the results i hoped for to fix the issue.
Need to dig deeper into the code and understand what it does.

I hope it's something small that need to be changed.
In addition, I realized that the button id appears in the console and how can I turn it off?
Attached images
resim_2023-11-28_183945177.png
uhhhhh whuups, that is one of the debug lines that i used for the character issue.
Seems i forgot a hidden debug line. Ill ignore the line and post a new .exe asap
Here's the new LFSLapper.exe with the debugline
Attached files
LFSLapper.zip - 186.5 KB - 392 views
thx
still the same
try now, uploaded a new .exe
I wonder if you could make your latest version available as open source (latest exe)
LFSLapper is opensource.
Download lapper and open the src folder.

Open the projectfile in visual studio and you can edit the code.

For the last .exe, i've attached the file that has been edited.
Attached files
InSim4.zip - 16 KB - 484 views
Thank you
as I posted before, the console still shows numbers (even though I compiled it)

for (int i = 0; i <= length; i++)
{
Console.Write(buffer[i] + "-");
}
Console.WriteLine("");

Fixed when I deleted the place above
This is soo odd. It didn't saved the changes, i made in visual studio.
but it took the changes when i compiled it.

Download the file again.
Thank you it works
does this work with a LFS-rented server? Big grin
yes you can connect your LFSLapper to a lfs rented server.

You need the IP and Insim port of your rented LFS Server.
And you need to whitelist your own IP (IP you get from your ISP) in the LFS Hostpanel (Access Control Tab)
I'm really obsessed with the mysql thing. If you can add mysql to the lapper, I will actually stop using .txt files from now on.
Quote from Androphp :I'm really obsessed with the mysql thing. If you can add mysql to the lapper, I will actually stop using .txt files from now on.

You asked this already:
https://www.lfs.net/forum/thre ... QL-Connection-New-Version

You can store up to 2TB of data with SQLite. Implementing MySQL will be more complicated for users to use LFSLapper.

I do not see any benefits to implementing mysql into LFSLapper.
Beside that, i have no experience with databases, so thats a nogo for me. And i'm not want to do a another big project for LFSLapper. The mod thing was already something above my level as a non-programmer.

The code of LFSLapper is opensource. So you take a look at the code and see if you can implement it in a way so its easy to use for other LFSLapper users.
AWS ec2 t4g.nano was used, and the OS is Ubuntu 22.04 LTS (arm64).

sudo apt install ca-certificates gnupg
sudo gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt install mono-complete
mono LFSLapper.exe

When I run it, I get an error.

WARNING: ./drifttop.lpr doesn't exist!
WARNING: ./layoutlist.lpr doesn't exist!
WARNING: ./usertop.lpr doesn't exist!

Correcting the extension to lowercase will solve the error.



Closing the terminal also closes the program.
To run in the background, use the following command.

nohup mono LFSLapper.exe > lapper.log &

Logs can be output to the screen.

tail -f lapper.log

You can terminate programs running in the background.

ps -ef | grep LFSLapper.exe
kill [PID]

ps. If you are short on memory, you may want to consider t4g.micro. It is more economical than t2.micro.
This thread is closed

FGED GREDG RDFGDR GSFDG