The online racing simulator
Quote from sinanju :Using Version=5.8.4.4

I've cut down my Lapper.lpr file a bit to make it smaller, and emptied the error log file.

Then put Drift option on via !gui command. This caused same Stand By State problem.

Lapper and Error files attached.

No problems with lapper file if Drift option not enabled.

And error log still pointing to same line of text as being the problem.

I haven't check the line numbers but the bug is easy to find.
The first error in the log is:

7/22/2009 1:05:38 PM -> Syntax error in cfg file Need string or '.' or ';' on file : "LFSLapper.lpr" at line #1555

If you look a little above the split 2/3 message you find the following line:

main_rodent = "Credo che questo sia un roditore"

There's a ; missing at the end of that line.
Quote :for Tur8o, i take a look on iddle exclude, try to put all username in lowercase

Gai-Luron

no i tried lower case still no luck :/
Quote from Yisc[NL] :I haven't check the line numbers but the bug is easy to find........There's a ; missing at the end of that line.

Thanks, Yisc[NL], I hadn't spotted that.

It has helped narrow the problem down.

I think the problem is to do with

IF( $AngleVelocity < 0 )
THEN
$Angle_drift=($AngleVelocity)*(-1);

I think Lapper sees $Angle_drift as an empty variable.

I've tried various ways to SetCurrentPlayerVar, but without success.

The latest thing I tried was

Event OnDriftScore()

SetCurrentPlayerVar($Angle_drift,"AngleVelocity*(-1)");

$AngleVelocity = GetCurrentPlayerVar( "AngleVelocity" );
$DriftScore = GetCurrentPlayerVar( "DriftScore" );
$LastDriftScore = GetCurrentPlayerVar( "LastDriftScore" );
$Angle_drift = GetCurrentPlayerVar( "Angle_drift" );

IF( $GUI_drift == "yes" )
THEN

openPrivButton( "drf0",99,1,22,10,4,-1,16," " );

IF( $AngleVelocity < 0 )
THEN
openPrivButton( "drf1",100,2,20,4,4,-1,32,langEngine( "%{main_ondriftscore}%" , $DriftScore, $LastDriftScore ) );
openPrivButton( "drf2",100,6,20,4,4,-1,32,langEngine( "%{main_driftangle}%" , GetCurrentPlayerVar("$Angle_drift") ) );
ELSE
openPrivButton( "drf1",100,2,20,4,4,-1,32,langEngine( "%{main_ondriftscorerev}%" , $DriftScore, $LastDriftScore ) );
openPrivButton( "drf2",100,6,20,4,4,-1,32,langEngine( "%{main_driftanglerev}%" , $AngleVelocity ) );
ENDIF
ENDIF
EndEvent

This gives me an angle one way, but not in reverse. See attachment.

Also tried various other codings for Get variable

SetCurrentPlayerVar($Angle_drift,AngleVelocity*(-1));
SetCurrentPlayerVar($Angle_drift,$AngleVelocity*(-1));
SetCurrentPlayerVar($Angle_drift,"$AngleVelocity*(-1)");

Anyone any suggestions?

Is the AngleVelocity an Array Variable?

If so, then this can't be set (according to change log).

Maybe needs a negative AngleVelocity built into Lapper as well as AngleVelocity?
Attached images
DriftAngles.JPG
Quote from sinanju :Thanks, Yisc[NL], I hadn't spotted that.

It has helped narrow the problem down.

I think the problem is to do with

IF( $AngleVelocity < 0 )
THEN
$Angle_drift=($AngleVelocity)*(-1);

I think Lapper sees $Angle_drift as an empty variable.

I've tried various ways to SetCurrentPlayerVar, but without success.

The latest thing I tried was

Event OnDriftScore()

SetCurrentPlayerVar($Angle_drift,"AngleVelocity*(-1)");

$AngleVelocity = GetCurrentPlayerVar( "AngleVelocity" );
$DriftScore = GetCurrentPlayerVar( "DriftScore" );
$LastDriftScore = GetCurrentPlayerVar( "LastDriftScore" );
$Angle_drift = GetCurrentPlayerVar( "Angle_drift" );

IF( $GUI_drift == "yes" )
THEN

openPrivButton( "drf0",99,1,22,10,4,-1,16," " );

IF( $AngleVelocity < 0 )
THEN
openPrivButton( "drf1",100,2,20,4,4,-1,32,langEngine( "%{main_ondriftscore}%" , $DriftScore, $LastDriftScore ) );
openPrivButton( "drf2",100,6,20,4,4,-1,32,langEngine( "%{main_driftangle}%" , GetCurrentPlayerVar("$Angle_drift") ) );
ELSE
openPrivButton( "drf1",100,2,20,4,4,-1,32,langEngine( "%{main_ondriftscorerev}%" , $DriftScore, $LastDriftScore ) );
openPrivButton( "drf2",100,6,20,4,4,-1,32,langEngine( "%{main_driftanglerev}%" , $AngleVelocity ) );
ENDIF
ENDIF
EndEvent

This gives me an angle one way, but not in reverse. See attachment.

Also tried various other codings for Get variable

SetCurrentPlayerVar($Angle_drift,AngleVelocity*(-1));
SetCurrentPlayerVar($Angle_drift,$AngleVelocity*(-1));
SetCurrentPlayerVar($Angle_drift,"$AngleVelocity*(-1)");

Anyone any suggestions?

Is the AngleVelocity an Array Variable?

If so, then this can't be set (according to change log).

Maybe needs a negative AngleVelocity built into Lapper as well as AngleVelocity?

I think you are missing GlobalVar $Angle_drift; somewhere.

$AngleVelocity is the drift angel ( positive and negative ).
With $Angle_drift=($AngleVelocity)*(-1); you make the negative value of $AngleVelocity positive and store it in $Angle_drift.
Quote from Tim NL :I think you are missing GlobalVar $Angle_drift; somewhere.

$AngleVelocity is the drift angel ( positive and negative ).
With $Angle_drift=($AngleVelocity)*(-1); you make the negative value of $AngleVelocity positive and store it in $Angle_drift.

Hi Tim

I've checked the guiconfig.lpr file, and it shows
GlobalVar $GUI_col_drift_yes ; GlobalVar $GUI_col_drift_no ; GlobalVar $Angle_drift ;
$GUI_col_drift_yes = 16 ; $GUI_col_drift_no = 32 ; $Angle_drift = 0 ;

I understand about how $Angle_drift makes the negative integer into a positive.

One of the many things I tried was


IF( $ConfVar["$AngleVelocity"] < 0 )
THEN
openPrivButton( "drf1",100,2,20,4,4,-1,32,langEngine( "%{main_ondriftscore}%" , $DriftScore, $LastDriftScore ) );
openPrivButton( "drf2",100,6,20,4,4,-1,32,langEngine( "%{main_driftangle}%" , $AngleVelocity ) );
ELSE
openPrivButton( "drf1",100,2,20,4,4,-1,32,langEngine( "%{main_ondriftscorerev}%" , $DriftScore, $LastDriftScore ) );
openPrivButton( "drf2",100,6,20,4,4,-1,32,langEngine( "%{main_driftanglerev}%" , ($ConfVar["$AngleVelocity"] * (GetCurrentPlayerVar( "$AngleVelocity" )-1))));

without success.

So, still stuck on how to get Lapper to show a negative number as a positive (e.g. -45 to show as 45).

(Can't believe it could be this hard! Maybe I should just give up on the programming and take up knitting instead?)
You are so complicated if negative


$toto = -1; #any negative number
IF( $toto < 0 )
THEN
$toto = -$toto;
ENDIF


"Angle_drift" don't exist as builtin var in LFSLapper


and

SetCurrentPlayerVar($Angle_drift,"AngleVelocity*(-1)");
wrong

Correct is

SetCurrentPlayerVar("Angle_drift",$AngleVelocity);

if $AngleVelocity is set ^^

example

$AngleVelocity = GetCurrentPlayerVar( "AngleVelocity" );
IF( $AngleVelocity < 0 )
THEN
$AngleVelocity = -$AngleVelocity ;
ENDIF
SetCurrentPlayerVar("Angle_drift",$AngleVelocity);

To retreive Angle_drift var, you have to write
$retreiveiVar = GetCurrentPlayerVar( "Angle_drift" );


$myvar is a GLScript Var, everytime preceded with $

GetCurrentPlayerVar( idOfVar ) is a function to get internal player var, idOfVar is a string containing the id of the internal var without $
SetCurrentPlayerVar( idOfVar,value ) is a function to set internal player var ( not the builtin var, only new var ), idOfVar is a string containing the id of the internal var without $ and value is any value, string or numerical

, if i have time to write a doc, it will be better. Maybe in Setember
Hello Guy i have fixed it i made a separate file with usernames in and made it similar to the swear filter one

Event OnIdle1() # Player event
UserGroupFromFile( "Exempt", "./idleexempt.txt" );
$UserName = GetCurrentPlayerVar("UserName");
IF( UserInGroup( "Exempt",$UserName ) == 1 )
THEN

ELSE

privMsg( langEngine( "%{main_idle1}%" ) );
ENDIF
EndEvent

thanks for the help
Hello,

Great!

onIdleExclude was created before UserGroup, it's for this on idle exclude exist. But now it's easy to do with usergroup. You become a GLScript coder

Gai-Luron
Quote from Gai-Luron :You are so complicated if negative

$AngleVelocity = GetCurrentPlayerVar( "AngleVelocity" );
IF( $AngleVelocity < 0 )
THEN
$AngleVelocity = -$AngleVelocity ;
ENDIF
SetCurrentPlayerVar("Angle_drift",$AngleVelocity);

To retreive Angle_drift var, you have to write
$retreiveiVar = GetCurrentPlayerVar( "Angle_drift" );



Sorry Gai, but I'm not getting it at all.

Not sure if it's the syntax, the logical placement of lines, or what.

Amongst the many things I've tried is


[FONT=Arial][COLOR=blue][COLOR=blue][FONT=Arial]Event OnDriftScore()[/FONT][/COLOR]

[COLOR=blue][FONT=Arial]$AngleVelocity = GetCurrentPlayerVar( "AngleVelocity" );[/FONT][/COLOR]
[COLOR=blue][FONT=Arial]$DriftScore = GetCurrentPlayerVar( "DriftScore" );[/FONT][/COLOR]
[COLOR=blue][FONT=Arial]$LastDriftScore = GetCurrentPlayerVar( "LastDriftScore" );[/FONT][/COLOR]

[COLOR=blue][FONT=Arial] IF( $GUI_drift == "yes" )[/FONT][/COLOR]

[COLOR=blue][FONT=Arial] THEN[/FONT][/COLOR]

[COLOR=blue][FONT=Arial] openPrivButton( "drf0",99,1,22,10,4,-1,16," " );[/FONT][/COLOR]

[COLOR=blue][FONT=Arial] IF( $AngleVelocity < 0 )[/FONT][/COLOR]

[COLOR=blue][FONT=Arial] THEN[/FONT][/COLOR]

[COLOR=blue][FONT=Arial] $AngleVelocity = -$AngleVelocity ;[/FONT][/COLOR]

[COLOR=blue][FONT=Arial] SetCurrentPlayerVar("Angle_drift",$AngleVelocity);[/FONT][/COLOR]

[COLOR=blue][FONT=Arial] openPrivButton( "drf1",100,2,20,4,4,-1,32,langEngine( "%{main_ondriftscorerev}%" , $DriftScore, $LastDriftScore ) );[/FONT][/COLOR]
[COLOR=blue][FONT=Arial] openPrivButton( "drf2",100,6,20,4,4,-1,32,langEngine( "%{main_driftanglerev}%" , [/FONT][/COLOR][COLOR=blue][FONT=Arial]GetCurrentPlayerVar( "Angle_drift")));[/FONT][/COLOR]

[COLOR=blue][FONT=Arial] ELSE[/FONT][/COLOR]
[COLOR=blue][FONT=Arial] openPrivButton( "drf1",100,2,20,4,4,-1,32,langEngine( "%{main_ondriftscore}%" , $DriftScore, $LastDriftScore ) );[/FONT][/COLOR]
[COLOR=blue][FONT=Arial] openPrivButton( "drf2”,100,6,20,4,4,-1,32,langEngine( "%{main_driftangle}%" , $AngleVelocity ) );[/FONT][/COLOR]

[COLOR=blue][FONT=Arial] ENDIF[/FONT][/COLOR]

[COLOR=blue][FONT=Arial]ENDIF[/FONT][/COLOR]

[COLOR=blue][FONT=Arial]EndEvent[/FONT][/COLOR]
[/COLOR][/FONT]

but even that (like some other syntax/line layouts I tried) comes up with 'IF not terminated' in the error log.

I tried your $retreiveiVar (even with different spellings - in English it should be $retrieveVar - e.g. $retrieveVar = GetCurrentPlayerVar( "Angle_drift" ); ) but still not working.

If I use a # before both of the open button 'drf2" lines, then the scoring part of the coding works - but then, that's the easy part.

(Currently looking on ebay for knitting needles and some nice wool).
Wrong ascii double quote in this line, rigth to drf2

Quote :
openPrivButton( "drf2”,100,6,20,4,4,-1,32,langEngine( "%{main_driftangle}%" , $AngleVelocity ) ;

Good

Quote :
openPrivButton( "drf2",100,6,20,4,4,-1,32,langEngine( "%{main_driftangle}%" , $AngleVelocity ) ) ;


Do you use pspPad editor? try it. it's good to view unmatched ( or "

Gai-Luron
Thanks Gui.

That was the problem.

I normally use PSPad at home (which is why I know about line number problems), but I've done a lot of work on this at work (! shhh), where I don't have PSPad (pc's tied down to what programs we can load), so been using mixture of Notepad and Word (easy to compare Screenshots and text side by side).

" issue must have crept in from Word.

Think I'll put the knitting on hold just now - looks like my eyesight needs checking first.
Quote from Gai-Luron :Hello,

Great!

onIdleExclude was created before UserGroup, it's for this on idle exclude exist. But now it's easy to do with usergroup. You become a GLScript coder

Gai-Luron

thanks

i just need to work out how to give people limited admin now im not sure what to do from here...

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

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

i have this for the files like the exclude files from spectate

and i have this but it doesnt work maybe you could help
IF( UserInGroup( "admin",$userName ) == 1 )
THEN
IF( UserInGroup( "halfadmin",$userName ) == 1 )
THEN
cmdlfs( "/restart" );
ELSE
privMsg( langEngine( "%{main_notadmin}%" ) );
ENDIF
BREAK;

thanks tur8o
Every IF must be close with ENDIF.

But your version can't work because they need an ENDIF and also because there is a logic mistake.
if tirst test is true, you are an admin and you go in THEN clause. But if you are admin it's not an obligation to be an half admin. Second test is wrong. /restart is never executed.

Complicated version


IF( UserInGroup( "admin",$userName ) == 1 )
THEN
cmdlfs( "/restart" );
ELSE
IF( UserInGroup( "halfadmin",$userName ) == 1 )
THEN
cmdlfs( "/restart" );
ELSE
privMsg( langEngine( "%{main_notadmin}%" ) );
ENDIF
ENDIF

BREAK;

In this version, if you are an admin you do only the THEN part to ELSE and exit to the corresponding ENDIF


THEN
cmdlfs( "/restart" );
ELSE
....
ENDIF

if you aren't and admin GLScript execute ELSE to his ENDIF. in this case



IF ....
....
ELSE
IF( UserInGroup( "halfadmin",$userName ) == 1 )
THEN
cmdlfs( "/restart" );
ELSE
privMsg( langEngine( "%{main_notadmin}%" ) );
ENDIF
ENDIF

in this part of code you aren't and admin and you test if you are an halfadmin. if true execute

THEN
cmdlfs( "/restart" );
ELSE

if false execute

ELSE
privMsg( langEngine( "%{main_notadmin}%" ) );
ENDIF

then exit from the main if. i hope i'am clear


More easy version


IF( UserInGroup( "admin",$userName ) == 1 || UserInGroup( "halfadmin",$userName ) == 1)
THEN
cmdlfs( "/restart" );
ELSE
privMsg( langEngine( "%{main_notadmin}%" ) );
ENDIF
BREAK;

|| it's or condition
&& it's and condition
Gai your a life saver.. Thanks ever so much that will also help me in future when i would like to add more things similar....

and its like adding an extra paragraph in to the original paragraph isn't it?

I did a RegisteredActionSchedule for it to go off every 15 minutes but when it gets to the 15 minutes it just spams it loads of times and i dont know why this is what it looks like

RegisterScheduleAction( "* 00 * * * * * : * 15 * * * * * : * 30 * * * * * : * 45 * * * * *", SA_webad );

Sub SA_webad() # Lapper Event
cmdlfs ( "/msg ^3Visit Our Website At ^6www.AMGMotorsports.ucoz.com" );
EndSub

Thanks Tur8o
Yes "paragraph" ( better to say block ) only excecute when condition is true in THEN part or false in ELSE part. And block are delimited into IF condition THEN ... ELSE ... ENDIF. unlimited imbrication can be done. to have better reading it's good to indent your code to better view every blocks. ELSE block is optionnal


[COLOR="Red"]IF condition1
THEN[/COLOR]
[COLOR="Lime"] IF condition2 THEN[/COLOR]
[COLOR="Blue"]IF condition3 THEN[/COLOR]
...
[COLOR="Blue"] ELSE[/COLOR]
[COLOR="cyan"] IF condition4 THEN[/COLOR]
...
[COLOR="cyan"]ENDIF[/COLOR]
[COLOR="Blue"]ENDIF[/COLOR]
[COLOR="Lime"] ENDIF[/COLOR]
[COLOR="Red"]ELSE[/COLOR]
...
[COLOR="Red"]ENDIF[/COLOR]

For your next issue

With this syntax you have every second for one mn your message

RegisterScheduleAction( "* 00 * * * * * : * 15 * * * * * : * 30 * * * * * : * 45 * * * * *", SA_webad );

* 00 * * * * *
mean at * second ( every number of second. * mean every when used in any position) when minute is 00 do the action.

The good syntax is

RegisterScheduleAction( "0 00 * * * * * : 0 15 * * * * * : 0 30 * * * * * : 0 45 * * * * *", SA_webad );

0 00 * * * * *
mean at 0 second when minute is 0 do action. Action is done one shoot because there is only one 0 second at 0 mn or 0 second at 15 mn etc...

example
0 30 * * * * *
in extenso : at 0 second,30 minute, every hour, every day of week, every day, every month, every year

if you want display a message only the 25 december of every year at 0 hours, 0 minute, zero second
0 0 0 * 25 12 *


i know GLScript is a little bit complicated than standard config file ( like AIRIO ), but much powerfull if you try to understand how it work. Continue!
most script exist for lapper, better is
Thanks Gai much appriciated

yes this is very complicated lol my head hurts i will get it into my head though

Tur8o
Hi, How can I store the PB again in PB.txt like old version?
Quote from lysergic :Hi, How can I store the PB again in PB.txt like old version?

That's not possible with the new version.
Everything is stored in a database and exported to some sort of text file.
Quote from Yisc[NL] :That's not possible with the new version.
Everything is stored in a database and exported to some sort of text file.

Thanks for the quick answer, but... I'm trying to read the file with LapperSkript, but it returns empy pages.

I successfully rename the file into PB.txt but lapperskript can't convert the values... Any help?

Is there another way to show PB on php page?
Hi,

Is it posible to store the value of /ws bl1 fbm pb username into a var?

Something like:

CASE "!test":
$ws=[COLOR=red]cmdLFS[/COLOR]( "/ws bl1 fbm pb tim nl");
cmdLFS( "/msg lfs pb :" . $ws);
BREAK;

excuse me but what is "ws" ?
Quote from Tur8o :excuse me but what is "ws" ?

To retrieve a pb on a track with car from someone .
Try in lfs chat /ws bl1 fbm pb your_username
ahhh this will help thanks
I'm having a problem with putting one of the standard CASE commands in a button, and getting it to work.

For instance, my button is:
openGlobalButton( "easyklikhelp",139,1,7,4,2,-1,32,langEngine( "%{main_easyklikhelp}%" ),OnClickHelp );

Then sub routine to open further buttons:

Sub OnClickHelp( $KeyFlags,$id )
SWITCH( $command)
CASE "!help":
openPrivButton( "help"......
openPrivButton( "help2"......
openPrivButton( "close".......
BREAK;
ENDSWITCH
EndSub

I've tried SWITCH ( $argv), SWITCH(), SWITCH (help), SWITCH (!help), Sub OnClickHelp().

I can get command to work, but only when it's not a ! type (e.g. !help, !ban, !kick, etc) command.
Quote from sinanju :I'm having a problem with putting one of the standard CASE commands in a button, and getting it to work.

For instance, my button is:
openGlobalButton( "easyklikhelp",139,1,7,4,2,-1,32,langEngine( "%{main_easyklikhelp}%" ),OnClickHelp );

Then sub routine to open further buttons:

Sub OnClickHelp( $KeyFlags,$id )
SWITCH( $command)
CASE "!help":
openPrivButton( "help"......
openPrivButton( "help2"......
openPrivButton( "close".......
BREAK;
ENDSWITCH
EndSub

I've tried SWITCH ( $argv), SWITCH(), SWITCH (help), SWITCH (!help), Sub OnClickHelp().

I can get command to work, but only when it's not a ! type (e.g. !help, !ban, !kick, etc) command.

Hi,

By SWITCH( $your_var) then is CASE the value of $your_var.


SWITCH( $your_var)
CASE "!help": #is the value of $your_var
openPrivButton( "help"......
openPrivButton( "help2"......
openPrivButton( "close".......
BREAK;
ENDSWITCH

I think your code is something like

CASE "!help":
OnClickHelp(0,0);
BREAK;
.
.
.
openGlobalButton( "easyklikhelp",139,1,7,4,2,-1,32,langEngine( "%{main_easyklikhelp}%" ),OnClickHelp );

Sub OnClickHelp( $KeyFlags,$id )
openPrivButton( "help"......
openPrivButton( "help2"......
openPrivButton( "close".......
EndSub

This thread is closed

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