The online racing simulator
Searching in All forums
(879 results)
Bass-Driver
S3 licensed
You have this


$NewDate = GetLapperVar(LongDate,+5);
$NewDate2 = GetLapperVar(LongDate);

Should be this


$NewDate = GetLapperVar(ShortDate,+5);
$NewDate2 = GetLapperVar(ShortDate);

LongDate Lappervar doesnt support the "AddDays" feature.
Bass-Driver
S3 licensed
You can use "ShortDate" Lappervar get calculate the end date of the ban or something else.

GetLapperVar(ShortDate): Possible to add an 2nd parameter to add/delete days

$NewDate = GetLapperVar(ShortDate,5); // Adds 5 days to the current date
$NewDate = GetLapperVar(ShortDate,+5); // Adds 5 days to the current date
$NewDate = GetLapperVar(ShortDate,-5); // Deletes 5 days from the current date

Bass-Driver
S3 licensed
The website and mods do load slower than asual.
Also the sending insim commands to the server is slow sometimes.

1 <1 ms <1 ms <1 ms 192.168.178.1
2 10 ms 5 ms 5 ms 10.255.225.1
3 16 ms 21 ms 10 ms venl-rc0003-cr102-et101-251.core.as33915.net [213.51.193.45]
4 14 ms 15 ms 15 ms asd-tr0021-cr101-be153-10.core.as9143.net [213.51.158.50]
5 21 ms 15 ms 15 ms nl-ams04a-ri3-ae51-0.core.as9143.net [213.51.64.194]
6 18 ms 14 ms 14 ms 213.46.191.90
7 15 ms 31 ms 43 ms nlrtm1-rt002i.i3d.net [109.200.218.84]
8 18 ms 14 ms 14 ms nlrtm1-rt017i.i3d.net [109.200.219.55]
9 * * * Request timed out.
10 14 ms 13 ms 17 ms s2.lfs.net [188.122.74.149]
Bass-Driver
S3 licensed
Before you be able to send any text to/from LFSLapper, you have to connect the discord server to LFSLapper. This must be done with a discord bot. This bot is managing the text that is written to/from LFSLapper.

Or ask your friend for help, because he has done this before.
Bass-Driver
S3 licensed
OnReceiveDiscordMessage($ChannelID,$ChannelName,$UNameID,$UName,$Text);
EndEvent
  • - This event will be executed when someone sends a discord message to LFSLapper.
  • - A Discordbot must be created to communicate between LFSLapper and Discord.
  • - In 'bin/default/includes/myInc.LPR' you enter the '$DiscordToken' and '$DiscordChannelReceive'.
    $DiscordChannelReceive is the variable that allow you to send text from discord to LFS.
    • You are allowed to set 5 channels, seperate them with a comma ",". see example below.
      $DiscordChannelReceive = "0000000000,0000000000,0000000000";
    • Set DeveloperMode in your discordsettings to "ON' to copy the channel ID ( rightclick on the channel)
Bass-Driver
S3 licensed
Please give the details what you have done and the code you've written to send a message to discord.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Do not know the Turkish language.
But uhm looking at the attachment (picture)
Which one is correct one: the upper one or lower one.

These are the 2 test buttons i've created.
OpenTextButton($userName, "TestBtn",75,53,50,5,5,32, "^H^7Girilecek kullanıcı adı","^H^3Girilecek kullanıcı adı",2,BLAH);
OpenButton($userName, "TestBtn2",75,63,50,5,5,-1,32, "^7Girilecek kullanıcı adı");

Bass-Driver
S3 licensed
Please give me more details about the issue.

From which version of LFSLapper does this issue occure.

Which functions in LFSLapper does contain this issue.
e.g privmsg(); , globalmsg(); etc

Thank you
Bass-Driver
S3 licensed
@Androphp

You haven't experienced this problem with the latest LFSLapper version?
Bass-Driver
S3 licensed
Hello,

So it should look like this?


Do you have the same issue with Privmsg() and globalmsg() ??
Bass-Driver
S3 licensed
New insim version:

Server: lfs://join=VM.Timeattack

V2.8.0 (21-01-2023)

Update: Helpmenu Overhaul, new fresh UI
Add: Shift+I feature to enable/disable TOP hud
Fix: No purple sectorscolor for first car/stage combo
Fix: Couldn't get WR Splittime after crossing a checkpoint.
Fix: You could report yourself in the reportsystem.

V2.9.0(28-04-2023)

Update: LFSLapper library updated to V7.0.9.4 Experimental, which is needed for some updates.
Update: Caution message instead of yellow blinking button that make the sectortimes disapear.
Update: TimeTable loader.
-Layoutloader function has been removed.
-Instead of accessing a window to load the timetable you have to load it by command. (!l <timetable name>)
This is a much faster way to load timetables for future events or track/layout changing.

Update: New option in TimeTable (!times)
Toggle between fastest time / the name of player to see who set the fastest time.

New: Top 10 leaderboard. Accessible from the top HUD.
New: Admins be able to load the TimeTable from Discord without joining the server (!l <timetable name>)
New: Rank window(!rank).
-Current Rank/Exp Points
-Total Distance
More coming in future updates

New methode to save/load these rank variables, more prepation must be done before releasing the insim on the public server. YAAY

New: Player settings menu in helpmenu
-Discord Ping (optional): Ping player on discord if the fastest time get beaten.
-Enable/Display Objective Window after finish the stage.
More coming in future updates

Bass-Driver
S3 licensed
Quote from yschoi93 :I installed on Amazon Linux.

rpmkeys --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'
yum install mono-devel
yum 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]


Thanks for the information
Bass-Driver
S3 licensed
I do not have the time to build a script like this. But i think you can create a script like this with the following steps.

What the player sees / must do
  • -Player types the !v command
  • -Player gets the list of layouts. Or the names of the allowed layouts from a textfile.
  • -Each layoutname is behind an clickable button.
  • -When a player clicked on a certain button, it votes for it and the buttoncolor or textcolor changes.
  • -Menu closes with the some friendly text. Thank you ....................

Some logical stuff
  • -Create a Array/Variable for each layout that contains the name of the layout and the votecount.
  • -Create for each joined player a playervariable (GetPlayerVar($userName,"ClickedLayout","");
  • -Set the "ClickedLayout" playervar with a variable so they cannot vote twice.
  • -Clicked Layout Votecount +1;
  • -When the player clicked it again it re-set the "ClickedLayout" playervar
  • -Clicked Layout again Votecount -1;
  • -After Some (Fixed) time 8.00 PM, LFSLapper will warn the players on track for upcoming layout change.
  • -LFSLapper uses the /ax_clear?? command to clear the layout (No idea what the command is lol)
  • -LFSLapper uses the /axload <Selected LayoutName> to load the layout. Layout must be added to the LFS Hosting page.
Bass-Driver
S3 licensed
Thx S1King for reminding me to update the tutorial at some point. Schwitz Big grin
Linux Support: LFSLapper V7.0.9.3
Bass-Driver
S3 licensed
Hello

This small LFSLapper release brings back Linux support and storing offline playerdata to the LFSLapper database (storedvalue.dbs).

Thx to iceman121 to test LFSLapper on is linux server during development.
LFSLapper 7.0.9.3 has been tested on Ubuntu 20.04.5 LTS

Here are some steps provided by iceman121, to make LFSLapper working on your Linux server.

============================================================================================
1. Follow this guide by Mono: https://www.mono-project.com/download/stable/#download-lin
2. Install Mono dependencies using sudo apt install libmono-i18n4.0-all
3. Make sure you're in LFSLapper.exe directory and run the command Mono LFSLapper.exe.
============================================================================================

See the summary of other changes below.

################################################################
#LFSLapper changelog: Updated @ 18-02-2023
#################################################################
+---------------------------------------------------------------+
|Changes from 7.0.9.2 to 7.0.9.3
+---------------------------------------------------------------+
Thx to iceman121 for Testing LFSLapper on his Linux server Ubuntu 20.04.5 LTS.

=================================================
Fix:
=================================================
1: Coundn't run LFSLapper on Linux

=================================================
New:
=================================================

1: Save offline playervalues to the StoredValue.dbs Database
-You can use SetUserStoredValue() with the same parameters SetUserStoredValue($userName, $Variable, $Value);
-Be sure the username is correct.
-Nickname will not be saved. The database adds the NickName when the player join the server.

2: New variable when retreiving data from the StoredValue Database
ListCount : counts the total of the requested Variable

$list = getlisttopuser($value,$flagdesc,$flagNear,$StartPos); #Get List from stored database
$list["ListCount"];

Files to replace: LFSLapper.exe

If you are using 7.0.9.0 or higher, you can take LFSLapper.exe from this version and replace it with your current LFSLapper.exe
Don't forget to BACKUP!!
Bass-Driver
S3 licensed
Hello,

Before you want to write text to a file, you must create a file first.
CreateFile();

To edit the file like adding/deleting lines to/from the file
EditFile();

And to read the file.
Readfile();

See some examples below.


<?php 
Create
/Edit/ReadTextfiles
        
#===================================================
        #Create textfiles (Include FileExist options) (only .txt extension)
        #===================================================
                
$FileName "Filename";
                
$NameofDirectory "C:\Users\User\Desktop";
                
$FileExistOption 0;
            
               
What todo if file exist:

               
no action
               1 
overwrite file
               2 
overwrite file create backup file.

               
CreateFile($FileName,$NameofDirectory,$FileExistOption);
           
        
#===================================================
        #Read file (Possible to read various Filetypes: .log/.txt/.ini/.cfg.lpr)
        #===================================================
                
$LinesofFile Readfile($Filename,$Folder);
                
What info you get from file.
                
                -
FileSize in bytes
                
-CreationDate/Time
                
-ModificationDate/Time
                
-Number Of lines
                
-LineNumber
                
-Text from each line
                
                
!!!!EXAMPLE CODE!!!!
                
                    
$Filename "TestFile";
                    
$Folder "C:\Users\Danny\Desktop";
                    
$Extension ".txt";
                    
$LinesofFile Readfile($Filename,$Folder,$Extension);
                    
                
                    
$NrOfLines ToNum($LinesofFile["NumberOfLines"]);
                    
$FileCreationDate $LinesofFile["TimeOfCreation"];
                    
$FileModificationTime $LinesofFile["TimeOfModification"];
                    
$FileSize $LinesofFile["FileSize"];
                    
                    
privmsg("Reading file: " $Filename "" .$Extension);
                    
privmsg("NumberOfLines: " $NrOfLines "");
                    
privmsg("Size of file: " $FileSize " bytes");
                    
privmsg("Creation time: " $FileCreationDate "");
                    
privmsg("Modify time: " $FileModificationTime "");
                    
                    FOR ( 
$i 0$i <= $NrOfLines-$i $i 1)
                        
$linenr $LinesofFile[$i,"LineNumber"];
                        
$line $LinesofFile[$i,"Line"];
                        
privmsg("[".$linenr."]: ".$line);                    
                    ENDFOR

        !!!!!!!!!! USE 
THE FOR/WHILE LOOPONLY FOR THE LINES YOU WANT TO BE DISPLAYED ON YOUR SCREEN !!!!!!!!!!!!!!!!!!!
            
        
#===================================================
        #Edit file (Possible to edit various Filetypes: .log/.txt/.ini/.cfg/.lpr)
        #===================================================
        
                
$Filename "TestFile";
                
$Folder "C:\Users\Blah\Desktop";
                
$NewText "TESTTEST";
                
$LineToEdit = -1;  # -1 to create a extra line
                
$Extension ".txt"
                
EditFile($Filename,$Folder,$NewText,$LineToEdit,$Extension);

               
#Delete a single line in the file.
               #Set '-1' as $NewText and set $LineToEdit which line you want to delete.
    
                
$Filename "TestFile";
                
$Folder "C:\Users\Blah\Desktop";
                
$NewText = -1;
                
$LineToEdit 5
                
$Extension ".txt"
                
EditFile($Filename,$Folder,$NewText,$LineToEdit,$Extension);
?>

Release: LFSLapper V7.0.9.2
Bass-Driver
S3 licensed
Hello LFSLapperscripters,

Here is a another small bugfix release.
Thx to iceman121 reporting the Lappercrash. It took a while to find the cause of the crash, because it crashed on a rare condition. After creating/reading some logs, we could identify the cause and fix it.

#################################################################
#LFSLapper changelog: Updated @ 05-02-2023
#################################################################
+---------------------------------------------------------------+
|Changes from 7.0.9.1 to 7.0.9.2
+---------------------------------------------------------------+
Thx to iceman121 reporting the joinrequest() LFSLapper crash.

=================================================
Fix:
=================================================

1: Joinrequest() didn't execute when Z-value is 0.
2: LFSLapper crash on wrong carheading value in joinrequest().

3: Event 'onDistDone' executed after teleporting using JoinRequest().
4: Internal distmeter code did execute when a player is not moving.
5: Internal distmeter code did execute when a player is joining the track.

6: Warning on console about missing a script when LFSLapper is booting.
#################################################################

Files to replace: LFSLapper.exe

If you are using 7.0.9.0 or 7.0.9.1 you can take LFSLapper.exe from this version and replace it with your current LFSLapper.exe
Don't forget to BACKUP!!
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
I prefer controlling the player colour by insim.

Indicating teams.
Indicating carclasses.
Ranking.

A another example.
For our Timeattack system with multistage layouts, it could be handy to see which driver is driving on which stage.

I do not know how the insimpacket will look like but for LFSLapper i could create a simple function like:

$UserName = "Bass-Driver";
$Hexcolor = "FFFFFF" #White
PlayerArrowColour($UserName,$HexColor);

So for my point of view, i see more benefits to control the player colour by insim.
Bass-Driver
S3 licensed
Edited the post with a few new pictures and updated memberlist
Bass-Driver
S3 licensed
Nice to see, that you got the code working.
Its trial and error to understand how the code works. I'm sure you can build some nice scripts around it.

Also if a piece of code isn't working, you could check the xxx.xxx.xxx.xxx-yyyyy.ERR files(error logs) to check if something is wrong.
Bass-Driver
S3 licensed
First you have to check what the current 'Heading' of the car is

You can do that with the playervar : Getcurrentplayervar("Heading");
You may use this in a command like the code below.

CASE "!heading":
privmsg("Current heading of the car: ".getcurrentplayervar("Heading"));
BREAK;

Then you have rotate the car 180 degrees

Example:

Values of JoinRequest goes from (0 - 180) and (-1 -179)

Current heading is 90
Set headingvalue in joinrequest() to -90

Current heading is 45
set headingvalue in joinrequest() to -135

Release: LFSLapper V7.0.9.1
Bass-Driver
S3 licensed
Hello Lapper users.

Small bugfix release, according to displaying times from the database to the TOP list(!top) or Driftscore list(!drf) for modded cars.
Thanks System01.54 for finding the bug.


+---------------------------------------------------------------+
|Changes from 7.0.9.0 to 7.0.9.1
+---------------------------------------------------------------+

=================================================
Fix:
=================================================

1: requesting toptimes(!top <carid>) / driftscores(!drf) from modded cars doesn't always appear. Always returned the times from (mod)cars set in $DefaultTopCar.
Now it displays the time/score of the car you are currently driving or by requesting the specific time by !top <carid>.

Note: The !top script in the CIF menu is outdated, but still functional.


Which you all Merry Christmas and a happy New Year.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Try to find and install: Visual C++ 2010 Redistributable Packages x86/x64

and

https://www.lfs.net/forum/post/1937920#post1937920

and see what that does.

What is the version of LFSLapper you have?
Bass-Driver
S3 licensed
Look for Visual C++ 2010 Redistributable Packages x86/x64
Bass-Driver
S3 licensed
Quote from Racon :It seems from the log that lapper is shutting down because the request to use version 8 is denied - if that's what it is, you'll need an older version of lapper to connect to LFS 0.6R. (0.6T is the first to use InSim v8)

aah ye good point, thanks. I always update LFSLapper along with the LFS version. I haven't tested this before.

@Servet_zngl
But it requires a big sourcecode change. Totally not worth the effort.
I suggest to update your LFS version
FGED GREDG RDFGDR GSFDG