View Full Version : Requests
Gai-Luron
17th May 2009, 15:36
Hello,
If you have a request for LFSLapper improvement put here yours ideas.
Please when you put a request, tell me why you want this. It's more easy to me to find a way to solve the request.
Gai-Luron
[d9]
10th June 2009, 20:06
hallo,
ok, i am the first one :)
there are few (imo) basic things, which lapper does not have atm, and i miss them:
- configurable columns in !top lists - nickname, username, time, splits, date
- AIs detection and prevention of making them the stats + simple management (possibility to blocking them)
- actions for racers removing or swapping position of other racers on entry screen ... like ctra/airio
- !cancel command for admins/moderators (defined user groups) - stopping of restart/qualify countdown eventually to cancel of kick/ban vote (different command eg. !cancelvote or same command with intelligent behaviour for both situations) ... inspired by zion manager
- blue flag management + actions ... like airio
- custom grid building on restarts (depend on session pb/server pb/lfsw pb etc.) ... like airio/ctra
- possibility of use of mutliple groups of admins/mods - eg. !kick commnd (power users+mods+admins), !ban command (mods+admins), !track command (admins)
- racer cautions system (1 more column in database?) - penalty points, some maight be automatic (with d/t/30/45 penalties, collisions under blue flags, used shortcuts, reversed driving, kick count...etc.), some given by admins/mods
+ actions - eg. when someone reaches 100 penalty points > ban 10 days or so... or used for local racer's rating ... inspired by iracing
...
this is all atm,
critic comments welcome,
thanx gai for development,
d9
Gai-Luron
10th June 2009, 21:14
Hello,
Thank's for your post
;1182650']
- AIs detection and prevention of making them the stats + simple management (possibility to blocking them)
LFSLapper don't work with AI :)
...
;1182650']
- possibility of use of mutliple groups of admins/mods - eg. !kick commnd (power users+mods+admins), !ban command (mods+admins), !track command (admins)
Already exist. Group of User. Infinite number of Group. Take a look on onMessage event to view simple use.
;1182650']
- blue flag management + actions ... like airio
...
- !cancel command for admins/moderators (defined user groups) - stopping of restart/qualify countdown eventually to cancel of kick/ban vote (different command eg. !cancelvote or same command with intelligent behaviour for both situations) ... inspired by zion manager
Can you explain more. I don't know how work airio. No time to install it :(
;1182650']
- custom grid building on restarts (depend on session pb/server pb/lfsw pb etc.) ... like airio/ctra
Already in Todo List ;)
Thank's for your idea. i put this ideas on todo list ;)
Gai-Luron
Tim NL
10th June 2009, 21:52
Hi,
A small request.
Its now posible to move users in a group with MoveUserToGroup() and remove a user from a group with RemoveUserFromGroup().
But i also like a new GLScript function that remove all users from a group. Something like RemoveAllUsersFromGroup() or EmptyGroup().
Originally Posted by [d9]
- custom grid building on restarts (depend on session pb/server pb/lfsw pb etc.) ... like airio/ctra
Already in Todo List
Thank's for your idea. i put this ideas on todo list
Cool Thanks this will be great.
Is it then also posible to leave a place on the grid open?
Example: 1st place a player, 2nd place empty ,3rd to last place the rest of the players.
Thanks in advance
Andy King
11th June 2009, 12:50
Hi All,
Lapper to backup database files at a specified day/time using RegisterScheduledAction Command.
[d9]
11th June 2009, 19:01
hallo,
thanx for response!
Hello,
Thank's for your post
LFSLapper don't work with AI :)
Gai-Luron
this is future request :)
...
Already exist. Group of User. Infinite number of Group. Take a look on onMessage event to view simple use.
oh, i meant combinations of different user groups with one command. i am sorry if thats works already - i am not familiar with newest lapper
Can you explain more. I don't know how work airio. No time to install it :(
basically - driver with blue flag is informed about it with msg (like: "you are under blue flag, give way to [d9], dist. 50m", after 5 secs: "you are under blue flag, give way to [d9], dist. 10m")...
and i saw also configuration when distance is decreasing with some speed or to specified limit - probably to 1 meter or so and blue flag stills for couple of soconds - action is executed > spectate the driver if he does not wnat to let pass the overlapper
best regard
d9
[d9]
11th June 2009, 19:04
Is it then also posible to leave a place on the grid open?
Example: 1st place a player, 2nd place empty ,3rd to last place the rest of the players.
Thanks in advance
hehe, this is oportunity for "newcommers" to join there :D
Tim NL
11th June 2009, 20:51
;1183434']hehe, this is oportunity for "newcommers" to join there :D
lol :)
I was trying to create something to start a race with a rolling start.
The idea was that the safety car is on pole and driven by a admin. second place is empty, and 3rd to the last is everyone who is racing is order of the qual. I dont know if this is posible but it sounds great :D.
I did a race on iracing on a oval with a rolling start and it was really great:D
[d9]
11th June 2009, 21:46
lol :)
I was trying to create something to start a race with a rolling start.
The idea was that the safety car is on pole and driven by a admin. second place is empty, and 3rd to the last is everyone who is racing is order of the qual. I dont know if this is posible but it sounds great :D.
I did a race on iracing on a oval with a rolling start and it was really great:D
i think its possible if insim app can watch this empty space and spectates everyone who tries to join or if momentary reduces /carsmax variable.
+ remember, there is also track/s with 3 cars in row - bl2 :)
Drift King CZ
14th June 2009, 13:11
Hi. http://www.lfsforum.net/showthread.php?t=58444
[d9]
21st June 2009, 13:43
hallo,
i found good reference and source of inspiration...
app cals lfs2day (same as server where is running) developed by misha_nl...
in local/lfsw statisctics and administration backend honesly not comparable with anything i ever saw.
check screenshots, especially nr. 6 - connected players list with management.
shortly:
- lfsw statistics tables
- sectors statistics tables
- navigation in statistics tables - previous, next, track, car, filter...
- connected players array with status, AIs detection
- possibility to use input requesters - messages, nr. of laps... - short way to use it also as saved reports to admins, passwords... - like ctra...
- ban list management
regards!
d9
86956
86957
86958
86959
86960
86961
Yisc[NL]
25th June 2009, 12:27
I have a small request.
When the Lapper-console give and error, the number of the line with the error is shown.
It would be very useful when the line itself is displayed to.
The reason behind this is that when you include scripts, the line number isn't matching the actual scripts since lines are added in between the existing code.
Gai-Luron
25th June 2009, 13:20
I corrected bug in last release about line error number. Do you use this last release.
If yes, give me an exemple and how i can reproduce it to fix. Normally, i don't want display error in console, because use of LFSLapper on dedicated host without screen display. it's for this, i create errorlog file
Gai-Luron
Yisc[NL]
25th June 2009, 13:50
I corrected bug in last release about line error number. Do you use this last release.
If yes, give me an exemple and how i can reproduce it to fix. Normally, i don't want display error in console, because use of LFSLapper on dedicated host without screen display. it's for this, i create errorlog file
Gai-Luron
Yes, I do use the latest release (5.843) so that shouldn't be a problem.
I made the language engine for the pitboard which is at the bottom of the Pitboard-script and made the following error:
pitboard_test_position="^3Test position";'
As you see there's a ' at the end of the line.
Lapper told me there was an error in line 347 (if I remember well) and said it had to do with a ' in that line. But when I took a look at the main LPR-file, line 347 was a blanc line so that can't have any errors. Since the parts of the Pitboard are incorporated into the main LPR-script, the line numbers are increasing but you haven't got a clue how much and where exactly.
Gai-Luron
25th June 2009, 16:47
Ok, i take a look ;) when i receive your file already partially done
Gai-Luron
Starbert
25th June 2009, 21:33
I would really like an option to force a starting grid from the !top list, where lapper looks at the !top list and compares it to the racers online at the moment. Then it sets the startinggrid accordingly, looking at the fastest laptime for every racer. If a racer has two laptimes in the list (combined race with different cars) then the fastest time will count.
Krayy
6th July 2009, 03:13
Here's an idea for an improvement and also a request for the best way to do it in our install:
We have a mix of beginner and experienced racers and want to enable car reset, but for only a certain number of times per race, and when a racer does reset, to flag a penalty.
Now the most obvious way to do this is to write a handler in managePacket.cs for a CRS events and a hook in loop.cs then process it from there. I would most likely put an entry in the LFSLapper.lpr to set the type of penalty (stop/Go, Drive Through, 30 secs etc) and the number of resets allowed per race.
The question is whether this is the only way, or can it be done via a plugin so that we don't exclude ourselves from future releases?
Fire_optikz001
7th July 2009, 13:05
Is it possible to make addusertogroup to actually add a user to the file ex lets say i wanted to make a command like !hireadmin fire_optikz001 it will actually add me to the admin.txt file and also removuserfromgroup actually remove the user frome it ex. !fireadmin fire_optikz001
Fire_optikz001
20th July 2009, 07:16
LFSLapper don't work with AI :)
ok so i had my ai racing for me and it put my username instead of his so it somewhat detects them i think it would benice to work with ai's
Gai-Luron
20th July 2009, 11:26
Hello,
The problem is that AI have same username as you, and PB are stored relative to username and no nickname
Gai-Luron
Fire_optikz001
20th July 2009, 14:40
oh ok i was just wondering
XD watching AIs drift is so funny
my pb is up to 16k with 3 AIs XD
EDIT:
_________________________________________
[SC]™T3ŠahŽmy made new PB: 18955 pts!
^^^3 AI's^^^
Krayy
22nd July 2009, 23:00
Hiya,
As people seem to be posting snippets from their LFSLapper.lpr files on these forums, do you think it might be a good idea to move the $PubStatIdk variable into the config.ini file for added security?
Then we don't have to worry about people posting .lpr files to public forums.
sinanju
24th July 2009, 15:21
At the moment, $LastDriftScore appears to give you a total number of points once a drift is completed.
Is it possible for the score to update and show every 1/1000th (or 1/100, or whatevers smallest time period is available to measure) instead?
And.
The same for the $AngleVelocity variable?
And!
What about just an $Angle variable (absolute angle/yaw?) to make your own scoring expression (e.g. $Angle * InstantSpeed * $Time = Score [although '$Time' would have to be new variable too - in 1/1000's?])?
Krayy
12th September 2009, 22:06
Is it possible to make addusertogroup to actually add a user to the file ex lets say i wanted to make a command like !hireadmin fire_optikz001 it will actually add me to the admin.txt file and also removuserfromgroup actually remove the user frome it ex. !fireadmin fire_optikz001
Done... http://www.lfsforum.net/showthread.php?t=61328
Fire_optikz001
13th September 2009, 22:31
mass server message
i was wondering if there was a way to make a command like !msm that works like cmdlfs in the command prompt is there a way to do this?
Yisc[NL]
13th September 2009, 22:51
mass server message
i was wondering if there was a way to make a command like !msm that works like cmdlfs in the command prompt is there a way to do this?
I'm not 100% sure I understand your question, but here's some code I made a while ago:
Event OnMSO( $text ) # Player event
SWITCH( $command )
CASE "!msg":
IF( UserInGroup( "admin", $userName ) == 1 )
THEN
openPrivButton( "send_msg",52,0,48,5,5,-1,32,"^3Click to resend message: &" .GetCurrentPlayerVar ("message"),rcm_msg );
openPrivButton( "write_send_msg_bg",100,0,48,10,5,-1,32,"" );
openPrivTextButton( "write_send_msg",100,5,48,5,5,0,"^3Write message and click OK (max. 50 characters)","^2Click to type and send a message",50,rcm_written_msg );
openPrivButton( "close_msg",148,0,10,10,5,-1,32,"^1X",close_msg );
ELSE
privMsg( "^1You are not allowed to open that");
ENDIF
BREAK;
ENDSWITCH
EndEvent
Sub rcm_written_msg ( $message )
SetCurrentPlayerVar ("message", "^2".$message);
cmdLFS ( "/rcm ^2" . $message );
cmdLFS ( "/rcm_all" );
openPrivButton( "send_msg",52,0,48,5,5,-1,32,"^3Resend message: &^8" .GetCurrentPlayerVar ("message"),rcm_msg );
EndSub
Sub rcm_msg ( $KeyFlags , $argv )
cmdLFS ( "/rcm ^2" . GetCurrentPlayerVar ( "message" ) );
cmdLFS ( "/rcm_all" );
EndSub
Sub close_msg ( $KeyFlags , $argv )
closePrivButton ( "send_msg&write_send_msg_bg&write_send_msg&close_msg" );
EndSub
goldwing
7th October 2009, 19:59
A good thing and (i think) not too hard to code would be a command to force track/car rotation like !rotate with a random rotation.
loconstant
16th October 2009, 13:03
Hello my old friend Gai-Luron :),
I am now in this version, and I have a small "big" request.
All default Event, are defined in the LFSlapper.lpr main file, and we can overwrite them in our includes.
I do not like to modify default files, and I would like to keep all customization in my own lpr without loosing default or "new release" default modification in the LFS Lapper.
Is it or would it be possible to have an implementation which allow to call back default event:
Here is an example:
LFSLapper.lpr:
Event OnLapperStart ()
do 1;
do 2;
etc..
End of Event
and my own lpr
Event OnLapperStart () #overwrite of default
LFSlapper.OnLapperStart();
do my own 1
do my own 2:
etc;
endofEvent
this execute first the default content and then my own additional code.
Thanks,
Loco
Fire_optikz001
17th October 2009, 02:06
;1261275']I'm not 100% sure I understand your question, but here's some code I made a while ago:
Event OnMSO( $text ) # Player event
SWITCH( $command )
CASE "!msg":
IF( UserInGroup( "admin", $userName ) == 1 )
THEN
openPrivButton( "send_msg",52,0,48,5,5,-1,32,"^3Click to resend message: &" .GetCurrentPlayerVar ("message"),rcm_msg );
openPrivButton( "write_send_msg_bg",100,0,48,10,5,-1,32,"" );
openPrivTextButton( "write_send_msg",100,5,48,5,5,0,"^3Write message and click OK (max. 50 characters)","^2Click to type and send a message",50,rcm_written_msg );
openPrivButton( "close_msg",148,0,10,10,5,-1,32,"^1X",close_msg );
ELSE
privMsg( "^1You are not allowed to open that");
ENDIF
BREAK;
ENDSWITCH
EndEvent
Sub rcm_written_msg ( $message )
SetCurrentPlayerVar ("message", "^2".$message);
cmdLFS ( "/rcm ^2" . $message );
cmdLFS ( "/rcm_all" );
openPrivButton( "send_msg",52,0,48,5,5,-1,32,"^3Resend message: &^8" .GetCurrentPlayerVar ("message"),rcm_msg );
EndSub
Sub rcm_msg ( $KeyFlags , $argv )
cmdLFS ( "/rcm ^2" . GetCurrentPlayerVar ( "message" ) );
cmdLFS ( "/rcm_all" );
EndSub
Sub close_msg ( $KeyFlags , $argv )
closePrivButton ( "send_msg&write_send_msg_bg&write_send_msg&close_msg" );
EndSub
ok u know you know in the exe u type cmdlfs (msg)? and it sends it to all the server insim is connected to? well i wanna do that from inside lfs with a command u have any idea?
i was thinking of some type of lapper addon would work :)
Yisc[NL]
17th October 2009, 10:13
ok u know u=in the exe u type cmdlfs (msg)? welli wanna do that from inside kfs with a command u have any idea?
i was thinking of some type of lapper addon would work :)
Please try to write normal english since it's very hard to understand what you want to say.
The code I posted can be accessed within Lapper by writing !msg which brings up a box to type a text and send it to all players as an RCM.
Fire_optikz001
17th October 2009, 17:36
now look at it
loconstant
30th October 2009, 13:58
Hello,
Is there a way to catch the end of race event?
I am not talking about the onResult.
I need really the End for the server, not the player.
Thanks,
Loco
Gai-Luron
30th October 2009, 14:54
There is not end of race in LFS. Just start new race or qualify. One reason is that a player can never pass the finish line if he want.
LFS never end a race. i hope i'am clear
Gai-Luron
loconstant
30th October 2009, 16:01
Thx,
On what do you base the time for the automatic restart ?
Is it the finish(onResult) for the first one which cross the line?
Loco
Bass-Driver
30th October 2009, 16:29
Thx,
On what do you base the time for the automatic restart ?
Is it the finish(onResult) for the first one which cross the line?
Loco
Event OnFinish
DelayedCommand( 30, Restart );
EndEvent
Sub Restart()
cmdLFS ( "/restart" );
EndSub
loconstant
30th October 2009, 17:42
Hi Bass-Driver,
thanks but this is not what I am looking for.
I think the onFinish is not for a race but for the global event finish.
I just need to know when you activte the autorestart: when the time start for the delay.
Cheers
Bass-Driver
30th October 2009, 18:39
Hi Bass-Driver,
thanks but this is not what I am looking for.
I think the onFinish is not for a race but for the global event finish.
I just need to know when you activte the autorestart: when the time start for the delay.
Cheers
so if i understand what u mean
u want start with a ! command like for example : !startdelay
??
loconstant
31st October 2009, 09:21
Thanks Bass, I changed my mind, and tried to use cmd LFS instead of embedded Lapper restart function.
So I insert, my restartAutoMain() in my onResult. BUT the automatic LFSLapper rotateTrack does not work anymore. Is there some incompatibilities with cmdLFS ( "/restart" ); ??
Sub restartAutoMain()
privMsg( "Test" );
DelayedCommand($restart_A-15, restartAutoDisplay);
DelayedCommand($restart_A, restartAuto);
EndSub
Sub restartAuto()
cmdLFS ( "/restart" );
EndSub
Sub restartAutoDisplay()
openGlobalButton ("test",70,100,60,20,4,15,16,"^7Restart in (%cpt%) second(s)");
EndSub
Cheers
Bass-Driver
31st October 2009, 10:06
Thanks Bass, I changed my mind, and tried to use cmd LFS instead of embedded Lapper restart function.
So I insert, my restartAutoMain() in my onResult. BUT the automatic LFSLapper rotateTrack does not work anymore. Is there some incompatibilities with cmdLFS ( "/restart" ); ??
Sub restartAutoMain()
privMsg( "Test" );
DelayedCommand($restart_A-15, restartAutoDisplay);
DelayedCommand($restart_A, restartAuto);
EndSub
Sub restartAuto()
cmdLFS ( "/restart" );
EndSub
Sub restartAutoDisplay()
openGlobalButton ("test",70,100,60,20,4,15,16,"^7Restart in (%cpt%) second(s)");
EndSub
Cheers
are u sure that u have $EnableRotation = true;
cmdLFS ( "/restart" ); works the same as /restart
i dont have time now to test the code sry
i will test it after a few hours
this is what i have but then for another command
i have edit it for u
i think it works the same but the code is differend
#################
#Event OnResult#
#################
Sub racerestart1
openGlobalButton( "racerestart",1,90,24,5,1,-1,16,"^7 RACE RESTART IN ");
openGlobalButton( "racerestartcounter1",1,95,24,20,1,1,0,"^7 15",racerestart);
EndSub
Sub racerestart($KeyFlags,$id)
closePrivButton("racerestartcounter1");
openGlobalButton( "rcrestartcounter2",1,95,24,20,1,14,0,"^7 %cpt% ", endracerestartcounter );
EndSub
Sub endracerestartcounter($KeyFlags,$id)
closePrivButton("racerestartcounter1&racerestartcounter2&racerestart");
cmdLFS ( "/restart" );
EndSub
loconstant
31st October 2009, 10:27
Thanks,
But no need to test.
There is incompatibility, rotate only work with AutoRestartRaceSec.
As sson, I disable it, rotate does not work.... :(
Bass-Driver
31st October 2009, 11:11
Thanks,
But no need to test.
There is incompatibility, rotate only work with AutoRestartRaceSec.
As sson, I disable it, rotate does not work.... :(
oh ok
thx for report
because i dont use rotate track,
but i want use it in future with the code i gived u in the post above.
loconstant
31st October 2009, 12:24
Gai-Luron: if you are around here :razz:
I have an issue, you provided me a beta version but I do no have the src.
I would need a way to use the same piece of code you have in the loop.cs
if (newCfg.varsLapper.RotateCars != "")
{
SendMsg("/cars=" + tmpCars[currRace.currRotateCar]);
newCfg.executeFunction("OnRotateCar", null, null);
RestartTimer();
}
if (newCfg.varsLapper.RotateTracks != "")
{
SendMsg("/track=" + tmpTracks[currRace.currRotateTrack]);
newCfg.executeFunction("OnRotateTrack", null, null);
}
and call it from my lpr file. Is it possible?
Thax,
Loco
loconstant
31st October 2009, 14:17
Hello,
I think having "setlappervar" would be nice in fact :thumb:
Loco
loconstant
1st November 2009, 10:52
Thanks to Gai-Luron, I had a beta version which solved my issue.:thumb:
Fire_optikz001
7th November 2009, 16:43
hi i was wondering if there was a scheduled event for certain players
or a way to add one
Krayy
10th November 2009, 22:02
Now that GLScript can pass arrays back to your lapper scripts, is there any chance of modifying the GL function "split" to return a multi value array that's split on the splitChar instead of a single string?
Gai-Luron
10th November 2009, 22:49
Hello,
Can you give me an example, i don't understand what you say :shy:
Krayy
10th November 2009, 23:04
Hello,
Can you give me an example, i don't understand what you say :shy:
Currently if I have a list with a know separator, you need to iterate through a number of splits to process all items in that list. i.e:
$racers = 4aged,krayy,kumarakid,steala;
$IsNotBlank = 1;
$GroupIndex = 0;
WHILE ($IsNotBlank == 1)
$racer=split( $racers,",",$GroupIndex );
IF ( $racer!= "") THEN
privMsg ($racer);
$GroupIndex = $GroupIndex + 1;
ELSE
$IsNotBlank = 0;
ENDIF
ENDWHILE
if we were able to conver that string to an array like the .NET split function does, then we can use the FOREACH loop:
$racers = 4aged,krayy,kumarakid,steala;
FOREACH( $racer IN split( $racers,","))
privMsg ($racer);
ENDFOREACH
Krayy
11th November 2009, 00:17
sort of like this....
GLScript.cs:
case "splittoarray":
if (nbArgs != 2)
throw new GLScriptException("Incorrect args number in function " + val.nameFunction);
val.typVal = GLScript.typVal.setOfVar;
val.setVars = new GLScript.SetOfVars();
string tmpSc = (string)args[1];
char splitChar = tmpSc[0];
string[] splited = (args[0] as string).Split(splitChar);
for (int i = 0; i < splited.Length; i++)
{
val.setVars.Set(i.ToString(), new unionVal(0, "\"" + splited[i] + "\"", typVal.str));
}
return;
LFSLapper.lpr:
CASE "!ta":
$Racers = "gul,4aged,krayy,kumarakid,steala";
$RacerList = SplitToArray($Racers, ",");
dumpvar($RacerList);
FOREACH ( $ra IN $RacerList )
# Do something with the entire list of vars like check membership etc
privMsg ( $ra["value"] );
ENDFOREACH
BREAK;
Gai-Luron
11th November 2009, 09:58
Okay :D, when i read split, i think about LFS splitting, not the split command. It's for this i don't understand what you say.
You are rigth, i do it ASAP : SplitToArray
Thank's
Gai-Luron
Andy King
18th November 2009, 21:21
Hi All,
Lapper to backup database files at a specified day/time using RegisterScheduledAction Command as I destroyed database and only had a 2 month old backup.
Also would like to see LFSLapper with its very own icon.
Fire_optikz001
18th November 2009, 21:44
Also would like to see LFSLapper with its very own icon.
i added one to Mine :D
Andy King
29th November 2009, 14:57
Hi All,
Lapper to backup database files at a specified day/time using RegisterScheduledAction Command as I destroyed database and only had a 2 month old backup.
Hi Gai, can you take a look at Lapper backing up its own Database please, also is it possible to have a new Event so if a driver types a !command thats not recognised by Lapper then they get a message back saying INVALID COMMAND - TYPE !help FOR ALL COMMANDS like FIRE created.
Thanks
Fire_optikz001
29th November 2009, 16:39
Hi Gai, can you take a look at Lapper backing up its own Database please, also is it possible to have a new Event so if a driver types a !command thats not recognised by Lapper then they get a message back saying INVALID COMMAND - TYPE !help FOR ALL COMMANDS like FIRE created.
Thanks
that would be default :)
DEFAULT:
$NotCommand = StrLen( "!" );
$NotCommandStrip = substr( $text,0,$NotCommand );
IF( $NotCommandStrip == "!" )
THEN
privMsg( "^1Invalid Command! ^7Please Look At ^2!Help ^7For Commands!" );
ENDIF
BREAK;
oh nvm :P
Gai-Luron
29th November 2009, 16:53
You can't do that because you can have catched event onMso. you can do that adding a globalvar. $commandFinded = 0 and set to 1 when command is findin script. Then catch OnMso event in a last include named lastMso.lpr and test this valueif it's 1 or 0. In fine there is no elegant way to do that due to catchevent feature
Gai-Luron
Andy King
29th November 2009, 17:53
You can't do that because you can have catched event onMso. you can do that adding a globalvar. $commandFinded = 0 and set to 1 when command is findin script. Then catch OnMso event in a last include named lastMso.lpr and test this valueif it's 1 or 0. In fine there is no elegant way to do that due to catchevent feature
Gai-Luron
Thats exactly the issue I am having but the catchevent is brilliant so we need to keep that so perhaps you could add it as an Event Gai.
Don't forget these database backup issues as mine is huge and 3 years old so don't want to loose it so we need some sort of backup system lapper can run.
Can someone please explain in idiot language how to remove a drivers PBLaptime from database without killing it as I tried and trashed my DB or better still Gai perhaps you could create an addon for Admins to be able to remove a PB of a Driver who has cheated etc or help me create one lol
Fire_optikz001
14th December 2009, 04:08
Player scheduled event
i was wondering if there is a way to have a normal scheduled event but players can choose weather they want it to be used there should be an option that a thing cant be deactivated maybe a way to turn off a event for a certain player like when u join there will be a thing after u click accept that says scheduled events
event 1 [ON] [OFF]
event 2 [ON] [OFF]
event 3 [ON] [OFF]
[OK]
and so on
Gai-Luron
14th December 2009, 07:43
What is the scope of this option?
Please when you put a request, tell me why you want this. It's more easy to me to find a way to solve the request.
Thank's
Fire_optikz001
14th December 2009, 22:02
What is the scope of this option?
Please when you put a request, tell me why you want this. It's more easy to me to find a way to solve the request.
Thank's
well i have a clock and stuff in my info bar but if people dont want the info bar then they have the clock going and going which some people dont want :P
Tim NL
14th December 2009, 22:15
well i have a clock and stuff in my info bar but if people dont want the info bar then they have the clock going and going which some people dont want :P
You'r speaking in riddles .:Looking_a
Fire_optikz001
14th December 2009, 23:45
You'r speaking in riddles .:Looking_a ty? :homersimp
ALSO i need a event to finish cruise insim like $distToDo but i need it to do it every meter (or 100 meter) cause atm $distToDo is for driving bonus :P
maybe have $distToDoBonus and $distToDoReg
Gai-Luron
15th December 2009, 07:42
Hello,
You have an event when dist is done, then cumulate it and test with your own var $distToDo and then do action in GLScript, if i understand it's no need to have builtin LFSLapper var to do that.
You can save dist already done on disconnection of the player.
Gai-Luron
Fire_optikz001
15th December 2009, 13:52
Hello,
You have an event when dist is done, then cumulate it and test with your own var $distToDo and then do action in GLScript, if i understand it's no need to have builtin LFSLapper var to do that.
You can save dist already done on disconnection of the player.
Gai-Luron
The problem im having is if i do this:
IF( GetCurrentPlayerVar("TotDistMeter") == $distToDoRefund );
THEN
lets say $distToDoRefund = 500
it will only refund 1 time which is why i need another event... unless there is a way to make it every 500m
nvm i know how i have to do it :)
YamaSuba.NL
17th December 2009, 23:26
Searched the doc's for it, but couldn't find what I was looking for: Is there already a way to retrieve the user that did the fastest lap in a race?
If not, could this one be added?
Gai-Luron
18th December 2009, 07:44
Hello,
Yes you can do that easely with GLScript
Set a globalvar var $BestLap set to big value 60000000 at begin of race and set it on each player lap when better lap is done than this value. If this value is newed set, set an other var containing player userName. At end of race you can do with this values what you want.
Gai-Luron
YamaSuba.NL
19th December 2009, 13:55
Great tip! Should have thought of that myself... :)
It's al working now, thanks!
YamaSuba.NL
21st December 2009, 21:11
Still having some problems with this one.. ;)
I managed to get this working, but with some limitation.
Am using the saved fastest lap in the OnResult event, but this works out the wrong way when someone drives a fastest lap after the player which lap was saved has finished. In that case there are two players (or more for that matter.. :) ) with a best lap result.. Am I missing something or is the OnResult not the best suited event to do this?
Gai-Luron
21st December 2009, 21:33
Hello,
Use a delayed command to display fastest lap later.
Perhaps 2 minutes after the arrival of the first to leave time for other drivers to finish.
Gai-Luron
drew555
23rd December 2009, 16:04
Request - a depository for documentation :D
Somewhere with lists of all the usable commands and suchlike - maybe just a collection of all the documentation created for all the variations of lapper.
LFSLapper.lfs has a good one at the beginning - but it doesn't seem to cover all of the avaliable commands and variables- and what they do.
Might stop a lot of frustration for people who are brand new to lapper.
:shrug: Might be a good idea.
Gai-Luron
23rd December 2009, 17:24
Work in progress :smileypul , be patient
www.lfs-lapper.org/help/en
YamaSuba.NL
23rd December 2009, 21:49
Use a delayed command to display fastest lap later.
After somewhat of a struggle with variables I moved from the OnResult-event to the delayed Sub, I managed to get this working. Thanks for the hint!
drew555
24th December 2009, 11:44
Work in progress :smileypul , be patient
www.lfs-lapper.org/help/en (http://www.lfs-lapper.org/help/en)
I didn't know about that... Thank you :D
:thumb::thumb::thumb:
YamaSuba.NL
24th December 2009, 22:08
After somewhat of a struggle with variables I moved from the OnResult-event to the delayed Sub, I managed to get this working. Thanks for the hint!
Still having one little problem with this solution, but that's a very strange one.. ;)
I'm saving the fast lap in the OnSpbLast-event. Normally that works out OK, but there's one player on my server that seems to never enter that event. I've put some debugging /msg's at the start of that event, but these messages never appear when this player crosses the finishline, where they always are displayed when other players complete a lap.. This is kinda stupid, for I can't imagine a reason for this behaviour of Lapper.
Only thing in this player's data is that there's a space in his UserName, but I can't imagine that to be the cause...
YamaSuba.NL
27th December 2009, 11:08
I managed to solve the problem above by using the OnLap-event, but that doesn't explain why the OnSpbLast-event doesn't work for this user.. ;)
Came across another puzzle in this OnResult-delay.. Yesterday it happened twice that the commands in the delayed-Sub weren't executed when the player in question pitted before the delayed commands were executed and came out of the pit after the delay had expired. If he came back on track before expiry everything worked OK..
Could it be this delay doesn't work while in the pitbox?
Gai-Luron
27th December 2009, 11:18
It's only for one player. Or this happen for other player? if it's for one player, whati s the particularity of this player? There is a message in err log file?
YamaSuba.NL
27th December 2009, 16:06
At this moment it's a one-player problem. I'm using a delayed Sub (PrivDelayed) from within the OnResult-event.
Gai-Luron
27th December 2009, 17:23
At this moment it's a one-player problem. I'm using a delayed Sub (PrivDelayed) from within the OnResult-event.
What is his userName, delayed command is bugged in previous version, take the last version, put your code here
Krayy
27th December 2009, 19:39
I have a request that should be fairly easy to implement....
Could you please add fuinctionality to the GetListOfPlayers function to accept 1 or 2 parameters, with the second paramter being an optional array size.
When rewriting the !handicapper function I found that I had to use a globalvar to store the handicap user array, else the subfunctions would not have the same data to work from. The GetListOfPlayers function only returns an array the size of the number of players that are online, and once a GlobalVar array has been set, any further attempts to write to it cannot resize the array, hench I had to write a function to call GetListOfPlayers and iterate through it, populating the GlobalVar with NULL records until I had a 32 element array.
If I could call is like this: $HcPlayerList = GetListOfPlayers("N", 32);
then that would solve all my problems.
Thanks
the array siz
Gai-Luron
27th December 2009, 20:29
Heu sorry, but i don't understand what do you want to say.
You can resize an array adding new elements. Why you say you can't?
$MyVar = GetListOfPlayers( );
$MyVar[1] = "toto";
dumpVar( $MyVar );
if i am alone this work and add "toto" as new player
Gai-Luron
Krayy
27th December 2009, 23:33
Heu sorry, but i don't understand what do you want to say.
You can resize an array adding new elements. Why you say you can't?
$MyVar = GetListOfPlayers( );
$MyVar[1] = "toto";
dumpVar( $MyVar );
if i am alone this work and add "toto" as new player
Gai-Luron
Locals are fine, but if $MyVar is a global array, then it cannot be resized. i.e. If a player leaves, then the array will have 1 less element and the script will abort:
12/27/2009 10:21:55 PM -> Syntax error in cfg file "./handicapper.lpr" at line #60
You can't change the dimension of an array...
Function 'dohandicapper' script aborted
Gai-Luron
27th December 2009, 23:38
Wich version of LFSLapper do you use? here it work fine with this test. In older version, i correct some thing in array
EDIT Ok, i understand what you said ( i exit to my bed to write this, i had a flash :p ), this occur when you want to assign a newly GetListOfPlayer to a previous used global var, before to assign a new value don't forget to use "unset" to free var.
Sub MyTest()
GlobalVar $MyVar;
unset( $MyVar );
$MyVar = GetListOfPlayers( );
$MyVar[1] = "toto";
dumpVar( $MyVar );
test2();
$MyVar[3] = "titi";
dumpVar( $MyVar );
EndSub
Sub test2()
$MyVar[2] = "tata";
dumpVar( $MyVar );
endSub
Result in console
---- Dump of MyVar ----
$MyVar[0] = "gai-luron"
$MyVar[1] = "toto"
---- End Dump of MyVar ----
---- Dump of MyVar ----
$MyVar[0] = "gai-luron"
$MyVar[1] = "toto"
$MyVar[2] = "tata"
---- End Dump of MyVar ----
---- Dump of MyVar ----
$MyVar[0] = "gai-luron"
$MyVar[1] = "toto"
$MyVar[2] = "tata"
$MyVar[3] = "titi"
---- End Dump of MyVar ----
Krayy
28th December 2009, 00:31
Unset would work...thanks for that.
YamaSuba.NL
28th December 2009, 18:42
What is his userName, delayed command is bugged in previous version, take the last version, put your code here
The guy in question is the notorious "Mad Dog".. ;)
For the newest version I'll have to consult Dean, to have it installed at 500servers. I understand there's a lot of changed stuff in there, so I'll have to get some work done there.. I'll be feedbacking after all that is done.. :)
emit-nl
3rd January 2010, 16:58
Hello,
I have an practical idea which is pretty easy to realise.
Now we have allready 4 languages for LFSLapper and more to come, the LFSLapper.lpr file is going to be very large. I thought it might be good to remove the 'Lang ".."' sections out of LFSLapper.lpr and replace it for include( "./includes/languages.lpr");
Then put the 'Lang".."' section in the languages.lpr files.
It might be good to implement the 'Lang' sections of the files such as driftDef.lpr and driftmeter.lpr.
To make the language.lpr file easy to edit, I think the language entries of the files must not be main_...., but for driftDef.lpr, driftdef_.....
I'd like to hear your opinion about this.
If you like the idea Gai, but you don't have time for it, i can do it for you and send it :)
Greets,
Tim
Gai-Luron
3rd January 2010, 17:16
hello,
Yes it's a good idea to have a language file for LFSLapper.lpr, maybe it's also a good idea that this file have the same name as original file but with an another extension. "LFSlapper.lg". In this case, it's more easy to localize lang file for a specific .lpr file.
You have to include
include( "./includes/LFSLapper.lg");
But for small file script, it's not an obligation
You are also rigth when you say, item lang must be prefixed with file basename.
"driftdef_" for driftDef.lpr
"winnerflags_" for winnerflags.lpr
and so on
But i'am writing doc for now and i don't have time. your help was a good thing. ( last script file are in 5.9.2.0 )
Thank's
Gai-Luron
Fire_optikz001
3rd January 2010, 17:41
hello,
Yes it's a good idea to have a language file for LFSLapper.lpr, maybe it's also a good idea that this file have the same name as original file but with an another extension. "LFSlapper.lg". In this case, it's more easy to localize lang file for a specific .lpr file.
You have to include
include( "./includes/LFSLapper.lg");But for small file script, it's not an obligation
You are also rigth when you say, item lang must be prefixed with file basename.
"driftdef_" for driftDef.lpr
"winnerflags_" for winnerflags.lpr
and so on
But i'am writing doc for now and i don't have time. your help was a good thing. ( last script file are in 5.9.2.0 )
Thank's
Gai-Luron
this is what i do at the moment but its in a .lpr file i have done this since u added catch events and i started cleaning out my main lpr i moved the lang section to its own area
emit-nl
3rd January 2010, 19:28
hello,
Yes it's a good idea to have a language file for LFSLapper.lpr, maybe it's also a good idea that this file have the same name as original file but with an another extension. "LFSlapper.lg". In this case, it's more easy to localize lang file for a specific .lpr file.
You have to include
include( "./includes/LFSLapper.lg");
But for small file script, it's not an obligation
You are also rigth when you say, item lang must be prefixed with file basename.
"driftdef_" for driftDef.lpr
"winnerflags_" for winnerflags.lpr
and so on
But i'am writing doc for now and i don't have time. your help was a good thing. ( last script file are in 5.9.2.0 )
Thank's
Gai-Luron
Is it OK with you if I realise this idea and post it in here? (or in another threat? you can say..!)
Do you mean you want to have a LFSLapper.lg and also a driftDef.lg, winnerflags.lg and so on.. or just one file, LFSLapper.lg with all 'Lang' sections in it?
I think the second is the best, because you can have all language codes in one file.
It is also possible to make a language file for every language; LFSLapper_en.lg(or LFSLapper.en), LFSLapper_fr.lg, LFSLapper_nl.lg and so on.. or is this too overdone? (I think it maybe is xD)
If you agree I will fix the lang bases also. (main_..., driftmeter_..., winnerflag_...) In the language section aswell in the script.
Greets,
Tim
Gai-Luron
3rd January 2010, 20:49
I think one big file language (.lg),for LFSLapper.lpr, and language file included in all other script because there are smaller. It's not good to have many file, and it's not good to have big file. We can try to have a mixed, two file ( script + language ) for big script and one for smaller script.
emit-nl
3rd January 2010, 21:06
I think one big file language (.lg),for LFSLapper.lpr, and language file included in all other script because there are smaller. It's not good to have many file, and it's not good to have big file. We can try to have a mixed, two file ( script + language ) for big script and one for smaller script.
OK, so I'm going to make a LFSLapper.lg and a includes.lg for all other files with 'Lang' sections?
The LFSLapper.lg is coming in the bin directory and the includes.lg file is coming in the includes directory. Is this right?
If this is right, I think I will post it next weekend.
Tim
Krayy
3rd January 2010, 21:08
This also raises the pproblem of maintenance. If there is one large lang file with all the language definitions in it, then if someone changes a module to have a slightly different text, then its a global update rather than just their .lpr module. If a user wants to have a spearate file, then it is a very simple matter to just cut & paste the Lang sections of a number of lapper files out if they are kept at the end of the modules.
I agree with keeping things tidy, but in reality you should never need to move the Lang sections out of the main files for anything other than to segregate them, as it makes no operational difference to lapper.
Also, module makers should look at chnaging their language definitions to <module>_<name> instead of main_<name> to differentiate between the main lapper definitions and their custom ones. This would also aid in debugging so that we could track down any typographic errors faster.
Fire_optikz001
3rd January 2010, 22:43
i think we should only make one for the main Lapper.lpr cause that way it keeps it tidy but it does not make a diffrence to me because all my small scripts have there lang in them while the big ones hvae them seperate
Fire_optikz001
4th January 2010, 02:05
Hey gai,
you know how there is a Sub for when u enter a Zone what about when u leave?
so like
RegisterZoneAction( "Name" , "Track" , X, Y, 5, Enter Sub, Exit sub (optional) );
emit-nl
8th January 2010, 18:00
Hi everyone!
I'm finished with the ideas for language files.
I made 2 versions.. so you can choose which one you like better..
version1: Like Gai-Luron suggested it would be good. One language file for LFSLapper.lpr and one for all files in the includes folder that uses the lang-engine. The name of the files for the languages is 'languages.lg'.
version2: This is how I like it the best. There is one file for every language. The files are stored in the folder: 'includes/languages/'. The filenames are like: en_english.lg.
WARNING! I did not test it.. because I haven't that much time this week and I prommised to release it this week.
I hope it all works and you like it.
I'd like to hear which option you like the best.
Greets,
Tim
Gai-Luron
8th January 2010, 18:30
Hello,
My choice was
one lang file for LFSLapper.lpr ( LFSLapper.lg ) and lang included in lpr file for rest of file or a lang associated for each lpr file.
Why?
Because, when change to one script file, no need to modify lang file, only add .lpr and maybe .lg associated with the .lpr
The best way is no modify any file, only add file or remove file, no edit
Gai-Luron
Fire_optikz001
8th January 2010, 20:10
hey gai,
you know how there is a sub for when u enter a zone what about when u leave?
So like
registerzoneaction( "name" , "track" , x, y, 5, enter sub, exit sub (optional) );
:p
emit-nl
9th January 2010, 09:20
Aah ok, sorry for the misunderstanding.
Do you think it is useful to use this, with your ideas in LFSLapper or is it better to leave it the way LFSLapper is now? Then users can decide and make want they want themselves..
Like to hear your opinion :)
Tim
Fire_optikz001
9th January 2010, 23:05
is there a way to add it so that Lost conection and timed outs are not classified as dissconect like make a new ec=event for timing out/Lost connection
Krayy
12th January 2010, 08:59
is there a way to add it so that Lost conection and timed outs are not classified as dissconect like make a new ec=event for timing out/Lost connection
The InSim docs describe the following reasons for a session disconnect:
// Leave reasons
enum
{
LEAVR_DISCO, // 0 - disconnect
LEAVR_TIMEOUT, // 1 - timed out
LEAVR_LOSTCONN, // 2 - lost connection
LEAVR_KICKED, // 3 - kicked
LEAVR_BANNED, // 4 - banned
LEAVR_SECURITY, // 5 - OOS or cheat protection
LEAVR_NUM
};
Currently Lapper executes the OnDisConnect function but only supplies the Username as an argument. If Gai can add another argument that is the reason number of the disconnect, then you could use a CASE/SWITCH statement to do different things when a disconnect occurs.
Gai-Luron
12th January 2010, 10:12
Helo,
Yes it execute onDisconnect put provide $reason as parameter
Bye
EDIT : Heu, in new version that i'am not released yet.:nod: . You have view doc before my release 5.9.2.3 :D
http://www.lfs-lapper.org/help/ondisconnect.htm
Fire_optikz001
12th January 2010, 13:31
cool :) cant wait this will fix a bug i have in my cruise addon
sinanju
12th January 2010, 22:48
Hi Gai
Just been trying your LFSRelax applications for 1st time..very good!
As part of this app, you have a function called EnableRemainFuel
This acts as a warning when your fuel will only last x more laps (change x to suit).
Could this function be added to lapper?
Gai-Luron
13th January 2010, 09:39
Hello,
No because, fuel info is only sended by LFS in outgauge and only for local player.
Krayy
15th January 2010, 01:38
How about a new Event called OnChangePos that is executed if the players position changes in the MCI handler:
...
if (lastPos != currPos)
{
PLIDChangePos.Add( currInfoPlayer );
+ args[0] = currInfoPlayer.userName;
+ args[1] = lastPos;
+ args[2] = currPos;
+ newCfg.executeFunction("OnChangePos", currInfoPlayer, args);
}
...
and then call it from a lapper script using:
Event OnChangePos( $userName, $lastPos, $currPos ) # Player event
EndEvent
Specifically, I want to expand the use of the Safety car so that I can determine if aplayer has passed another player and warn them to drop back to their original position before crossing the start/finish at race restart.
Also the text "Krayy takes the lead!" would look cool ;-)
Edit By Gai-Luron
DONE
Tim NL
15th January 2010, 14:41
How about a new Event called OnChangePos that is executed if the players position changes in the MCI handler:
Specifically, I want to expand the use of the Safety car so that I can determine if aplayer has passed another player and warn them to drop back to their original position before crossing the start/finish at race restart.
+1
With this is it also posible to make a script for a rolling start. :)
Gai-Luron
15th January 2010, 16:50
With this is it also posible to make a script for a rolling start.
Can you explain more?
Krayy
15th January 2010, 20:46
Using the Safety car updates that I am working on, it would be possible to do rolling starts. Basically the process would be:
1. Grid is at start with pacecar at pole
2. Race starts as per normal in pacecar mode. After the start, the ppacecar gets a stop/go penalty so it will enter pits at the end of teh start lap, and when it gets an "OnPitEnter", it will get spec'ed
3. In pacecar mode, racers are not allowed to pass each other, so we will store thier position at the start of the pacecar mode (in this case the grid order)
4. When a OnChangePos is raised when in pacecar mode, the racer will get a RCM telling them that they are out of position and must move forward/back a pos to get back in order
5. If the racers are out of order when they cross the line, they will receive a Drive Through penalty.
Krayy
15th January 2010, 23:03
A GL function to allow the writing of data to a log file.
See post http://www.lfsforum.net/showthread.php?p=1354403#post1354403 fro details
Fire_optikz001
16th January 2010, 06:14
A GL function to allow the writing of data to a log file.
See post http://www.lfsforum.net/showthread.php?p=1354403#post1354403 fro details
better yet why not this:
WriteToFile("./report.txt", "Fireoptikz did something naughty");
OR
WriteLineToFile("./report.txt", "Fireoptikz did something naughty");
what ever u like better
Krayy
16th January 2010, 06:26
better yet why not this:
WriteToFile("./report.txt", "Fireoptikz did something naughty");
OR
WriteLineToFile("./report.txt", "Fireoptikz did something naughty");
what ever u like better
'Cos the idea is that the file written to would be a log file in the ./log directory, and the extension is superflous because it would always be .log (as least that's the idea...any extension should be ok, and can be set via a const)
Fire_optikz001
16th January 2010, 07:09
'Cos the idea is that the file written to would be a log file in the ./log directory, and the extension is superflous because it would always be .log (as least that's the idea...any extension should be ok, and can be set via a const)
well why does it half to be in the log file i think it would be cool if we could put it any where
Fire_optikz001
18th January 2010, 19:15
i would like a thing for open privbutton that u can open it for a certain user like
openButton( $argv, "test2",160,15,35,5,5,-1,32, $var1 ); #for another player
nesrulz
22nd January 2010, 13:10
Synchro PB.txt from 2 and more LFS servers in one PB.txt file (http://www.lfsforum.net/showthread.php?p=1356797#post1356797), and send the file over ftp, for example: http://www.sert-lfs.net/site/lapperscript/index.php
Or it already exists? :Looking_a
Gai-Luron
22nd January 2010, 13:40
Already exist. But it's better to use new version of LFSLapper because your it's not maintened yet
Gai-Luron
nesrulz
22nd January 2010, 15:11
Where is option for this in new version?
What is the name?
Thx.
Gai-Luron
22nd January 2010, 18:31
Use same database name in config file
nesrulz
22nd January 2010, 19:24
Use same database name in config file
OK, I'll try.
Fire_optikz001
24th January 2010, 05:25
is there a way you could add a random number generator Like
$Start_Number = 1;
$End_Number = 100;
privMsg( RanNum( $Start_Number,$End_Number ) ); # does not have to be in a privMsg
i came up with
public void rannum(GLScript.unionVal val, ArrayList args)
{
string ident = val.nameFunction;
testArgs(ident, "SS", args);
int min = Convert.ToInt32(args[0]);
int max = Convert.ToInt32(args[1]);
Random random = new Random();
val.typVal = GLScript.typVal.str;
val.sval = utils.quote( Convert.ToString( random.Next(min, max) ) );
return;
}
IT WORKS!
Fire_optikz001
27th January 2010, 01:32
is there a way you could add a random number generator Like
$Start_Number = 1;
$End_Number = 100;
privMsg( RanNum( $Start_Number,$End_Number ) ); # does not have to be in a privMsg
i came up with
public void rannum(GLScript.unionVal val, ArrayList args)
{
string ident = val.nameFunction;
testArgs(ident, "SS", args);
int min = Convert.ToInt32(args[0]);
int max = Convert.ToInt32(args[1]);
Random random = new Random();
val.typVal = GLScript.typVal.str;
val.sval = utils.quote( Convert.ToString( random.Next(min, max) ) );
return;
}
IT WORKS!
also could u add an event for
// A player hits an autocross object
private void AXO_PlayerHitsAutocrossObject(Packets.IS_AXO AXO)
{
}
Krayy
27th January 2010, 10:17
I would like to see if it's possible to put in a function to do a CloseButton that accepts a regular expresion to specify the buttons to close. What I'm trying to do is create a generic function to create a set of buttons in a standard GUI format, and anohter function to close it. The creation code works fine, but the problem is that when I try to use a generic close function, I don't know what the names of the buttons that have been laid over the standard frame. If I can do something like 'ClosePrivButtonRegex("prefix_.*")' then that would enable me to close all of the buttons that use that prefix and make life a lot easier. Code below:
Sub kGUICreate ( $userName, $GUIprefix, $origL, $origT, $GUIwidth, $GUIHeight, $GUItitle, $showClose, $secondsDisplayed)
# Draw window titles with Prev, Next and Close buttons
openButton ( $userName, $GUIprefix . "_bg",$origL-1,$origT-10,$GUIwidth+2,$GUIHeight+18,1,-1,16,"");
openButton ( $userName, $GUIprefix . "_title",$origL,$origT-10,$GUIwidth,10,5,-1,0,"^0" . $GUItitle );
IF ($showClose == true)
THEN
openButton ( $userName, $GUIprefix . "_close",81,$origT+$GUIHeight+1,38,6,8,-1,16,"^0[ Close This Dialog ]",kGUIclose );
ENDIF
# Draw the main contents window on top of the titles
openButton ( $userName, $GUIprefix . "_contents_bg",$origL,$origT,$GUIwidth,$GUIHeight,1,-1,32,"");
EndSub
Sub kGUIclose ( $KeyFlags, $id )
$GUIprefix = split( $id,"_",0 );
closePrivButtonRegex ($GUIprefix);
EndSub
PS: Also allow this for the new CloseButton function to do this for a nominated user
Yisc[NL]
27th January 2010, 12:28
I'm not totaly sure but I think I made that a long time ago.
See attached script and sorry if you meant something different.
Krayy
27th January 2010, 19:35
;1363647']I'm totaly sure but I think I made that a long time ago.
See attached script and sorry if you meant something different.
Ummm....who were you replying to?
Yisc[NL]
27th January 2010, 21:50
Ummm....who were you replying to?
I replied at you, but forgot to quote and for the word 'not' (corrected last one in my original posting).
What I meant is that I think I already made a closing button routine (which I included in my original posting) so you might be able to use that.
If I misunderstood you, then I apologise for that.
Krayy
27th January 2010, 23:40
;1364082']I replied at you, but forgot to quote and for the word 'not' (corrected last one in my original posting).
What I meant is that I think I already made a closing button routine (which I included in my original posting) so you might be able to use that.
If I misunderstood you, then I apologise for that.
Ah, in that case, tyhanks for the reply, but it's not quite what I mean (and I use that technique in the handicapper and who scripts).
What I mean is that the generic open routine would create the base buttons and then you add on your custom buttons after that. Now when it comes time to close the buttons, the generic close cannot know what buttons you have created, but if you use a common Prefix, then we can use a regular expression to determine if that button should be closed. i.e.
If i have buttons called "who_title", "who_background, "who_line1, "who_line2, then doing a closePrivButtonRegex("^who_.*"); would iterate through all of the buttons, check which ones start with "who_" and delete them. This means it does not matter what you have called the buttons, as long as the prefix is the same. This needs to be done in the lapper executable like this:
insimButton.cs:
public void deleteButtonRegex(string pattern, int UCID)
{
ArrayList al = new ArrayList();
foreach (DictionaryEntry de in hashMsgBox)
{
box currBox = (box)de.Value;
if (Regex.IsMatch(currBox.id, pattern, System.Text.RegularExpressions.RegexOptions.Ignore Case))
{
al.Add((string) currBox.id);
}
}
string[] butToClose = (string[]) al.ToArray(typeof(string));
for (int i = 0; i < butToClose.Length; i++)
{
this.delete(butToClose[i], UCID);
}
}
infoPlayer.cs
public void privateButtonCloseRegex(string argString)
{
this.playerBox.deleteButtonRegex(argString, this.UCID);
}
scriptFunction.cs:
newCfg.CurrApp.registerCallBackFunction("closebuttonregex", closebuttonregex);
newCfg.CurrApp.registerCallBackFunction("closeprivbuttonregex", closeprivbuttonregex);
...
public void closebuttonregex(GLScript.unionVal val, ArrayList args)
{
infoPlayer currPly;
string ident = val.nameFunction;
currPly = listOfPlayers.getPlayerByUserName((string)args[0]);
if (currPly == null)
{
throw new GLScript.GLApp.GLScriptException("Player name " + (string)args[0] + " in function " + ident + " not a player");
}
args.RemoveAt(0);
testArgs(ident, "S", args);
currPly.privateButtonCloseRegex(args[0].ToString());
}
public void closeprivbuttonregex(GLScript.unionVal val, ArrayList args)
{
infoPlayer currInfoPlayer = newCfg.getCurrInfoPlayer();
string ident = val.nameFunction;
if (currInfoPlayer == null)
throw new GLScript.GLApp.GLScriptException("You can't use " + ident + " in this context, not a player event");
testArgs(ident, "S", args);
currInfoPlayer.privateButtonCloseRegex(args[0].ToString());
}
then called like:
Sub kGUIclose ( $KeyFlags, $id )
$GUIprefix = split( $id,"_",0 );
closePrivButtonRegex ($GUIprefix . ".*");
EndSub
Krayy
5th February 2010, 00:10
Update on the CloseButtonRegex...it works bloddy brilliantly! No more having to search through the code to find what buttoins i'd forgotten to put in the close command. happy as. Saves a lot of time.
New code...
AdminMsg. It's basically the same base code as the GlobalMsg command, but it only displays the message to Admins. i use this fro Debug and other Admin related messages, so that normal racers don't get spammed.
In scriptFunctions.cs:
newCfg.CurrApp.registerCallBackFunction("adminmsg", adminmsg);
...
public void adminmsg(GLScript.unionVal val, ArrayList args)
{
infoPlayer currInfoPlayer;
string ident = val.nameFunction;
testArgs(ident, "S", args);
string text = args[0].ToString();
string newText = "";
uGroup.clear( "admin");
uGroup.addUserFromFile("admin",newCfg.varsLapper.WorkingDir + "/" + newCfg.varsLapper.AdminFile );
foreach (DictionaryEntry de in listOfPlayers.playersUCID)
{
currInfoPlayer = (infoPlayer)de.Value;
if (uGroup.userExist("admin", currInfoPlayer.userName) || currInfoPlayer.UCID == 0)
{
if (text == "[[TranslateEngine]]")
newText = lfsLang.replaceParmsLangStr(currInfoPlayer.idLang) ;
else
newText = text;
SendMsgToConnection(currInfoPlayer.UCID, newText);
}
}
}
Ten I use it in my lappers like this:
Sub DEBUG ($msg)
IF ( $DebugOn > 0 )
THEN
adminMsg( "^5DEBUG: ^8" . $msg );
ENDIF
EndSub
Sub ADMIN ($msg)
IF ( $DebugOn > 0 )
THEN
adminMsg( "^7ADMIN: ^8" . $msg );
ENDIF
EndSub
Event OnRaceStart( $NumP ) # Lapper event
ADMIN ("Race starting: " . $NumP);
DEBUG ("Race type is: " . getLapperVar( "RaceInProg" ));
EndEvent
Fire_optikz001
5th February 2010, 05:30
i would like to request this
IF( FileExist( "./file.txt") = 1)
THEN
PrivMsg( "File Exist" );
ELSE
PrivMsg( "File Does not Exist" );
ENDIF
and
IF( contains($argv, ":" ) = 1 )
THEN
PrivMsg( "You Cant have : in your argv" );
ENDIF
Gai-Luron
5th February 2010, 13:21
Hello,
For adminmsg you can do that in GLScript in easy with listOfPlayer and group like your C# code. No reason to Add in LFSLapper. Maybe you can write a utils.lpr with GLScript usefull functions.
For contains function you have indexOf function
bye Gai-Luron
Gai-Luron
sinanju
9th February 2010, 13:13
If something not already available, can there be way for lapper to tell and output which sector a driver is currently in?
From what I can see, all the player variables available to do with splits and sectors appear to be all time related functions (sector/split times and comparisons to previous/best sector/split times).
Looking for something like
IF (GetCurrentPlayerVar( SectorIDNumber )==2) # in other words, if driver in 2nd sector
THEN
-do something-
ELSE
-do something different or ignore
ENDIF
Gai-Luron
9th February 2010, 14:51
Hello,
When you say sector, do you mean node. If node, you have RegisterNode Action. If you mean zone on track, you have zoneRegisterAction
Gai-Luron
Yisc[NL]
9th February 2010, 16:04
Gai-Luron already set you in the right direction, although it's not exactly what you need. With his commands you have to define your zones manualy and then use them later. It would be a nice addon to have an option to manualy create zone starting at X and ending at y.
sinanju
9th February 2010, 16:29
Gai - Sorry, no.
Don't want to use !zone or !node because I then have to find and set them for every single track and configuration, forward and reverse.
I already have to do this for my enter pits/exit pits warning, and few other things too. Comfortable with these, but this would be pain for what I need.
There must already be defined sections of the track where one sector ends and other sector starts (the obvious one is the start/finish line), otherwise you couldn't measure sector/split times.
I'm wanting to set up a yellow flag warning system, where if there is a crash in a sector, only people in that sector, and previous sector advised. If you're in front of the sector (maybe up to 2 sectors on longer tracks), then you don't need to know until you start new lap. And even then, you might never need to know, as flag may no longer be needed.
There must be something to tell LFS or Lapper that a sector is finished for the sector/split times to then show when past this point?
Would be nice to have sector zones, and Yisc's idea is a good one too.
Fire_optikz001
9th February 2010, 18:54
Gai - Sorry, no.
Don't want to use !zone or !node because I then have to find and set them for every single track and configuration, forward and reverse.
I already have to do this for my enter pits/exit pits warning, and few other things too. Comfortable with these, but this would be pain for what I need.
There must already be defined sections of the track where one sector ends and other sector starts (the obvious one is the start/finish line), otherwise you couldn't measure sector/split times.
I'm wanting to set up a yellow flag warning system, where if there is a crash in a sector, only people in that sector, and previous sector advised. If you're in front of the sector (maybe up to 2 sectors on longer tracks), then you don't need to know until you start new lap. And even then, you might never need to know, as flag may no longer be needed.
There must be something to tell LFS or Lapper that a sector is finished for the sector/split times to then show when past this point?
Would be nice to have sector zones, and Yisc's idea is a good one too.
easy... On split have it set a current player var setting the split number
Krayy
9th February 2010, 21:38
Fire_Optikz is right...use the OnSplit1, OnSplit2 and OnSplit3 functions to set a player var like this (Sector 1 is from Start/Finish to Split 1):
CatchEvent OnLap( $userName ) # Player event
# Update event lap count
SetCurrentPlayerVar ( "Sector", 1 );
$RaceLaps = GetCurrentPlayerVar ("RaceLaps");
$RaceLaps = $RaceLaps + 1;
SetCurrentPlayerVar ( "RaceLaps", $RaceLaps );
SetUserStoredValue ( "RaceLaps", $RaceLaps);
# Update the PB if the current lap is faster than the PB
$RacePB = GetCurrentPlayerVar("RacePB");
$CurrLapTime = GetCurrentPlayerVar ("LapTime");
IF ( ToNum($RacePB) < 1 || ToNum($CurrLapTime) < ToNum($RacePB) )
THEN
SetCurrentPlayerVar ( "RacePB", $CurrLapTime );
SetUserStoredValue ( "RacePB", $CurrLapTime);
ENDIF
RaceTickerUpdate();
EndCatchEvent
CatchEvent OnSplit1( $userName ) # Player event
SetCurrentPlayerVar ( "Sector", 2 );
EndCatchEvent
CatchEvent OnSplit2( $userName ) # Player event
SetCurrentPlayerVar ( "Sector", 3 );
EndCatchEvent
CatchEvent OnSplit3( $userName ) # Player event
SetCurrentPlayerVar ( "Sector", 4 );
EndCatchEvent
NB: This code is from a race tracker that I will release soon. it's main purpose is to track a racers state if they disconnect or pit/re-enter, and also to provide custom race reporting for our web site.
Krayy
9th February 2010, 21:56
Hi GL,
Please have a look at the attached patch file for soem additional vars and functions that I would like intergrated into your next release to help support a number of race tracking and managing addons that I am in the process of creating. Here is a summary of what's in the patch:
Functions
closePrivButtonRegex & closeButtonRegex - these functions will close all of the active buttons that match the given Regular Expression, so to close all of the buttons on the !who command, just use:
closePrivButtonRegex ("dowho.*");
Events
OnPracStart - This event is run when a practice session is started
Lapper Vars
raceinprog - this lapper vars will return the current race state that match the following entries in the consts.lpr file:
# Race type
const RACEINPROG_NONE 0; # Race not in progress
const RACEINPROG_RACE 1; # Race
const RACEINPROG_QUALIFY 2; # Qualify
raceid - this lapper var returns a unique identifier for the race based on the race start time. This is used to track if a player has already been in the race prior to a disconnect, and also lets us gather stats based on the raceid for series points calculations.
Many thanks.
* Updated patch file attached *
sinanju
10th February 2010, 12:48
Fire_Optikz is right...use the OnSplit1, OnSplit2 and OnSplit3 functions to set a player var like this (Sector 1 is from Start/Finish to Split 1)......
CatchEvent OnSplit1( $userName ) # Player event
SetCurrentPlayerVar ( "Sector", 2 );
Thanks both of you.
Apologies too, as I forget you can set things like this yourself - I'm more used to only having choices from a look up table or drop down list.
To get information back out of setting player variable like this, can I use
$sector=GetCurrentPlayerVar ("Sector");
and/or
IF (GetCurrentPlayerVar ("Sector") >=2)
THEN....
Gai-Luron
10th February 2010, 14:34
The two work
Krayy
10th February 2010, 23:27
Hi GL,
Please have a look at the attached patch file for soem additional vars and functions that I would like intergrated into your next release to help support a number of race tracking and managing addons that I am in the process of creating. Here is a summary of what's in the patch:
Functions
closePrivButtonRegex & closeButtonRegex - these functions will close all of the active buttons that match the given Regular Expression, so to close all of the buttons on the !who command, just use:
closePrivButtonRegex ("dowho.*");Events
OnPracStart - This event is run when a practice session is started
Lapper Vars
raceinprog - this lapper vars will return the current race state that match the following entries in the consts.lpr file:
# Race type
const RACEINPROG_NONE 0; # Race not in progress
const RACEINPROG_RACE 1; # Race
const RACEINPROG_QUALIFY 2; # Qualify
raceid - this lapper var returns a unique identifier for the race based on the race start time. This is used to track if a player has already been in the race prior to a disconnect, and also lets us gather stats based on the raceid for series points calculations.
Many thanks.
* Updated patch file attached *
The attached patch file has modified some of the code that was not required and updated the RaceID so that it can be used with the SplitToArray function.
Fire_optikz001
15th February 2010, 03:17
hey Gai u think you could give us a little heads up on whats in the next update like if ur renameing openprivbutton or what this would help me get a small head start on my script
Krayy
16th February 2010, 05:47
Hi Gai,
These files update the !who command to use a standardised Dialog box layout, and also adds these new utility functions:
DialogCreate ( $userName, $DialogPrefix, $origL, $origT, $Width, $Height, $Title, $showClose, $secondsDisplayed)
This function creates a standardised Dialog so that it creates continuity with the user interface
DialogClose
This function is called from the standardised DialogCreate function, and closes the entire dialog
ButtonExists( $userName, $ButtonToFind )
This function returns TRUE if a button already exists for a user, or FALSE if it doesn't. Called like this:
IF ( ButtonExists(GetCurrentPlayerVar("UserName"), $DialogPrefix . ".*bg") == FALSE)
THEN
DialogCreate ( GetCurrentPlayerVar("UserName"), $DialogPrefix, $origL-1, $origT, $Width, $Height, $DialogTitle, $ShowClose, $secondsDisplayed);
ENDIF
DEBUG ($msg)
This function will output a message to any Lapper Admins with the preface "DEBUG: ". Very useful for debugging messages, and easily disabled using the Global variable $DebugOn.
Krayy
26th February 2010, 03:48
When executing an OnLap, OnPB, OnPBQual or OnSplitX, how about passing the lap or split time as a parameter. That would save a call back in GL to retrieve the relevant playervar with very little overhead.
Maybe also the gap times for the OnNewGapPlayerBehind and OnNewGapPlayerBefore functions?
Fire_optikz001
1st March 2010, 05:18
would be coold if you cold do this...
include( "http://yoursite.com/LFSLapper-Scripts/YourScript.lpr" );
in other words ability to run scripts off the web with out having to download
Krayy
10th March 2010, 20:49
How about a Global stored value database that resides in the Lapper.exe directory so that you can store common variables across all Lapper instances, like Player membership status, last server joined etc. Used like:
SetGlobalUserStoredValue( $uName, "H_Mass", GetPlayerVar($uName,"H_Mass"));
$uMass = GetGlobalUserStoredValue( $uName, "H_Mass");
Fire_optikz001
10th March 2010, 22:24
How about a Global stored value database that resides in the Lapper.exe directory so that you can store common variables across all Lapper instances, like Player membership status, last server joined etc. Used like:
SetGlobalUserStoredValue( $uName, "H_Mass", GetPlayerVar($uName,"H_Mass"));
$uMass = GetGlobalUserStoredValue( $uName, "H_Mass");
that would be cool :)
Krayy
18th March 2010, 22:15
Here's a short patch to add some extra functionality, and a potential bugfix for FinishedPos:
New GetPlayerVars: ucid, plid
New functions:
getplayervarbyucid
getplayervarbyplid
userisserveradmin
Fire_optikz001
18th March 2010, 23:05
userisserveradmin
:D :D :D i been needing this!
Krayy
19th March 2010, 08:20
Here's a short patch to add some extra functionality, and a potential bugfix for FinishedPos:
New GetPlayerVars: ucid, plid
New functions:
getplayervarbyucid
getplayervarbyplid
userisserveradmin
Dang, my casts were causing a crash, so this is the correct patch file:
Fire_optikz001
11th April 2010, 03:42
ability to have the storedvalue.dbs online (ftp)
OR
ability to use a mysql database(one on my site)
Fire_optikz001
2nd May 2010, 20:24
got a little bored today so i changed the code up on dialog create
and made it so that it gets centered on your screen
(and also fixed the bug with [ Close ] where it was not centered correctly on the dialog box)
DialogCreateCentered ( $userName, $DialogPrefix, $Width, $Height, $DialogTitle, $ShowClose, $secondsDisplayed);
Sub DialogCreateCentered ( $userName, $DialogPrefix, $Width, $Height, $Title, $showClose, $secondsDisplayed) #$origL & $origT are no longer needed up here
$origL = round(ToNum(ToNum(200 - $Width)/2),0);
$origT = round(ToNum(ToNum(200 - $Height)/2),0);
DialogCreate ( $userName, $DialogPrefix, $origL, $origT, $Width, $Height, $Title, $showClose, $secondsDisplayed);
EndSub
i am also developing where a button will have a colored background (^color)
Fire_optikz001
9th July 2010, 05:03
i was wondering if you could add a way to check if a user uses a mouse wheel or keyboard to drive
Tim NL
9th July 2010, 09:23
i was wondering if you could add a way to check if a user uses a mouse wheel or keyboard to drive
There is. :nod:
#################
#Control Allowed#
#################
# Racer flags
# "Y" = Yes
# "N" = No
# "*"" = Yes or No
# Local variable
#-------------------------------------------------------------------
$SwapSide = "*";
$AutoGears = "*";
$Shifter = "*";
$HelpBrake = "*";
$AxisClutch = "*";
$AutoClutch = "*";
$Mouse = "N";
$KbNoHelp = "N";
$KbStabilised = "N";
$CustomView = "*";
Event OnNotMatchFlags( $userName ) # Player event
... do some thing
EndEvent
Crazy_Fox [UA]
9th July 2010, 17:21
I want to Lapper filtered (not recorded in the database) results, some worse. For example, for BL1 @ XRG set limit 1.36.00, 1.35.94 then the result will be recorded as the result of 1.36.12 - ignored.
PS: Sorry for my English, i'm from Ukraine :rolleyes:
Fire_optikz001
9th July 2010, 20:02
There is. :nod:
#################
#Control Allowed#
#################
# Racer flags
# "Y" = Yes
# "N" = No
# "*"" = Yes or No
# Local variable
#-------------------------------------------------------------------
$SwapSide = "*";
$AutoGears = "*";
$Shifter = "*";
$HelpBrake = "*";
$AxisClutch = "*";
$AutoClutch = "*";
$Mouse = "N";
$KbNoHelp = "N";
$KbStabilised = "N";
$CustomView = "*";
Event OnNotMatchFlags( $userName ) # Player event
... do some thing
EndEvent
that's not what i meant .... i meant like
IF( GetCurrentPlayerVar("Mouse") == "1" ) THEN
GlobalMsg($userName." Is Using a Mouse");
ENDIF
Gai-Luron
9th July 2010, 21:51
Hello,
@Crazy_Fox [UA]
Modify trackinfo.cfg as desired
Gai-Luron
Krayy
9th July 2010, 22:30
that's not what i meant .... i meant like
IF( GetCurrentPlayerVar("Mouse") == "1" ) THEN
GlobalMsg($userName." Is Using a Mouse");
ENDIF
Just use the PlayFlags var add do a logical AND on it (&) against the value 1024.
Fire_optikz001
9th July 2010, 22:32
Just use the PlayFlags var add do a logical AND on it (&) against the value 1024.
nvm came up with this
Sub ControlType()
SetCurrentPlayerVar( "ControlType", "Wheel" );
$PitWork=splitToArray( GetCurrentPlayerVar("PlayerFlags")," " );
FOREACH( $maVar IN $PitWork )
IF ( $maVar["value"] == "Mouse" )
THEN
SetCurrentPlayerVar( "ControlType", "Mouse" );
ENDIF
IF ( $maVar["value"] == "KbStabilised" || $maVar["value"] == "KbNoHelp" )
THEN
SetCurrentPlayerVar( "ControlType", "Keyboard" );
ELSE
$IsNotBlank = 1;
ENDIF
ENDFOREACH
EndSub
Crazy_Fox [UA]
10th July 2010, 22:19
Modify trackinfo.cfg as desired
omg, so simply! Thx, i'm :noob:
emit-nl
29th July 2010, 09:04
Hi,
I think it would be nice if the !top and !drf windows get a previous/next button.
Would this be easy to realise? I've checked the tops.lpr file, but I don't know where to start :schwitz: (and !near, !drfnear, eg)
Is it possible in the lpr file or only in the hard code of LFSLapper itself? (Cause there is the base of the top command, isn't it?)
Thanks in advance.
Regards,
Tim
Krayy
30th July 2010, 00:57
Hi,
I think it would be nice if the !top and !drf windows get a previous/next button.
Would this be easy to realise? I've checked the tops.lpr file, but I don't know where to start :schwitz: (and !near, !drfnear, eg)
Is it possible in the lpr file or only in the hard code of LFSLapper itself? (Cause there is the base of the top command, isn't it?)
Thanks in advance.
Regards,
Tim
Depends on how many results you are after. Most people only want to check what the absolute fastest top 10 times are so they know how much they have to push to get within that grouping. Trying to see the last top 100 times is a bit of overkill. Then again, lowering the font size on the text in the !top lpr file can get more results on the screen.
PS: I'm wokring on integrating the !top command into the GUI system too so will have a look at it then.
emit-nl
30th July 2010, 08:02
Depends on how many results you are after. Most people only want to check what the absolute fastest top 10 times are so they know how much they have to push to get within that grouping. Trying to see the last top 100 times is a bit of overkill. Then again, lowering the font size on the text in the !top lpr file can get more results on the screen.
PS: I'm wokring on integrating the !top command into the GUI system too so will have a look at it then.
Yes you're maybe right about that. Still it would be nice if you can see your own stats and then can navigate to faster or slower racers I think.
Oeehh! That last sentence is niiice! ^^
I think that would be really nice! :)
Maybe it would be cool if you also make some options to select the cars for the top list. :)
When do you think you are going to release the new modules?
Keep up the good work :D
Tim
sinanju
30th July 2010, 22:16
.....Still it would be nice if you can see your own stats and then can navigate to faster or slower racers I think.....
Tim
I do something like this, but graphically via buttons, when in spectate mode......
emit-nl
31st July 2010, 08:28
Thats awesome! Nice work! :D
What do you mean with 'when in spectate mode'?
Can't you get this menu when you are driving?
Anyways, great job! I'm looking foward to your new GUI release! ^^
Regards,
Tim
sinanju
31st July 2010, 10:09
What do you mean with 'when in spectate mode'?
Can't you get this menu when you are driving?
Tim
If you have a button that needs pressed to take you to a sub-routine or sub-menu (like 'top times') then the mouse cursor will show up on your screen, and that annoys a lot of people.
And most people don't want menu to look at or change things when they're driving.
So my EasyKlik panel only appears when you are a spectator.
Jonathon.provost
6th August 2010, 20:54
hia
if it would be posible could u put it in time not just laps
thanx bye
sinanju
7th August 2010, 10:21
hia
if it would be posible could u put it in time not just laps
thanx bye
What is shown in laps that you want to show in time?
Austin Hedley
16th October 2010, 13:31
I think a non clickable button (or a flag to state clickable on/off in global and private buttons that use backcalls) might be usefull.
I'm having issues with %CPT% and/or delayed commands causing numbers to be missed from the count, or not display for even amounts of time.
See: http://www.lfsforum.net/showthread.php?p=1499405#post1499405
For more info.
Thanks in advance.
Austin Hedley
26th October 2010, 15:58
Could we have a new function pointsAbs, based on the points system?
e.g
When I use posAbs I get the value for users PB pos/all.
I would like to use pointsAbs to return users points pos/all.
Austin Hedley
26th October 2010, 18:41
Request for points.lpr
Similar to top.lpr
I have tried, and failed miserably, to convert top.lpr to show points instead of PBs and splits.
sinanju
10th April 2011, 11:29
If you're using Tim's (Tim[NL]) point system, then (assuming you've copied everything properly) then typing !points should bring up a table.
Make sure you've included the built_points = "Points"; in the lang part of the file.
Bmxtwins
19th April 2011, 15:20
october 2010 mate :tilt:
sinanju
14th June 2011, 14:52
I've recently been doing layouts on my server rather than the normal race tracks.
I've noticed that when I do !top command some people have had very short first split/sector times compared to the average.
My current layout probably averages about 9 second first split, but some people have done sub 2 seconds.
After some head scratching, then testing, I've realised that people are jumping the start and gaining the time there, and although LFS will give them 30 second penalty at end of race, LFSLapper will count the jump-start first lap as PB if it's quicker than subsequent laps.
As a quick fix, I've moved start line back from finish line so there's a few seconds gap between the 2 lines, but this isn't ideal - you can still jump the start and gain some time, and i'd much rather have the start line and finish line in same place.
(I'm taking very strong painkillers just now for trapped nerve, so my head is mush and I can't think straight. So).
Has anyone got any ideas how I can penalise driver for jumping start? Likely will have to be pit or spec penalty?
Dygear
14th June 2011, 21:49
Spec them, as it's the same as a jump start, and that's how LFS handles it on their grid so it's better to keep consistent.
sinanju
14th June 2011, 23:26
At the moment, I use the Event OnFalseStartLn as a trigger for penalties for jumping start.
Event OnFalseStartL1( $userName ) # Player event
privRcm( langEngine( "%{main_falsestart1}%" ) ); # advise 30 second penalty
cmdLFS( "/p_30 " . GetCurrentPlayerVar("UserName") );
EndEvent
Event OnFalseStartL2( $userName ) # Player event
privRcm( langEngine( "%{main_falsestart2}%" ) ); # advise 45 second penalty
cmdLFS( "/p_45 " . GetCurrentPlayerVar("UserName") );
EndEventand these add themselves onto overall race time.
I could just change these to
Event OnFalseStartL1( $userName ) # Player event
privRcm( langEngine( "%{main_falsestart1}%" ) ); # advise spec'd for jumping start
cmdLFS( "/spec " . GetCurrentPlayerVar("UserName") );
EndEvent
Event OnFalseStartL2( $userName ) # Player event
privRcm( langEngine( "%{main_falsestart2}%" ) ); # advise spec'd for jumping start
cmdLFS( "/spec " . GetCurrentPlayerVar("UserName") );
EndEventI suppose it will be ok for layouts, but I much prefer time penalties for races, so I'll need to remember to change back when I have tracks loaded rather than layouts.
Anyone got better suggestion?
Hoxz
19th June 2011, 09:39
hi
could lfs lapper disable repair damage : no ,to all racer on my server?
so everyone have like this
http://i1222.photobucket.com/albums/dd497/heralho/LFS2011-06-1915-28-40-49.jpg
thanks
sinanju
19th June 2011, 23:26
Lapper does have PitWork as a player variable, which you can then split into 3 further items;
Mechanicals Damages
Body Dammage
Refuel
(I know there's some mis-spelling there, but I think that's the way Gai's got them built into lapper)
For instance, in the Event OnBeginPit( $userName ) # Player event
you could use any or all of the following as lines of code
$PitWork = GetCurrentPlayerVar("PitWork");
IF ( $PitWork == "Mechanicals Damages" )
IF ( $PitWork == "Body Dammage" )
IF ( $PitWork == "Refuel")
However, apart from giving someone a penalty for using these, I don't thing you can actually change setting.
That seems bit too much control for someone to have over another player. I mean, what's to stop an Admin making everyone else have to pit except for them, or change fuel settings of others when they pit, or change tyre wear-out rate of others before tyres change, etc.
Maybe I'm wrong, but I don't see Scavier devs giving that sort of control to anyone but the player.
Krayy
20th June 2011, 05:47
The InSim API does not allow us to make any changes to in game Player options like pit owkr, fuel levels etc. The best we can do is to check what they have done by using thePitWork variable that is set after they leave the pits.
I have updated my Lapper to add a heap of extra stuff to the OnPitWork event so will forward that to Gai later.
Yisc[NL]
20th June 2011, 07:09
I've already send an email to Gai about it, but do you think that Lapper 6.012 needs an update after the recent changes in InSim? I'm not talking about the added packages, only about what already is in Lapper.
sinanju
20th June 2011, 12:59
;1608096'].... but do you think that Lapper 6.012 needs an update after the recent changes in InSim? ....
The only thing I'm having problems with due to all the recent updates is with split/sector times, although it's actually the same problem that was happening with any of the autocross layouts, so nothing new, just bit more pronounced.
Its just that with the new open configurations, you can have different layouts even with the same track x/y config names (e.g. AS21, AS22, AS23.... AS29), but lapper still sees them as AS2 and will overwrite people's PBs especially if one config is shorter than others (assuming they're faster).
This basically ruins the use of the !top command and your Pitboard, etc.
Could lapper be changed in anyway so that it would recognise more than just the normal track names (short and long)? Instead of just AS2 or AS2R, maybe AS2X_A22?
At the moment, I'm just backing up and removing my PBGrip database files and letting lapper make new database files for new open layouts.
Unfortunately, that does rely on me remembering to change the files as appropriate.
Yisc[NL]
20th June 2011, 18:30
Let me put in my request/question too.
Would it be possible to store laptimes for usernames instead of nicknames?
Or even better, to make that configurable in Lapper somewhere.
The reason I ask is that I just started racing again after about 2 years. I'm using a different nickname then before (since I am no longer with the team I was in) and now Lapper sets times attached to my current nickname, instead of to my username which would never change.
This way people can have like 10 times on a server, while there should actualy be only one for that username.
Krayy
20th June 2011, 22:27
;1608096']I've already send an email to Gai about it, but do you think that Lapper 6.012 needs an update after the recent changes in InSim? I'm not talking about the added packages, only about what already is in Lapper.
With regards to the new version of LFS and InSim (v5), I would think that Lapper would need to be reversioned with 6.0.1.2 being for up to LFS .5Z and a new version for LFS .6B. The reasoning behind this is that pretty much all of the InSim functions will need to have wrappers put around them to check what version of InSim (LFS server) is being run which would be a hell of a lot of work. Taking the code to a new version and making it specific to .6B+ would be a lot easier.
I'll send some mods to GL for what I have done to 6.0.1.2 to do things like fix the countdown timers, and do some tricky stuff to allow some Lapper mods to do race setups and then I think he'll need to archive it and start a new fork.
WaSp KiNg
27th June 2011, 14:58
The only thing I'm having problems with due to all the recent updates is with split/sector times, although it's actually the same problem that was happening with any of the autocross layouts, so nothing new, just bit more pronounced.
Its just that with the new open configurations, you can have different layouts even with the same track x/y config names (e.g. AS21, AS22, AS23.... AS29), but lapper still sees them as AS2 and will overwrite people's PBs especially if one config is shorter than others (assuming they're faster).
This basically ruins the use of the !top command and your Pitboard, etc.
Could lapper be changed in anyway so that it would recognise more than just the normal track names (short and long)? Instead of just AS2 or AS2R, maybe AS2X_A22?
At the moment, I'm just backing up and removing my PBGrip database files and letting lapper make new database files for new open layouts.
Unfortunately, that does rely on me remembering to change the files as appropriate.
im having the same problem with autocross layouts.
Vukas91
22nd October 2011, 18:10
Does 'complex drift scoring' script exist ?
I mean 'drift scoring' with clipping points.
Krayy
23rd October 2011, 10:14
Does 'complex drift scoring' script exist ?
I mean 'drift scoring' with clipping points.
Clipping points arent supported unless you put them in. What you could do is create specific zones on each track that represent the clipping points. To do this, use the !zone command to se what the x and y co-ordinate is for the position, then use the following command to set an action to take:
RegisterZoneAction( "BL1" , -60,106, 5 , FuncOnEnter, FuncOnExit);
The third numeric parameter is the distance from the x/y co-ord to use to execute, so make it low for right on the point, or large for an approximation.
Check some of the cruise stuff for how to use zones
Vukas91
24th October 2011, 12:30
Clipping points arent supported unless you put them in. What you could do is create specific zones on each track that represent the clipping points. To do this, use the !zone command to se what the x and y co-ordinate is for the position, then use the following command to set an action to take:
RegisterZoneAction( "BL1" , -60,106, 5 , FuncOnEnter, FuncOnExit);The third numeric parameter is the distance from the x/y co-ord to use to execute, so make it low for right on the point, or large for an approximation.
Check some of the cruise stuff for how to use zones
I don't know anything about making new insim or editing it(besides that txt file).
I know some C & Java programming.
Can you explain me more about it, give me finished insim with changable clipping points or give me links, because I don't know where to start.
Tnx for all :thumbsup:
Krayy
26th October 2011, 21:41
This IS the insim that gives you changeable clipping points. Zones can be used to simulate clipping points on corners, although you need to be careful with their placement as they are a circle from point X,Y with a radius of i.
Basically what you need to do is (with Lapper running), drive around the course to the corner that you want to set the clipping point at. Position your vehicle on the grass, ripple strip or wherever teh centre of your clipping circle will be (use the V key to cycle through until you are in top down view to make sure you are placed correctly). Use the "!zone" command to display what the x and y coords are (in the screenshot i'm at x=236, y=447).
Now you can use the RegisterZoneAction to create an event for when someone hits the clipping point.
RegisterZoneAction( "Clip1", "BL1" , 236, 447, 3 , EnterClip1, ExitClip1 );
This creates a zone that is 6 units in diameter (radius = 3) and the 2 params at the end are the functiosn taht are called when a racer enters the zone.
have a play with that and see what you can do.
Vukas91
26th October 2011, 22:35
I've tried that '!zone' command.
Nothing happens.
Krayy
26th October 2011, 23:05
I've tried that '!zone' command.
Nothing happens.
Make sure that you are an admin by putting your LFS username in the admin.txt file in the lapper instance directory (same dir as the LFSLapper.lpr file)
Vukas91
27th October 2011, 19:04
Make sure that you are an admin by putting your LFS username in the admin.txt file in the lapper instance directory (same dir as the LFSLapper.lpr file)
I have no admin.txt file.
If you mean that I have to make it.
I made it and put in my username(just my username) and nothing happens.
Krayy
27th October 2011, 20:51
I have no admin.txt file.
If you mean that I have to make it.
I made it and put in my username(just my username) and nothing happens.
Where did you put the admin.txt file, because it should be in something like c:\LFSLapper\<your lapper instance name> eg. c:\lfslapper\default
Also put your lfs username into the superusers.txt file in the same directory
LFSCruise
28th October 2011, 02:12
Can you tell me where to find myConfig Sub?
CASE "!myconfig":
myConfig( );
BREAK;
Krayy
28th October 2011, 02:22
Can you tell me where to find myConfig Sub?
CASE "!myconfig":
myConfig( );
BREAK;
myConfig is actually an internal command to Lapper which is defined in the scriptFunctions.cs file. It's not the best place to be as it's functionality can be emulated using the storedvalues functions.
LFSCruise
28th October 2011, 14:16
And how is it to edit the button? And what scriptFunctions.cs file?
Krayy
29th October 2011, 02:24
And how is it to edit the button? And what scriptFunctions.cs file?
If you don't know how to edit the source of Lapper using Visual C#, then you won't be able to modify it.
What exactly do you want to do?
LFSCruise
29th October 2011, 02:27
If you don't know how to edit the source of Lapper using Visual C#, then you won't be able to modify it.
What exactly do you want to do?
Need to adjust myConfig function.
I am using Visual Studio 2010
If you don't know how to edit the source of Lapper using Visual C#, then you won't be able to modify it.
What exactly do you want to do?
There are only .lpr files. How to edit the source?
Krayy
29th October 2011, 02:42
Download the source from the link in the releases thread to get the source code and project files to build it.
LFSCruise
29th October 2011, 09:13
And from where I can download?
LFSCruise
30th October 2011, 21:48
Can you tell me where to get the file?
LFSCruise
8th November 2011, 22:20
Where scriptFunctions.cs can change the buttons from MyConfig (myConfig function)? Where can I find?
iko.andonow
8th February 2012, 15:03
Hi. Can anyone make a simpliest drag lapper for BL1.
Just:
- stage in BL1 line
- 3-2-1-go in the chat
- check for jumpstart
- count time in 400m/800m.
Sorry for my bad English, and please this time anyone to respond to my request! Thanks!
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.