The online racing simulator
Searching in All forums
(446 results)
Krayy
S2 licensed
Quote from Bass-Driver :k
i cant compile LFSLapper.csproj in visual C#
when i open LFSLapper.csproj then Visual C# said its a LFSLapper.csproj.user file
is this correct??

You're trying to open the LFSLapper.csproj.user file, not the LFSLapper.csproj file. Turn off "Hide extensions of known files" in Windows Explorer.
Krayy
S2 licensed
Quote from Bass-Driver :i have copy everything from the file u have added.
and after that i have tried if SaveGroupToFile works.
but the code after ELSE (!addadmin) and the code after the 2nd THEN (!readmin) doesnt work anymore.
!addadmin and !readmin does work without SaveGroupToFile( "UserAdmin", "./UserAdmin.txt" );

this is from the errorfile:
savegrouptofile' is not a Lapper function
Function 'onmso' script aborted

Heya,

Okay, the code in the post is an example of what you can add to the *.lpr files to support usergroup save/listing.

The attachment (the patch file) is what you need to use to alter the source code (this pathc file is from TortoiseSVN, but can be used with any othe SVN app or manually).

The errors that you are getting are because the source code and LPSLapper.exe has not been rebuilt yet. To do this you will need to have Visual C# Express Edition installed, and have the LFSLapper source code extracted to a directory.

The patch file lists the files that are altered in the LFSLapper/src directory, the code lines to add (+) and lines that should be removed or commented (-). Make these adjustments then open the LFSLapper.csproj file in Visual C# and hit the F6 key to recompile. You will now find a new .exe file in the Release directory. Copy that over your old LFSLapper.exe are you're away laughing
Krayy
S2 licensed
I'll throw my 2cents in the hat with this: http://www.lfsforum.net/showthread.php?p=1259430#post1259430

That should sort everyone out.

(Here's hoping Gai-Luron puts it in the next release)
[CODE] List and Save Usergroups (particularly the admin group)
Krayy
S2 licensed
Hi all,

Heres a patch file that will add the ability to get a comma seperated list of users in a group, along with the ability to save a usergroup to a disk based file. I have included code below to add to the LFSLapper.lpr file to enable you to add and delete Admins while in game.

Note that Lapper can only return strings, floats or ints to the GLScript parser, so the user lists are returned in a single comma separated string. You will need to use substr or split as I have done to access each username in turn.

PS: The patch file also adds code to allow the rcae host (UCID 0) to !start, !stop and !reload lapper. This is because we use the LFS Server on a dedicated host and this way we don't have to run another instance of LFS to get it up and running.

Add this code in the main "SWITCH( $command )" CASE statement:

<?php 
        
CASE "!listgroup":
            IF( 
UserInGroup"admin",$userName ) == )
            
THEN
                
IF( $argv != "" THEN
                    privMsg
"^3Current members of group: " $argv "^8" );
                    
PrintUserGroup ($argv);
                ELSE
                    
privMsg"^3You must specify a user group to list^8" );
                ENDIF
            ENDIF
            BREAK;
        CASE 
"!admins":
            IF( 
UserInGroup"admin",$userName ) == )
            
THEN
                
IF( $argv != "" THEN
                    $idxSpace 
indexOf$argv" ");
                    IF( 
$idxSpace != -THEN
                        $option 
subStr$argv,0,$idxSpace );
                        
$argv trimsubStr$argv,$idxSpace ) );
                        SWITCH( 
$option )
                            CASE 
"add":
                                
MoveUserToGroup"admin" $argv);
                                
SaveGroupToFile"admin""./admin.txt" );
                            BREAK;
                            CASE 
"del":
                                
RemoveUserFromGroup"admin" $argv);
                                
SaveGroupToFile"admin""./admin.txt" );
                            BREAK;
                            DEFAULT:
                                
privMsg"No such option for this command: " $option );
                            BREAK;
                        ENDSWITCH
                    ELSE
                        
privMsg"Command needs more parameters" );
                    ENDIF
                ENDIF
            ENDIF
            
privMsg"^3Current Admins:^8" );
            
PrintUserGroup ("admin");
            BREAK;
?>

Add this code after the EndEvent statement at the end of that ENDSWITCH:

<?php 
Sub PrintUserGroup 
($UserGroup)
    
$IsNotBlank 1;
    
$GroupIndex 0;
    WHILE (
$IsNotBlank == 1)
        
$GroupUser=splitListGroupUsers($UserGroup),",",$GroupIndex );
        IF ( 
$GroupUser != ""THEN
            privmsg
($GroupUser);
            
$GroupIndex $GroupIndex 1;
        ELSE
            
$IsNotBlank 0;
        ENDIF
    ENDWHILE
EndSub
?>


Happy racing.
Last edited by Krayy, .
Krayy
S2 licensed
Quote from Tur8o :Hey guys....

how do i get the pb because i cant find a way of finding it to put into a button or anything... i guess i would have to make it or is it hidden like "getcurrentplayervar "pb""

Thanks Tur8o

GetCurrentPlayerVar("pblaptime") - will give you the current pb for this car/track
Krayy
S2 licensed
Quote from Fire_optikz001 :5.8.4.5
EX i have
...<snip>...

I like that...mind if I "borrow" it
Krayy
S2 licensed
Quote from Fire_optikz001 :yay just what i need hmm would that code work with my ban files too?

How do you mean ban files?

PS, what version of lapper are you using?
Krayy
S2 licensed
Quote from Fire_optikz001 :well thats what i have i was just asking and by mass i ment multi servers but thats alli needed to know whatnks guys

Just remember that you will need to adjust all of the LFSLapper.lpr files for all lapper instances to point to ../admin.txt

BTW, I'll put up some code soon to allow you to add/remove admins while inside LFS.
Krayy
S2 licensed
Quote from aroX123 :I suggested this a while ago
http://www.lfsforum.net/showthread.php?t=60030 (not only this but the insim)

Posting a video link isn't exactly doing the coding, but....

One thing that really annoys me is that when I'm spectating and go around the track, you cannot tell the racers name and position unless you are in an overhead cam mode with names turned on and have the race list up.

So...what I'm thinking is to see if there is a way to get lapper button that appears when you go to spectate mode and the camera changes to cahse/heli/tv and shows the player name and position just as in the first few seconds of video in your link.

I'll do some investigation and see what I can do.
Krayy
S2 licensed
Quote from Fire_optikz001 :ok i was thinking of a mass admin file
it seems to be working but in my logs i have

Can't open group file : ./default_1/../user/admin.txt

i only get that every once in a while i was thinking is there a way to go up a directory in lapper? like from default_1 into user

or did i do it right?

Depends on what you mean by mass admin.

Are you saying that you want everyone to be an admin, because if you already have a list of admin users, then just copy them into the admins.txt file in the main lapper directory and then change the line in the LFSLapper.lpr file that says:

UserGroupFromFile( "admin", "./admin.txt" );

to

UserGroupFromFile( "admin", "../admin.txt" );
Krayy
S2 licensed
Quote from Fire_optikz001 :i have pitbored on false

i just tried true and it still dont work

I don't mean true or flase, I mean making sure that pitboard.lpr is included amongst these lines:
####################
#Overriding options#
####################
include( "./includes/addonsused.lpr");
include( "./includes/pitboard.lpr");
include( "./includes/pitwindow_gui.lpr");
include( "./includes/safetycar.lpr");
include( "./includes/ctrack.lpr");
include( "./includes/guiconfig.lpr");
include( "./includes/who.lpr");
include( "./includes/handicapper.lpr");
include( "./includes/myInc.lpr");

The who and hc commands use a data array in the pitboard.lpr file so it needs to be included. There is a thread re culling these out into a separate file, but until that happens, the pitboard.lpr needs to be included.
Krayy
S2 licensed
Quote from Fire_optikz001 :thw who and !hc commandsarnt they sapposed to show usernames or something? mine is blank :S

Screenshots? and is there anything in the error logs?

AND do you have pitboard.lpr in the include list in lfslapper.lpr?
Last edited by Krayy, .
Krayy
S2 licensed
Quote from sinanju :<snip>
If I set it to 10, it goes - 10, 8, 7, 6....
Set it to 5, goes - 5, 3, 2...

Anyone else having this problem?

The problem that you are experiencing looks to me like its due to latency in the lapper code itself. The doCountDown function subtracts the current time in seconds from the predicted button visible time in seconds then updates the text. The problem is that when doing time subtractions in seconds, there is some rounding going on that may cause the function to skip a second. So if you open the button the first time at 3.9 second past the minute, the text wont update till at least 1 second has passed. If the code gets executed 1.2 seconds later, then you are now at 5.1 seconds past the minute. Second 4 has effectively disappeared. This time slip will be cumulative, so I would suspec that if you have a button counting down from 20 or 30, you would see 3 or 4 numbers missed. Give it a test if you can and see what the outcome is.

So the problem could occur at any time, not just for the second number. It also depends on several other factors, like how many buttons are visible, how many of them are countdowns, and if lapper is doing some other things as well.

One possible fix may be to do the time subtractions in milliseconds rather than seconds to make it more accurate. Other things we could is to go through the code and do some tuning to see if the number of system calls, functions and other bits around the countdown stuff can be made faster.
Krayy
S2 licensed
Quote from Yisc[NL] :pitboard.lpr is my creation and yes the user_array is used in some other scripts of mine too. It's been a long time since I took a good look at the code but I will try to give a shot in the next couple of weeks.

Thanks Yisc...it's a handy piece of code for sure, as it saves a lot of cycles doing external calls back to the lapper exe.

Come to think of it, maybe we should combine it with a few other snippets to make it a ref for arrays in general. I have attached a sort of starting point, but your input would be most welcome.

EDIT: Come to think of it, let's just call it lapper_global.lpr and get everyone to put any useful globals and supporting functions in there
Last edited by Krayy, .
Krayy
S2 licensed
Very creative...anyone who can get bollocks and boobies into the game is alright by me
Pitboard.lpr user_array proposal
Krayy
S2 licensed
Hey there guys,

Since there are quite a few scripts that are using user_array, do you think it might be worth extricating the code to create/add/update user_array entries into it's own include?

The reason I'm suggesting this is that we wanted to disable the pitboard on some of our dev/test servers and it broke a few other includes.

Also, this gives us a place to add things like indexing variables so we can call it using something like "$uName = $user_array[$i,$uaUserName];" rather than an obscure index number.

I'm also wanting to add some extra fields, for info such as this track/car PB and a few others to save extra function calls, which all take proc time.

I'm not actaully sure who created the pitboard.lpr, so it would be their call, but I would hope that in the interest of wider development, they would consider to do so (or pass it back to me to implement).
Krayy
S2 licensed
My LFSLapper.lpr file has got the !conn command defined as:

SWITCH( $command )
...
CASE "!conn":
show_connected( 0,0 );
BREAK;

I'm not sure if this is the standard or not, so the connected function in your connected.lpr file might need to be renamed, or vice versa.
Screenshot
Krayy
S2 licensed
Heres a screenshot...
[CODE] In game user handicapping GUI
Krayy
S2 licensed
Hi guys,

Heres an update to Lapper v5844 to allow an admin to assign, save and load handicaps in-race. We use this in our league races to apply racer penalties on the fly, save them into the StoredValues DB, then reload them for next race. Admins see the buttons to add/remove weight or intake restrictions, whereas normal racers only see the settings, they cannot change them

NOTE: When you download these files, I had to add a .txt extension as the wont upload otherwise. Take the .txt off the end

To apply the patch, you will need to:
  1. Make sure that "pitboard.lpr" is in your include list in the LFSLapper.lpr file, as this add on uses the global $user_array var
  2. Make the changes in the attached patch file to the parseEvents.cs file and rebuild the Lapper exe
  3. Copy the attached handicapper.lpr file into your includes directory
  4. In the LFSLapper.lpr file, add the code below:
Add this to the LFSLapper.lpr file where you see the other includes:
include( "./includes/handicapper.lpr");

Add this to the LFSLapper.lpr file where you see the other command definitions (like !help or !top):

CASE "!hc":
DoHandicapper();
BREAK;

Let me know of any bugs you find.
Krayy
S2 licensed
Quote from Fire_optikz001 :nvm fixed it but now my problem with easy click ... i have a version info button and this is the end part it opens the first part wich is lapper version information but it dont open the reset

Sub MA_ver( $KeyFlags,$id )
IF( UserInGroup( "beta",$userName ) == 1 )
THEN
openPrivButton( "ver",35,28,125,10,5,-1,0,"^6Lapper Version Information" );
openPrivButton( "ver2"35,38,125,6,5,-1,32,"^2this server is running ^0[^4S^0C] ^7Lapper version 7.00 ^3Alpha"
. "&^2made by ^0[^4S^0C] ^7T3ChaRmy"
. "&^2Score Board made by ^7[TT^1R^7] Ken Nomura"
. "&^2based off of ^6Gai-Luron's ^2LFSlapper"
. "&Click To Close!",MA_closever );
ELSE
openPrivButton( "ver",35,28,125,10,5,-1,0,"^6Lapper Version Information" );
openPrivButton( "ver2"35,38,125,6,5,-1,32,"^2this server is running ^0[^4S^0C] ^7Lapper version 6.50 ^2Stable"
. "&^2made by ^0[^4S^0C] ^7T3ChaRmy"
. "&^2Score Board made by ^7[TT^1R^7] Ken Nomura"
. "&^2based off of ^6Gai-Luron's ^2LFSlapper"
. "&Click To Close!",MA_closever );
ENDIF
EndSub

Forget the screenshot. Your problem is that the line starts:
openPrivButton( "ver2"35,...

There should be a comma in between the " and the number 35 like this:
openPrivButton( "ver2",35,...

Krayy
S2 licensed
Quote from Fire_optikz001 :i mean i have certain things that are under develop ment that i would not like people to see untill there finalized that and i fixed it as i said can u please help me with my easy click?

i will plan on releasing my easy click soon as i know its what i think is good enough and it works

Is a screenshot possible? And is there anything in the lapper error log?
Krayy
S2 licensed
Quote from Fire_optikz001 :i dont like posting my stuff where every one can steal ideas i would rather send it in a pm to some one i can trust

If we're following the letter of the law, then the GPL license that Lapper has attached to it would mean that you have to provide the source code to any project based off of it, so any intellectual property is in the public domain.

From a community point of view, secrecy and a willingness not to share will only make your development cycle a lonely one, as no one would be willing to help someone who doesn't contribute to the project as a whole.

Your call.
Krayy
S2 licensed
Quote from Fire_optikz001 :well i dont use it in the language i use a single language one

In that case, just post your welcome message and include a few of the lines above and below so we can see if there is a syntax error
Krayy
S2 licensed
Quote from Fire_optikz001 :ok i was testing my new updated lpr and every thing below the welcome dont work =S could u help me gai?

Can you post your welcome message that you have edited in the lang section, along with the couple of lines below it too.
[CODE] Replacement !help function
Krayy
S2 licensed
Hey all,

Updated to version 1.0.4

Here is a Lapper add-on for ver 5.926b+ that allows for multiple page helps.

To install, copy the file into includes directory with the name multipage-help.lpr, then edit the addons.lpr file to include the line:

<?php 
include( "./multipage-help.lpr");
?>

at the end of the file. The curent help in Lapper uses the command !help, so if you want to fully replace it, you will need to rename the !help command in the Lapper.lpr file to something else like !help2.

Note: This code includes english helps only at the moment and also requires the attached utils.lpr file to be uupdated as well
Last edited by Krayy, .
FGED GREDG RDFGDR GSFDG