The online racing simulator
Quote from Gai-Luron :

<?php 
$Refund 
13200;
?>


<?php 
IF( GetCurrentPlayerVar("TotDistMeter") >= ToNum$Refund GetCurrentPlayerVar("Refund") ) )
THEN
    SetCurrentPlayerVar
("Refund"ToNumGetCurrentPlayerVar("Refund") +  ) );  
    
globalMsg"^7" $userName " Recived $2500 ^1Reason: ^7Distance bonus" );
    
SetCurrentPlayerVar"Cash"ToNumGetCurrentPlayerVar"Cash" ) + 2500 ) );           
ENDIF
?>


WORKED Great!!! tyvm now im off to work on finishing the beta... i dont have a server to test it on tho :P
-
(broken) DELETED by broken
i got a lil problem in my cruise insim

if a user has negative money it has ( $ ) around the money but when a user has +money its fine my code for it is


<?php 
openPrivButton
"Cruise_HUD_Cash",2,140,20,5,12,-1,32,strFormat"^7Cash: {0:C}",GetCurrentPlayerVar"Cash" ) ) );
?>

Quote from Fire_optikz001 :i got a lil problem in my cruise insim

if a user has negative money it has ( $ ) around the money but when a user has +money its fine my code for it is


<?php 
openPrivButton
"Cruise_HUD_Cash",2,140,20,5,12,-1,32,strFormat"^7Cash: {0:C}",GetCurrentPlayerVar"Cash" ) ) );
?>


bump and

how to strip colors from somthing such as Blah Blah Blah
Hi,

I'm having a little problem with LFSLapper v.5.918.

I was trying to copy the databases from my current server, which is online with v.5.844, to my test server with v.5.918.
When I join my test server and type !top, the menu will show up and at first sight it looks OK. But when you look to the 'Splits' section, only the last split is shown.

In v.5.844 all splits were shown. Could anyone explain this to me?

Thanks in advance,

$!N-Tim
Attached images
topmenu.jpg
Yes,

There is a bug in top, because, now top is written in GLScript and not a builtin function like old LFSLapper and it's seem to be a bug. I correct soon.

To return with the old top go to tops.lpr and modify this part of code

SWITCH( $command )
CASE "!top":
# Top( $argv );
DoMyTop( $argv,FALSE,FALSE );
BREAK;
CASE "!near":
# Near( $argv );
DoMyTop( $argv,FALSE,TRUE );
BREAK;
CASE "!topqual":
# topQual( $argv );
DoMyTop( $argv,TRUE,FALSE );
BREAK;
CASE "!nearqual":
# nearQual( $argv );
DoMyTop( $argv,TRUE,TRUE );
BREAK;
ENDSWITCH


put # before each DoMyTop
and remove # before
top
topqual
near
nearqual

in this case, it's old function that are used
thanks! I will use your solution for now.
Thanks for correcting the bug soon!

Tim
in tops.lpr

at line 95

replace


$colsplit = $col[COLOR=Red]S[/COLOR]plit . " ";


$colsplit = $col[COLOR=Red]s[/COLOR]plit . " ";

Gai-Luron
Hi,
A little question or maybe a request for in the future.

Is it posible to see whats the $id is of a openPrivTextButton?

example:
openPrivTextButton( "id_of_button",origL,origT,15,4,4,16,"Give your input","txt in button",30,goto_sub );

SUB goto_sub( $myinput,[COLOR=red]$id[/COLOR] ) [COLOR=blue]# <-- Is this posible??[/COLOR]
cmdLFS("/msg $myinput: " . $myinput );
cmdLFS("/msg $id: " . $id );
EndSub

And a happy 2010 :leb:
Hello,

An oversight

Done in new Release


Gai-Luron
Quote from Gai-Luron :Hello,

An oversight

Done in new Release

Gai-Luron

Thanks , thats was very quick
Sometimes Lapper drives me crazy.. ;-)

In an include-file I have in a
CatchEvent OnLapperStart:

GlobalVar $a_username_array;
GlobalVar $a_nickname_array;
GlobalVar $a_finishedpos_array;
GlobalVar $a_points_total_array;
GlobalVar $a_license_array;
GlobalVar $a_race_points_array;

And in a
CatchEvent OnRaceStart:

cmdLFS("/msg Hier ben ik er nog 1");
FOR (l$=1;l$<=32;l$=l$+1)
cmdLFS("/msg Hier ben ik er nog 2");
$a_username_array[l$] = "";
$a_nickname_array[l$] = "";
$a_finishedpos_array[l$] = 0;
$a_points_total_array[l$] = 0;
$a_license_array[l$] = "";
$a_race_points_array[l$] = 0;
ENDFOR
cmdLFS("/msg Hier ben ik er nog 3");

Then Lapper aborts, showing only the first "debug"-message:

Object reference not set to an instance of an object.
LFSLapper
at GLScript.SetOfVars.globalExist(String id) in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\GLScript\SetOfVars.cs:line 49
at GLScript.Parseur.assignValueToVar(unionVal val, unionVal retValue, SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC) in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\GLScript\ParseExpr.cs:line 898
at GLScript.Parseur.getval(SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC) in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\GLScript\ParseExpr.cs:line 627
at GLScript.GLApp.retrieveEvalVar(String funcName, TokenParse tkparse, TokenBuffer currTokenBuffer, SetOfVars GVAR, SetOfVars LVAR, Boolean breakFunc, Char& breakCar) in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\GLScript\GLScript.cs:line 1034
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end) in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\GLScript\GLScript.cs:line 254
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end) in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\GLScript\GLScript.cs:line 660
at GLScript.GLApp.privExecuteFunction(String funcName, String[] argsVals) in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\GLScript\GLScript.cs:line 173
at GLScript.GLApp.executeFunction(String funcName, String[] argsVals) in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\GLScript\GLScript.cs:line 144
at Configurator.lexConfigurator.executeFunction(String funcName, infoPlayer pcurrInfoPlayer, String[] par) in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\cfgParser\readCfg.cs:line 346
at LFSLapper.LFSClient.managePacket(RST rst) in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\LFSClient\managePacket.cs:line 602
at LFSLapper.LFSClient.Loop(Connect insimConnection) in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\LFSClient\loop.cs:line 1032
at LFSLapper.LFSClient.doloop() in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\LFSClient\lfsclient.cs:line 551
at LFSLapper.LFSListen.Listen.goWorkMode() in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\LFSListen\Listen.cs:line 88
at LFSLapper.LFSListen.Listen.startStbMode() in D:\Dev\DevInsim\lapper\LFSLapper\LFSLapper\src\LFSListen\Listen.cs:line 288
Boolean globalExist(System.String)
Closing Instance...

Dunno what's going wrong. What I do seems pretty straight-forward and still it breaks up.. Any ideas??
it's not l$ but $l, var are prefixed. Work fine on 5.9.2.0 now


CatchEvent OnLapperStart() # Lapper Event
GlobalVar $a_username_array;
GlobalVar $a_nickname_array;
GlobalVar $a_finishedpos_array;
GlobalVar $a_points_total_array;
GlobalVar $a_license_array;
GlobalVar $a_race_points_array;
endCatchEvent

CatchEvent OnRaceStart( $NumP )
cmdLFS("/msg Hier ben ik er nog 1");
FOR ($l=1;$l<=32;$l=$l+1)
cmdLFS("/msg Hier ben ik er nog 2");
$a_username_array[$l] = "";
$a_nickname_array[$l] = "";
$a_finishedpos_array[$l] = 0;
$a_points_total_array[$l] = 0;
$a_license_array[$l] = "";
$a_race_points_array[$l] = 0;
ENDFOR
cmdLFS("/msg Hier ben ik er nog 3");
endCatchEvent


EDIT: Why don't you use a multidimensional array mixing indexed et associative index? Code is more clear and clean


CatchEvent OnLapperStart() # Lapper Event
GlobalVar $a_player_infos;
endCatchEvent

CatchEvent OnRaceStart( $NumP )
FOR ($l=1;$l<=32;$l=$l+1)
cmdLFS("/msg Hier ben ik er nog 2");
$a_player_infos( $l,"username" )= "";
$a_player_infos( $l,"nickname" )= "";
$a_player_infos( $l,"finishedpos" )= 0;
$a_player_infos( $l,"license" )= "";
$a_player_infos( $l,"points" )= 0;
ENDFOR
endCatchEvent

And Why don't you use playerVar instead array?, no need to have global array



CatchEvent OnRaceStart( $NumP )

$list = GetListOfPlayers("U"); # List sorted by userName
FOREACH( $uN IN $list)
unSet( $CurrPly );
$CurrPly = GetPlayerInfo( $uN );
$CurrPly["my_finishedpos"] = 0);
$CurrPly["my_license"] = "");
$CurrPly["my_points"] = 0);
ENDFOREACH


endCatchEvent


Quote from Gai-Luron :it's not l$ but $l, var are prefixed. Work fine on 5.9.2.0 now

I knew it had to be something stupid..


Quote from Gai-Luron :EDIT: Why don't you use a multidimensional array mixing indexed et associative index? Code is more clear and clean

Didn't want to use two indexes, that wouldn't be very self-explanatory. The way you used it in the example is new to me, but very usable.. For the time being I will be using this one, until:

Quote from Gai-Luron :And Why don't you use playerVar instead array?, no need to have global array

I had the complete procedure changed using $CurrPly but ran into major problems after which I changed back to this method. I will be trying this method again, but first wanted to get things running OK.

Thanks again for the help and hints!
Choose language using buttons
I'd like to be able to offer a language choice using buttons as part of my HELP instructions - see attached mock-up.

Apart from using the !myconfig command, which also gives other choices that I don't want to include, is there anyway of doing this?
Attached images
Language help.PNG
Quote from YamaSuba.NL :The way you used it in the example is new to me, but very usable.. For the time being I will be using this one

Working like a charm now..

One thing though (here I am again.. ).. I'm launching a DelayedCommand from the OnResult now to make the delayed command as player-independent as possible. That also implied I couldn't use the UserStoredValues anymore in this delayed sub, since it isn't a playerevent anymore. No problem in itself, the StoredValue works just as well for storing the data.
One can't however show "!top"-like lists from that schema, but when building such a list myself, I would need to be able to read all StoredValue-data. Is there any means to do this (sequential reading) at this moment?
What do you want to read? put an example. Anyway you can use GetListOfPlayer, then read value.
Can you explain more?
Quote from Gai-Luron :What do you want to read? put an example. Anyway you can use GetListOfPlayer, then read value.
Can you explain more?

Isn't the GetListOfPlayers for the racers that are online at that moment?
What I want is get the stored users/points that are in the storedvalue database in order to make a top-list out of it. So a list of all users present in the database with the points they scored up to this moment.
In this case from the StoredValue table in stead of the UserStoredValue.
Hi,

I have a problem with the !ps command.
My LFSLapper won't receive the info from the internet..
I entered my pubstat key in LFSLapper, so it can't be that.

Is there something I missed?
Alle lines give '0' in the !ps window.

Thanks in advance!

Tim
Quote from YamaSuba.NL :Isn't the GetListOfPlayers for the racers that are online at that moment?
What I want is get the stored users/points that are in the storedvalue database in order to make a top-list out of it. So a list of all users present in the database with the points they scored up to this moment.
In this case from the StoredValue table in stead of the UserStoredValue.

All what you need is here, function exist since 5.837


+----------------------------+
|Changes from v5.836 to 5.837|
+----------------------------+

1. Add GLScript command for User Event
setUserStoredValue( key, value )
This function store the value associated with key and username
You can use this to display a topUser
2. Add GLScript command for User Event
getUserStoredValue( key )
This function retreive the value associated with key and current username
You can use this to display a topUser

3. Add GLScript command for User Event.
topUser( title,key,mode,argv );
-> title = Title of the Top displayed
-> key = Key used to retreive corresponding values ( limited to 50 characters )
ex:
key = "Champ1Race1"; // Display top for the specified race
or
key = "Champ1Race%"; // Display top for the specified Champ
find all value and make a sum by player where key begin with Champ
you can also write it with key = "Champ1%";
'%' Replace a part of a string in retreiving values
You can make more complicated structure
key="2009Champ1Race1" // Find result for race one in Champ1 in year 2009
key="2009Champ1Race%" // Find result for all race in Champ1 in year 2009
key="2009Champ%" // Find result for all Champ in year 2009
key="%" // All cumulated result


-> mode = "DESC" or "ASC" Sort sum value descending or ascending
-> argv = same as Top
4. Add GLScript command for User Event.
nearUser( title,key,mode,argv );
Same as topUser but list is positionned on current username

Quote from emit-nl :Hi,

I have a problem with the !ps command.
My LFSLapper won't receive the info from the internet..
I entered my pubstat key in LFSLapper, so it can't be that.

Is there something I missed?
Alle lines give '0' in the !ps window.

Thanks in advance!

Tim

Yes is only what you need, use pubstat in quote

Example
$PubStatIdk = "5TG37yO15NvRCC66nR1k2J1SWv6H8MHw";

Do you have a parental control? i 'll have to remove on my computer.
Caution, value are retreiveid every 5s between each player, du of the lfsworld tarpitting

Gai-Luron
Quote from Gai-Luron :All what you need is here, function exist since 5.837

Regrettably not.. The data I need to show is not in the UserStoredValue table, so I can't use the default top-list.
I had to store the data in de other table (with SetStoredValue) because it's produced in a lapper event (oh well, in fact it's a DelayedCommand, but that behaves like a lapper event.. ).
I could change it to using the SetUserStoredValue by means of a PrivDelayedCommand, but that makes the fastest-lap determination player-dependent. Or am I missing something?
Yellow / Blue Flag Events
Hi

I currently use a global yellow flag that pops up when someone crashes out (actually its based on spinning detection [Event OnAngleVelocity]).

Can anyone help on how to get flag to appear, when

1) a real LFS yellow flag condition occurs

2) flag only appears to racers in that section and previous section of track (don't want people who've passed crash and are in the following section of track to see flag). Maybe under Event OnSplit1, 2, etc?

I'd also like to do something similar with a blue flag,

I assume there must be some sort of InSim value that LFS flags up for when yellow and blue warnings should appear, but (if they exist) what are these values in lapper?

Or do we need another couple of Events (Event onYellowFlag / Event onBlueFlag) for lapper?
Attached images
Blue and Yellow Flags.png
Quote from Fire_optikz001 :how would i make a page on my website that would be

http://www.mysite.com?user=blah

I don't know why it is in this thread but you can do it in PHP easily... e.g. you have a page called page.html and you will put something like this to index.php:


<?php 
php
if (isset($_GET['p'])) // if there is "?p=xxx" in URL
{
  
$p $_GET['p'];
  if(!
file_exists("$p.html")) exit('Page does not exist.');
  include_once 
"$p.html"// include the requested page
}
else
{
  
// ?p=xxx is not in the URL => include a default home page
}

?>

Quote from YamaSuba.NL :
I could change it to using the SetUserStoredValue by means of a PrivDelayedCommand, but that makes the fastest-lap determination player-dependent. Or am I missing something?

Besides (forgot to mention that): that triggered me to change it to a lapperevent using DelayedCommand, because the playerevent didn't work correctly when someone wasn't on the track anymore.
Since it's gone quiet on this subject all of a sudden: Is there any chance it will be possible to create an ArrayList (ordered by value) from the fi_stored table in the near future?
This thread is closed

Config help
(1112 posts, closed, started )
FGED GREDG RDFGDR GSFDG