The online racing simulator
Searching in All forums
(446 results)
Krayy
S2 licensed
The Membership Admin gui will do this as weel in that it allows you to make a racer a guest, visitor. full member or admin. Then you can just test that when they log on to see what permissions they have. No reason why it cannot be modified to be a license grading system as well.

In fact thats a good idea for an addon...
Krayy
S2 licensed
Quote from Yisc[NL] :Not that I know of.
Kravy took over the project from Gai-Luron, who took it over from Monkey on hot tin roof a long time ago.
Kravy said that the work was nearly finished for this release, but that was over a week ago.
On the other hand, he is doing this in his spare time and voluntary, so who are we to push him in any way

Push away...The binary is fixed so its just teh lpr addons that I'm working on, so if you want I can release the .exe with the bare lprs you need to run it and then post the addons as they become available.

mainly the pitboard is what I'm trying to fix as it needed a lot of work.
Krayy
S2 licensed
Quote from ViKTOOR-LFS :hi guys i need help here...

about

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

how i can Choose only Friends licenses Join to server<for Example


coz I've seen this before and the server kicked me because I did not register to website for drift team or something like that !! But I was not sure about the InSim lfslapper or somthing else !!

To be honest I've never understood the Auth system myself.

What exactly are you wanting to acheive?
Krayy
S2 licensed
Quote from sinanju :Would it be possible for lapper to have some sort of lapper or player time variables?

Maybe a StartTime and an EndTime, both outputting to at least 1/100th of a second?

There's already a getLapperVar( "LongTime" );, which is the server time in long format, but that only gives you hh:mm:ss.

Currently in the player vars RaceTotalTime tells you the elapsed time of the current race LapTime and the Split vars will tell you the lap time at each split so there is no real time accounting of the time on your current lap.

All these times are in milliseconds and can be converted to short time strings using numtoms or numtomsh
Krayy
S2 licensed
Quote from paul88 :i would like to no if lfs lapper can do some things

1st race event so that the server will auto start qualify then 2 races 2nd race in reverse order on say ie every 2 weeks at 6.50 pm

2nd password the server 10 mins before the race event starts

3rd i have NextRace, the Online Tracker v1.00 running so that drivers can register for a race event can this be used so that when lapper starts the event only the registered drivers from NextRace, the Online Tracker v1.00 can get on server
??? hope all this makes sense

ooo ps if lapper doesnt can someone tell me what does

I kind of like these ideas. The 1st and 2nd are possible with Lapper now, and in fact most of it is done in the config_race.lpr CIF module, although that is still Beta.

The last I'd have to look at the NextRace app and see if the devs there and us can work together to have a symbitotic relationship with a common data stream. I'll do some research on that and let you know how we get on
Krayy
S2 licensed
I'm thinking that we just write a lapper module that displays a location box that gives you your x, y co-ords along with the current Node and Zone (if any) and updates every new Node. Define some Zones and Nodes and see how it bahaves to create a virtual map of the course
Krayy
S2 licensed
Quote from sarxes :There is any way to run LFS lapper without dedicated host in single player ?

LFS needs a lfs server to connect to, so technically you can run LFS on your PC and set it up as a local server then connect Lapper to that
Krayy
S2 licensed
Quote from paul88 :guys need help on lapper when in lfs you have t!pwgui set pit window when this is set to 1 pit window with tyre change nothing is done am i missing something ?

We're currently rewriting that module for the new lapper version, so we'll fix it in the next release
Krayy
S2 licensed
Well the bones of the script look okay.

The problem is that when using an Autcross layout, it's a pain in the butt to use zones and nodes to determine where you are, as on a track you have a defined area to be in.

Quick definition time...Node is a point on the track, at location X:Y. A Zone is an area around a Node determined by an X:Y co-ordinate and a distance. The distance creates a circle around the Node so you can find your distance from it.

Now as far as I know, drag lanes and start boxes are square, so if we create a Zone which is a circle, how can we be sure the person enters it?

I can say that you are on the right track. i would start with creating a left lan and right lane zone that has a radius of say 5, so make the x:y co-ords out in the lane with the outside of the circle touching the start line. Then you could create an event to see if that person eneters the box before your drag_penalty global has been cleared (BTW, use TRUE and FALSE, not "one" and "off" as doing a numeric compare is faster than a string one).

Just experiment that and see where you get. Failing that, we might see about creating new Lapper code to handle Zones as Boxes, like RegisterBoxZoneEvent.
Krayy
S2 licensed
If you use the GetCurrentPlayerVar function to get the name of the player in front of or behind you, you can then get their x and y loc like this:

<?php 

$me 
GetPlayerInfo( );
$behind GetPlayerInfo$me["UNameBehind"] );

$xdiff $me["X"] - $behind["X"];
...
etc
?>


TIP: Use the dumpvar($me) command to get a list of variables available in the array that getPlayerInfo returns printed in the lapper console
Krayy
S2 licensed
Quote from sarxes :Some where should I download the lapper ??? I can't see any download link Nice work again thx for the effort and free time for continue developing the lapper !!!

I'm just adjusting some of the lapper addons to suit the new version and will repost shortly
Krayy
S2 licensed
Quote from Yisc[NL] :That site is only in French
And as soon as you click the English flag, the page cannot be found.
Both flags are pointing to a non existing URL.

English translation is at http://cgtavc.monespace.net/lapper/help/en/
Krayy
S2 licensed
Quote from sinanju :For the next update, can you replace the existing driftmeter.lpr (in the /includes directory) with the attached please?

A couple of bugs had crept into the driftmeter.lpr file (namely main_ongooddrift, which should have been driftmeter_ongooddrift, and the french letter é showing incorrectly as é).

I've also tidied up the code by getting rid of the huge amount of closePrivButtons with use of closeButtonRegex, which makes things easier to follow.

Done
Krayy
S2 licensed
Hey all,

Please note that we have found some issues with a few of the lpr includes so will update them asap and hopefully get up a version that works as adevrtised out of the box
Krayy
S2 licensed
Quote from Yisc[NL] :I've done a search and found admin1.txt and admin2.txt being a part of listevent.lpr, which isn't mine and which is included in the standard Lapper distribution

I've attached my Pitboard code, which uses the array I mentioned.

Right, arrays...I'll create a post on how to use them properly (at least as far as I can make out - that part of the code is very tricky) but the bottom line is that the way you're using them for the $user_array was sort of deprecated when lapper jump to v6.

There is nothing in the functions that use $user_array that you cannot duplictae with the getListOfPlayers function and using stored values. I'll have a look at rewriting your pitboard.lpr script to use those functions which will save all the hasle of trying to force the array structures to behave themseleves.
Krayy
S2 licensed
Okay, so let's go through how to set up Lapper to talk to your server and see if this solves your problem:

1) In the LFS server directory, check the stup.cfg file for the following lines:


<?php 
// host name
/host=LFS-DEV

// optional: password
/pass=password

// optional: admin password
/admin=testing

// optional: InSim port
/insim=31993

?>


This means that my test server will be running InSim on port 31993 with the admin password "testing".

Next check your Lapper config files. Firstly the LFSServers.cfg file in teh Lapper directory:

<?php 
#    Configuration of LFSServer to be Managed with LFSLapper
# One line per server
# Remote port is the port used to manage LFSLapper remotely, future extension
# One remote port per LFSLapper on one machine, autoStart is optionnal
#Unique ID|GroupId|Ip|Port|WorkDir|IniFile|autowork
timeOutScript=2000;
remotePort=3001;
DEF1|gr1|127.0.0.1|31993|./default|default_1.ini|autowork
?>


here I have 1 Lapper instance that connects to an InSim on port 31993 and has its config in the default_1.ini file that resides in the ./default/ directory.
The default_1.ini file contains:

<?php 
$password 
"testing";
$configFile "LFSLapper.lpr";
$superUsersFile "superusers.txt";
?>

As you can see the password in this file matches the password set on my Lapper server so that it will connect as an Admin user.

Check all those configs and get back to us.
Krayy
S2 licensed
The problem with the voting looks like the logic used to determine what lap the race is on. Lapper has this internal code:

<?php 
                
if (currRace.inRace == false || (currRace.inRace && currRace.lapsDone >= InRaceLapsVoteMin && currRace.lapsDone <= InRaceLapsVoteMax))
?>

And reading it it look slike if you have 0 as the max lap to start voting, the last part check if the lapsdone is less than or equals to 0 and so allows the vote on lap 1.

I'll modify the logic in the binary for the next update.
Krayy
S2 licensed
I think the brackets are optional, but yes for readability I would put them there.

BTW:

OnAcceleration( $userName );
OnAngleVelocity( $userName );
OnAuthAllowed( $userName );
OnAuthNotAllowed( $userName );
OnAuthReached( $userName );
OnBeginPit( $userName );
OnBeginPitWindow( $userName );
OnButtonFunction( $userName, $SubT );
OnCarReset( $userName );
OnChangePos( $userName, $lastPos, $currPos );
OnChangeTyres( $userName, $FL_Changed, $FR_Changed, $RL_Changed, $RR_Changed );
OnConnect( $userName );
OnDisConnect( $userName );
OnDistDone( $userName );
OnDriftLap( $userName );
OnDriftPB( $userName );
OnDriftResetScore( $userName );
OnDriftScore( $userName );
OnDriftTooLow( $userName );
OnEndPit( $userName );
OnEndPitWindow( $userName );
OnEnterPitLane( $userName, $reason );
OnExitPitLane( $userName );
OnFalseStartL1( $userName );
OnFalseStartL2( $userName );
OnFastDriveOnPitL1( $userName );
OnFastDriveOnPitL2( $userName );
OnFinish( $userName );
OnFlood( $userName );
OnGoodDrift( $userName );
OnIdle1( $userName );
OnIdle2( $userName );
OnLap( $userName );
OnLapperStart( );
OnLeaveRace( $userName );
OnMaxAllowedLapTime1( $userName );
OnMaxAllowedLapTime2( $userName );
OnMaxCarResets( $userName );
OnMaxFastDriveOnPit( $userName );
OnMaxNbInStunt( $userName );
OnMaxSessionLaps( $userName );
OnMSO( $text, $userName );
OnNameChange( $userName, $oldNickName, $newNickName );
OnNewGapPlayerBefore( $userName, $split );
OnNewGapPlayerBehind( $userName, $split );
OnNewPlayerJoin( $userName );
OnNotMatchFlags( $userName );
OnNotPitWindow( $userName );
OnPB( $userName );
OnPBQual( $userName );
OnPit( $userName );
OnPracStart( $NumP );
OnQualStart( );
OnRaceEnd( );
OnRaceStart( $NumP );
OnREO( $NumP, $ReqI, $currRaceOrder );
OnResult( $userName, $flagConfirm );
OnRotateCar( );
OnRotateTrack( );
OnSpbLast( $userName );
OnSpbSplit1( $userName );
OnSpbSplit2( $userName );
OnSpbSplit3( $userName );
OnSplit1( $userName );
OnSplit2( $userName );
OnSplit3( $userName );
OnSwearWords1( $userName );
OnSwearWords2( $userName );
OnToLowHandicap( $userName );
OnVoteEndChange( );
OnVoteEndReach( );
OnVoteEndZero( );
OnVoteQualifyChange( );
OnVoteQualifyReach( );
OnVoteQualifyZero( );
OnVoteRestartChange( );
OnVoteRestartReach( );
OnVoteRestartZero( );
Krayy
S2 licensed
Oh where to start...

Back in the bad old days of strongly typed languages, BASIC interprters ruled the earth and confused bedroom programmers all around the world with their subtle differences between Subroutines and Functions. In laymans terms a Sub (optionally) took some parameters and did some black magic with them and a Function (optionally) took some parameters and did some black magic and then told you what it did via a return value.

This odument iwll only talk about Subs and not Events. The definitions and parameters for the Events are predefined in lapper and cannot be changed. I have attached a handy reference to this post for you.

A GLscript Sub can do either of these scenarios so we don't have to worrry about whether we declare a particular piece of code as a Sub or Function. So with that history lesson out of the way, how the heck do we use them?

Glad you asked...firstly, let's talk about what types of Subs GLscript has...User Defined and Internal (these aren't the names that Gai uses for them it's just so that I can make a distinction. He probably calls them Peter and Mary, or Pierre and Marie, he being of the French/Italian persuasion).

A User Defined Sub is one that you create and then call directly from within your script, e.g:

<?php 
Sub NoParams 
() # A Subroutine that takes no parameters
    
privMsg ("We don't need no steeken parameters");
EndSub
...
    
privMsg ("I'm calling a Sub now");
    
NoParams;
    
privMsg ("I'm back! Let's go to the pub!");
...
?>

So in the code above, you create a Sub called NoParams and then you explicity call it from somwhere else in your script and it goes about it's business then returns to where you called it from.

An Internal Sub is one that you create the code for and the Lapper calls it from somewhere else, usually when you click a button:

<?php 
# This sub is called by someone clicking on a button
Sub ClickedOn $KeyFlags$id )
    
privMsg "Button clicked was " $id);
    IF (
$KeyFlags 1)
    
THEN
        privmsg 
("Left mouse click");
    ELSE
        
privmsg ("Right mouse click");
    ENDIF
EndSub

...
  
openPrivButton (MyButton50,50,11,8,1,-1,32,"Click Me"ClickedOn);
...
?>

When you click on the button, Lapper will then run the Sub called ClickedOn and pass it 2 parameters, $KeyFlags and $id. $id is simple enough, it's the name of the button which in this case is MyButton.

$KeyFlags is a little more tricky in that it is an integer (whole number) that will corresond to a value that is defined in InSim as:

<?php 
// CFlags byte : click flags

#define ISB_LMB            1        // left click
#define ISB_RMB            2        // right click
#define ISB_CTRL        4        // ctrl + click
#define ISB_SHIFT        8        // shift + click
?>

So if you right click on a button, $KeyFlags will be 2. If you left click while holding the Ctrl key it will be 5. If you left click while holding the Ctrl and Shift keys it will be ummm...8 plus 4, carry the 5, add 3 subtract the age of my dog...13! yeah, thats it. I'm sure it is. Easy huh?

Note: Have a look at my CIF module for handicap configs which has some interesting ways of handling those 2 parameters, as I use an underscore to separate parts of the button name that I can then use to bury other variables in, like the button number or racer UCID.

Coming up...we take a closer look at passing parameters, return values and does being able program actually make you more attractive to the ladies? (or men if you prefer, who am I to judge?)

So where we? Oh yes, parameters and return values. Take the code below:

<?php 
Sub TwoParams 
$param1$param2# A Subroutine that takes no parameters
    
privMsg ("I have 2 parameters " $param1 " and " $param2);
EndSub
...
TwoParams "foo""bar");
...
?>

This defines a Subroutine that takes 2 parameters and just prints them out. It doesn't matter what the parameter names are, you can use whatever you like but I prefer to use names that are significant to the purpose that they are to be used for.

Now this code:

<?php 
Sub UserIsAdmin
($userName)
    IF ( 
UserIsServerAdmin$userName ) == ||  GetPlayerVar($userName,"UCID") == ||  UserInGroup"superusers",$userName) == )
    
THEN
        
return(ToNum(1));
    ELSE
        return(
ToNum(0));
    ENDIF
EndSub
?>


Actually does something useful (I just cut & pasted this from the utils.lpr as it's Friday afternoon and I'm getting tired). It takes someones user name as a parameter and then uses that to see if the user is and administrator and then returns either a 1 or a 0. You can either call it and use it return value to populate a variable like this:

<?php 
$IsAdmin 
UserIsAdmin("krayy");
?>

or use it directly in the code like this:

<?php 
IF ( UserIsAdmin("krayy") == )
THEN
privMsg 
("Krayy is a god");
ELSE
privMsg ("No he isn't");
ENDIF
?>

Just remember that a return code can be a number or a string, although i have never tried an array...I'll save that for another thread.

Top tip: Look at other peoples code, particularly things like the utils.lpr as it has some easy to read examples of this sort of thing.

Good luck all!!
Last edited by Krayy, .
Krayy
S2 licensed
Quote from Yisc[NL] :I've tested !t2 and !t8 and both seem to be working as intended.
I've used the code posted by sinanju in several places but it's always returning 0

For example in the OnConnectClose event:


Sub OnConnectClose( $KeyFlags,$id )
closePrivButton("welc&pos&clos&ref");

$list = GetListOfPlayers("N");
$count = arrayCount( $list );

dumpVar ($count);
EndSub


Well I can see your problem...you're using dumpvar to try and dump an integer. arrayCount returns a simple integer and stores it in your variable ($count in your case). If you want to see what the value of $count is, then just user privMsg.
Krayy
S2 licensed
The files admin1.txt adn admin2.txt are not part of the standard distribution so may be part of a custom lpr file. Do a text search and find out which file they are in and look to changing the code to use the UserIsAdmin function to check in they are an admin.

To check the user_array issue I need to see the code surrounding it as without context (i.e. what is setting it) there is no reference point
Krayy
S2 licensed
Quote from Yisc[NL] :Even with Lapper 6.0.1.3 the count still produces a 0 as output.
Logfile doesn't give any errors.

Can you post the entire sub function you're using....also check out my test.lpr module below that I use to test different functions, particularly !t2 and !t8
Krayy
S2 licensed
Quote from sinanju :Looks like you've been busy!

Well done. Glad to see lapper still being updated.

Just had very quick look thru things and in the LFSLapper.lpr file, you've duplicated the Event OnButtonFunction - first one has the debug part commented out.

Noted. Thanks for the feedback
RELEASE: LFSLapper 6.0.1.4 (closed)
Krayy
S2 licensed
I have removed the zip file as I have no time to maintain the app since I have started anew job and also my clan has stopped racing LFS. We may restart IF v3 ever comes to light, however until then, it's been good fun.
Hi all,

Here's the latest incremental update to Lapper that contains a few new functions and some bug fixes that are listed in the changes.txt file.

WARNING: This update includes additional functions that must be present in the LFSLapper.lpr file, so if you have customised your main file, see the upgrading from 6012 file in the docs directory for how to hand edit those customisations otherwise it will break.

In order to make this version more stable, I have decided to make this a more bare bones installation, moving a number of lesser used modules into the "optional" include directory. The modules in there may require some extensive rewrites for them to be 100% stable.

NOTE: A lot of the web based functions need a valid PubIDK, so get one issued on LFS World and put it into the MyInc.lpr file.


CIF is there for a lot of functions like setting handicaps (!hc), member status and permissions (!ma) and a replacemnt for !top, but a number of the included modules are still beta as I don't have a lot of time to take them to their conclusion. use what you want and comment out the rest in the addonsused.lpr

As per Gai's release thread:


<?php 
Special thank
's

The original program was written by MonkOnHotTinRoof. I had his  permission to maintain and develop it because it stopped the  development. Thank'
s a lot Monkter for your initial prog ;)

Dev Team
Gai
-Luron Coder
Krayy 
Additional Code and Scripts
Yisc
[NL] : Support Script Coder

This program is free software
you can redistribute it and/or modify
    it under the terms of the GNU General 
Public License as published by
    the Free Software Foundation
either version 3 of the License, or
    (
at your optionany later version.

    
This program is distributed in the hope that it will be useful,
    
but WITHOUT ANY WARRANTYwithout even the implied warranty of
    MERCHANTABILITY 
or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General 
Public License for more details.

    
You should have received a copy of the GNU General Public License
    along with this program
.  If notsee <http://www.gnu.org/licenses/>.
?>

Warning:This has been put together fairly quickly, so any issues, let me know and I'll try to set them right as soon as possible. Treat this as a beta until you have ported your Lapper.lpr mods and please don't try to just drop your current lapper.lpr file in here, as you need the extra functions defined (see note above).

Good luck all.

This version should be more compatible with Mono as that is what it is compiled under

Bugs squashed
* Error on player disconnect due to OnDisconnect event being triggered prior to removing players UCID from connection list
* Removed forcing distToDo to be a minimum of 100
* Fixed issue with OnFastDrivePits
* Some spelling errors
* General tidy up of sapcing in LFSLapper.lpr
* Added code for "isNum" function to test if a value is a valid number (fix race_duration)

(Also, I've started adding subversion numbers on the zip file so I know where I'm up to)

* Added Gai Luron's extra code to handle the new InSim code for queueing packets
Last edited by Krayy, . Reason : Added new zip file in
Krayy
S2 licensed
Quote from sinanju :Is it possible to have a button appear for less than one second, or does time need to be an integer?

I've tried things like 0.5 and ToNum( 0.5) and also $RTime = round( RandomNum( 0.4,0.6 ),1);, but all throw up an error.

The button code always expects a whole number so unfortunately there is no way to "flash" a button for less than a second.
FGED GREDG RDFGDR GSFDG