The online racing simulator
Hi Guys, 2 more questions..

1) What does the following script do as its chucking errors which I have included...
SUB PstInfo($userName)
$currPly = getPlayerInfo($userName);
if($currPly == "") THEN
WriteLine("Coucou");
RETURN();
ENDIF
openPrivButton("Back",74,58,52,64,5,-1,ISB_DARK, "");
openPrivButton("PSNickName",75,59,50,5,5,-1,ISB_DARK, $currPly["NickName"] . " ^7(" . $currPly["PSCountry"] . ")");
openPrivButton("PSDistance",75,65,50,5,5,-1,ISB_LIGHT|ISB_LEFT, langEngine("%{main_psdistance}%", strFormat("{0:0}", ToPlayerUnit($currPly["PSDistance"]/1000)),$currPly["UnitDist"]));
openPrivButton("PSFuel",75,70,50,5,5,-1,ISB_LIGHT|ISB_LEFT, langEngine("%{main_psfuel}%", strFormat("{0:0}", $currPly["PSFuel"]/1000)));
openPrivButton("PSLaps",75,75,50,5,5,-1,ISB_LIGHT|ISB_LEFT, langEngine("%{main_pslaps}%", $currPly["PSLaps"]));
openPrivButton("PSWins",75,80,50,5,5,-1,ISB_LIGHT|ISB_LEFT, langEngine("%{main_pswins}%", $currPly["PSWins"]));
openPrivButton("PSSecond",75,85,50,5,5,-1,ISB_LIGHT|ISB_LEFT, langEngine("%{main_pssecond}%", $currPly["PSSecond"]));
openPrivButton("PSThird",75,90,50,5,5,-1,ISB_LIGHT|ISB_LEFT, langEngine("%{main_psthird}%", $currPly["PSThird"]));
openPrivButton("PSFinished",75,95,50,5,5,-1,ISB_LIGHT|ISB_LEFT, langEngine("%{main_psfinished}%", $currPly["PSFinished"]));
openPrivButton("PSQuals",75,100,50,5,5,-1,ISB_LIGHT|ISB_LEFT, langEngine("%{main_psquals}%", $currPly["PSQuals"]));
openPrivButton("PSPole",75,105,50,5,5,-1,ISB_LIGHT|ISB_LEFT, langEngine("%{main_pspole}%", $currPly["PSPole"]));
openPrivButton("pstclose",75,111,50,10,5,-1,ISB_DARK, langEngine("%{main_close}%"),ClosePstInfo);
ENDSUB

SUB ClosePstInfo($KeyFlags,$id)
closePrivButton("pstclose&Back&PSNickName&PSDistance&PSFuel&PSLaps&PSWins&PSSecond&PSThird&PSFinished&PSQuals&PSPole");
ENDSUB

Error:
3/28/2019 10:46:02 PM -> Syntax error: in file ".\default\LFSLapper_1.lpr" at line #1106
'openPrivButton' parameter #7(ISB_DARK) is wrong type at line #
Function 'pstinfo' script aborted

2) Is it possible to check Drivers LFSW PB Laptime in FXR & FZR & XRR and if any of them are below a certain figure access is allowed. I have a script but $DefaultTopCar = "FXR" blocks FZR & XRR

Thanks for your help its appreciated
Andy
Again the answer could have been found in 'changes.txt' where it says this:

+----------------------------------------+
|Changes from v5.902 to 5.903 |
+----------------------------------------+

Add player var retreiveid from Pubstat

PSDistance, // online statistics of one racer - distance in metres
PSFuel, // online statistics of one racer - fuel burnt in cl
PSLaps, // online statistics of one racer - laps
PSHostsJoined, // online statistics of one racer - hosts joined
PSWins, // online statistics of one racer - Wins
PSSecond, // online statistics of one racer - Second
PSThird, // online statistics of one racer - third
PSFinished, // online statistics of one racer - finished
PSQuals, // online statistics of one racer - quals
PSPole, // online statistics of one racer - pole
PSDrags, // online statistics of one racer - drags
PSDragWins, // online statistics of one racer - drag wins
PSCountry, // online statistics of one racer - country

The error means that the syntaxt of one of those buttons is incorrect.
I cannot look into that at the moment, but should be easy to figure out when looking at the line number given in the error log.

It's not possible to retrieve the LFSW PB laptime for a player.
You can make authorisation rules using this event:

###################################
#Authorization Options ( license )#
###################################

As a side note.
Value $DefaultTopCar can be changed using: SetConfigVar("DefaultTopCar", "FXR");
See the following script how this can be used: https://www.lfs.net/forum/thread/91566-Deleter-records-%28laptimes---driftscores%29
Hi Yisc, thanks for that and have saved Changes Log so I can search it first in future. I have had a look a your Delete Laptimes Script but its beyond me as I have forgotten loads. Would it be possible for you to write me a script that will check a LFSW UserName in FXR + FZR + XRR for a PBLapTime below lets say a 1:44:00 in any car and sets a SetUserStoredValue of say "Yes" that I can use in my Licensing System. I know its a big ask but would help me out loads and save me a huge headache lol.

Andy
I would like to write the script for you, but currently it's not possible to use Lapper to get a PBLapTime for LFSW.
I could make a script checking the PB from your local database, but that would mean that people first need to get an opportunity to set a descent lap time.
Or Bass-Driver should try to add the option of retrieving a PBLapTime from LFSW using Lapper.
Quote from Yisc[NL] :I would like to write the script for you, but currently it's not possible to use Lapper to get a PBLapTime for LFSW.
I could make a script checking the PB from your local database, but that would mean that people first need to get an opportunity to set a descent lap time.
Or Bass-Driver should try to add the option of retrieving a PBLapTime from LFSW using Lapper.

Hi Yisc, I already wrote a script to check my local DB but get new drivers to my Servers trying to join that can't even though they have amazing LFSW PB's so was trying to fix that issue. Cheers though.

Andy
a quick look at the old code it seems that retreiving values from LFSW need a complete overhaul.

look throught the Lapperfunctions list, i see 2 functions to retreive PB's from LFSW??

currentplayerlfsworldpb();
currentplayerlfsworldpbfrom();

I only found a changelog of currentplayerlfsworldpb();.
cant find anything of currentplayerlfsworldpbfrom(); , i have to look at the sourcecode for that.


+--------------------------------+
|Changes from v5.840 to 5.841 RC |
+--------------------------------+
1. Add new GLScrip command
CurrentPlayerlfsWorldPB( $argv );

Display a screen table with the lfs world PB for the current player
$argv cant contain a car or a track or the two values
$argv = "XRT" -> Display all LFS world PB for the XRT Car
$argv = "BL1" -> Display all LFS world PB for the BL1 Track
$argv = "BL1 XRT" -> Display LFS world PB for the XRT car and BL1 Track

This feature need the pubStatIdk setted in config file

Due to the tarpit that forces you to wait 5 seconds between two call to pubstat
( if two player join in less than 5 sec the server ), you need to wait few second
before retry command.

2. Add new function in LFS chat
!mypb to view your LFS world PB

example:
!mypb XRT
!mypb BL1

Edit:
Looking throught the code, it seems to open a list with the current LFSW PB's. This list is hardcoded.

currentplayerlfsworldpbfrom() is the same function as above but with a 2nd parameter.
currentplayerlfsworldpbfrom($argv,$startfromline);

It opens the same table but starts from a differend position in the table?
Hi Dan, cheers for this. I have tried for ages to get the info I need AS3+FXR AS3+FZR AS3+XRR but all I get is "No LFS World PB for this criteria" and PubStat is set.

Andy
Quote from Andy King :Hi Dan, cheers for this. I have tried for ages to get the info I need AS3+FXR AS3+FZR AS3+XRR but all I get is "No LFS World PB for this criteria" and PubStat is set.

Andy

I looked into this and got it "working" with the following script:


CatchEvent OnNewPlayerJoin( $userName ) # Player event
OnNewPlayerJoin__LFSW_pb_chk();
EndCatchEvent

Sub OnNewPlayerJoin__LFSW_pb_chk() # Player event
$argv=getLapperVar( "ShortTrackName" ) . " XFG";
writeline ( "DEBUG: " . CurrentPlayerlfsWorldPB( $argv ) );
EndSub

First I had it in the OnConnect Event, but then it's failing all the time.
In the OnNewPlayerJoin the code is working BUT instead of returning a value (or values) it opens a list on screen (which cannot be closed).
That list is displaying the information that has been asked for "BL1 XFG" (in my case), but you cannot use it to check anything, because all of this is hardcoded into Lapper, like Bass-Driver already said.
So for now, this function isn't very usefull, but maybe this will inspire Bass-Driver to change it in a future Lapper version.

Attached images
Capture.PNG
Hi Guys, I have added a 10 Min Temporary Licence System to my servers so if licencing system is ON drivers who haven't got a Licence on my Servers can take the 10 Min Temp Licence to get a FULL Licence meaning they can join in straight away and if they are any good will get Licensed withing a few laps and if not are spectated after 10 mins with No 2nd chances. Will do as a work around until I can access LSFW Data from Lapper.

On another note I have started putting together a !top / !near list but an stuck on how to fill the list, I can pull Date, PBLapTime, NickName etc etc from DB but can't work out how to make it a list as in when code gets to end of line it populates the next line. Can you throw any light on my issues please as searched but can't find anything specific and tried loads of bits found but nothing seems to work.

Thanks
Andy
Hi Yisc that looks brilliant if it didn't have the DELETE Function in User Mode lol but will take a good look at it later. Thanks

Andy
Hi Yisc, how do I increase the number of records shown?

Andy
Quote from Andy King :Hi Yisc, how do I increase the number of records shown?

Andy

As far as I remember, this is no limit to the number of records shown.
If I look at the image below, I see that a "Next page" button is shown, if there are more records then to fit on one page.

It only shows the Top 25 of each car type and I have GTR as $DefaultTopCar = "GTR" so I get a total of 75 records. Is this anything to do with it....

IF ($list[$j,"PBLapTime"] > 3599000) THEN
$colpb = ((3600000 - $list[$j,"PbLapTime"]) / 10) . "/" . GetConfigVar("LapTimeUsedForPb") + langEngine("%{built_lapsdone}%");
ELSE
$colpb = NumToMSH($list[$j,"PBLapTime"]);
ENDIF

Andy
Ah okay, yes the default only shows Top25 of each car.
That's the reason I made my own scripts, like the one I already mentioned, but you might also want to check this one out: https://www.lfs.net/forum/post/1883528#post1883528

Look for: toptable.txt
Thanks Yisc, Need some help as adding to my PitBoard Driver & Gap in front and behind but stuck as to how to make it a NickName...

$Behind_NickName = getplayerinfo("UNameBehind");
$Behind_Gap = getplayerinfo("GapBehind");

Have I setup these up correctly?

Andy
UNameBehind = is the UserName

I cannot remember what information is returned when using: getplayerinfo("UNameBehind")
But if you know the UserName, it wouldn't be too hard to get the nickname from that.
I've looked into the code and think this should do what you want:

$Behind_NickName = GetPlayerVar( getplayerinfo("UNameBehind"), NickName) );
Quote from Yisc[NL] :I've looked into the code and think this should do what you want:

$Behind_NickName = GetPlayerVar( getplayerinfo("UNameBehind"), NickName) );

Cheers but that doesn't seem to work and tried all afternoon to get this to work and had no luck so any more help would be appreciated.

Andy
Would this work:

$Behind_NickName = GetPlayerVar( GetCurrentPlayerVar("UNameBehind"), NickName) );
Quote from Yisc[NL] :Would this work:

$Behind_NickName = GetPlayerVar( GetCurrentPlayerVar("UNameBehind"), NickName) );

I can't seem to get any of the 4 Player Variables to work...

UNameBehind, // UserName of the player behind you in race
GapBehind, // Gap between you and player behind you in race
UnameBefore, // The username of the player before you in race
GapBefore, // Gap between you and the player before you in race

Don't understand what I'm doing wrong. Is it OK the use a "RegisterNodeAction("PitBoard","AS3",471,PitBoard_Node,"");" to call these Variables each time the Node is passed? by opening a button with the info in it as it works fine with my SpeedTraps?

Andy
I think you can use the NodeAction as you suggested, but you also need to consider this:

Event OnNewGapPlayerBehind() // When a new gap are avaiable for player behind you
Event OnNewGapPlayerBefore() // When a new gap are avaiable for player before you

Gaps (Behind and Before) are only updated when a player crosses a sector- or finishline and then those events are triggered.

I don't know exactly what you are trying to achieve.
Feel free to share your idea (and if possible your Lapper script as well) here with me.
Otherwise send me a Private Message on this forum or you could send me the script through email if you wish.
Quote from Yisc[NL] :Gaps (Behind and Before) are only updated when a player crosses a sector- or finishline and then those events are triggered.

If thats true how does LFSRelax get continuous gapping information though InSim? as was trying to get info at lets say every 50 Nodes like 50 100 150 200 etc. I was basically trying to integrate an LFSRelax gapping system into my PitBoard.

Andy
LFSRelax must handle the gapping information differently then Lapper does.
Maybe their way can be build with Lapper as well, but I am not sure that it can be done with "live" information.
When I am having doubt about something being possible or not, I usually create a very basic script with output to Lapper console or LFS chat to see if it's possible.
You only need a few players to test such thing.
Actually, it is possible and I even made a live script at some point Face -> palm (as a test for something bigger I had planned to build at some point, but that never happened in the end).
Find attached script, which does display live information about another player.

Save the file in your Includes folder and rename it to: following.lpr
Also add a line to addonsused.lpr to be able to use this script.
Attached files
following.txt - 5.5 KB - 179 views

FGED GREDG RDFGDR GSFDG