The online racing simulator
Searching in All forums
(31 results)
1
Austin Hedley
S2 licensed
Last post before I go under the knife.
Tried the above code but get:-
-> Syntax error in cfg file "LFSLapper.lpr" at line #1025 suspected error in order of the operators Function 'onresult' script aborted

Which in my lapper file is this line

<?php 
 
IF $flagConfirm 2 THEN # 2 means that the result is confirmed.
?>

Not sure why this is happening.
Austin Hedley
S2 licensed
Quote from Dygear :I would love to see the rest of that SWITCH block that you have, because I'm pretty sure it can be made more general ...

It is Tims code I believe. There may be a bit of sinanjus in there also


<?php 
SWITCH( GetCurrentPlayerVar("FinishedPos") )   # variable for race finish order
  
CASE 1:
   IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
   
THEN
      openGlobalButton
"point900",$point_L,$point_T-4,40,4,4,-1,96,"^7 Race on ^3" getLapperVar("LongDate") . " @ " getLapperVar("LongTime") );
      
openGlobalButton"point910",$point_L+40,$point_T-4,6,4,4,-1,96,"^7points" ); 
      
openGlobalButton"point001",$point_L,$point_T,40,4,4,-1,96,"^7 1 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point101",$point_L+40,$point_T,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
  ENDIF
  BREAK; 
  CASE 
2:
     IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
   
THEN
      openGlobalButton
"point002",$point_L,$point_T+4,40,4,4,-1,96,"^7 2 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point102",$point_L+40,$point_T+4,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
  ENDIF
  BREAK;
  CASE 
3:
     IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
   
THEN
      openGlobalButton
"point003",$point_L,$point_T+8,40,4,4,-1,96,"^7 3 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point103",$point_L+40,$point_T+8,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
  ENDIF
  BREAK;
  CASE 
4:
     IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
   
THEN
      openGlobalButton
"point004",$point_L,$point_T+12,40,4,4,-1,96,"^7 4 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point104",$point_L+40,$point_T+12,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
  ENDIF
  BREAK;
  CASE 
5:
     IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
   
THEN
      openGlobalButton
"point005",$point_L,$point_T+16,40,4,4,-1,96,"^7 5 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point105",$point_L+40,$point_T+16,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
  ENDIF
  BREAK;
  CASE 
6:
    IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
    
THEN 
      openGlobalButton
"point006",$point_L,$point_T+20,40,4,4,-1,96,"^7 6 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point106",$point_L+40,$point_T+20,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
    ENDIF
    BREAK;
  CASE 
7:
    IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
    
THEN 
      openGlobalButton
"point007",$point_L,$point_T+24,40,4,4,-1,96,"^7 7 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point107",$point_L+40,$point_T+24,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
    ENDIF
    BREAK;
  CASE 
8:
    IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
    
THEN 
      openGlobalButton
"point008",$point_L,$point_T+28,40,4,4,-1,96,"^7 8 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point108",$point_L+40,$point_T+28,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
    ENDIF
    BREAK;
  CASE 
9:
    IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
    
THEN 
      openGlobalButton
"point009",$point_L,$point_T+32,40,4,4,-1,96,"^7 9 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point109",$point_L+40,$point_T+32,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
    ENDIF
    BREAK;
  CASE 
10:
    IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
    
THEN 
      openGlobalButton
"point010",$point_L,$point_T+36,40,4,4,-1,96,"^710 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point110",$point_L+40,$point_T+36,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
    ENDIF
    BREAK;
  CASE 
11:
    IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
    
THEN 
      openGlobalButton
"point011",$point_L,$point_T+40,40,4,4,-1,96,"^711 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point111",$point_L+40,$point_T+40,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
    ENDIF
    BREAK;
  CASE 
12:
    IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
    
THEN 
      openGlobalButton
"point012",$point_L,$point_T+44,40,4,4,-1,96,"^712 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point112",$point_L+40,$point_T+44,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
    ENDIF
    BREAK; 
  DEFAULT: 
# If no value match then do this (in this case, do nothing)
  
BREAK;
 
ENDSWITCH
?>

As for the Lasix, all my problems started after having a lens transplant and laser treatment. Dont want to put anyone off thinking of having it done, but there can be repercussions later on down the road.

Also the GLScript wiki link looks like something else altogether. This GLScript is made by Gai Luron the coder of Lapper I think http://www.lfs-lapper.org/help/en/
Austin Hedley
S2 licensed
Quote from Dygear :What is this written in?

It is written in Austins tenuous grasp of GLScript

Thanks for the suggestions guys. I can see now how to tidy up some the code I had made. Plenty of food for thought.
Unfortunately I have major eye surgery tomorrow and will be unable to look at a pc screen for 2-3 weeks at least. I'm sure when I get back online I will have some fresh code to look through and some exciting new questions

Regarding the points system, my own needs were quite simple, I wanted a monthly points challenge , solely based on one track one car (initially for the GLScript learning experience on our demo server). Now this is nearly complete I am starting to think about how to expand it for our S2 server. A rewards system immediately comes to mind, maybe allowing alternate cars/tracks/championships. The accumulated points could be used as a skill level indicator to keep different experience levels in graded championships. I know this is a fairly simplistic view of skill but accumulating points should, in theory, reflect the users effort and increasing ability.

Now would be a good time for others to suggest ideas for the points system, so it can all be incorporated into a flexible system.

Good luck with the CIF Krayy, and huge thanks to all of you willing to help/put up with, a clueless newbie.
Monthly championship results.
Austin Hedley
S2 licensed
I have modified Tims points system code to save data in a monthly set and now have some basic questions I would like to ask.


<?php 
Event OnResult
$userName,$flagConfirm # Player event
  
$month getLapperVar("ShortDate");  # Get date in dd/mm/yyyy format
  
$datestrip substr$month,3,);   # Strip the month from the short date
  
$year substr$month,6,);        # Find the year
        
IF ( $datestrip == "01" THEN $newmonth "January" ;                 # Start checking short month cycle and turn result into long month
         
ELSE
         IF ( 
$datestrip == "02" THEN $newmonth "February" ;               #
          
ELSE
          IF ( 
$datestrip == "03" THEN $newmonth "March" ;
           ELSE          
           IF ( 
$datestrip == "04" THEN $newmonth "April" ;
            ELSE
            IF ( 
$datestrip == "05" THEN $newmonth "May" ;
             ELSE
             IF ( 
$datestrip == "06" THEN $newmonth "June" ;
              ELSE
              IF ( 
$datestrip == "07" THEN $newmonth "July" ;
               ELSE
               IF ( 
$datestrip == "08" THEN $newmonth "August" ;
                ELSE
                IF ( 
$datestrip == "09" THEN $newmonth "September" ;
                 ELSE
                 IF ( 
$datestrip == "10" THEN $newmonth "October" ;
                  ELSE
                  IF ( 
$datestrip == "11" THEN $newmonth "November" ;
                   ELSE
                   IF ( 
$datestrip == "12" THEN $newmonth "December" ;
                   ENDIF
                   ENDIF
                   ENDIF
                   ENDIF
                   ENDIF
                   ENDIF
                   ENDIF
                   ENDIF
                   ENDIF
                   ENDIF
                   ENDIF
                   ENDIF
  
$champs = ( $newmonth " " $year );                         # Create a var $champs to hold current month and year
  
$Username GetCurrentPlayerVar"Username" ); 
  
SetCurrentPlayerVar"ps_race_points",(($ps_max_points+1) - GetCurrentPlayerVar"FinishedPos" ) ) );
  
SetCurrentPlayerVar$champs,getUserStoredValue$champs ) );  
   IF( 
GetCurrentPlayerVar$champs ) == "" )
  
THEN
    SetCurrentPlayerVar
$champs,"0" );
  ENDIF
  IF( 
ToNum(GetCurrentPlayerVar"ps_race_points" )) < )
  
THEN
    SetCurrentPlayerVar
"ps_race_points",);
  ENDIF
SWITCH( 
GetCurrentPlayerVar("FinishedPos") )   # variable for race finish order
  
CASE 1:
   IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
   
THEN
      openGlobalButton
"point900",$point_L,$point_T-4,40,4,4,-1,96,"^7 Race on ^3" getLapperVar("LongDate") . " @ " getLapperVar("LongTime") );
      
openGlobalButton"point910",$point_L+40,$point_T-4,6,4,4,-1,96,"^7points" ); 
      
openGlobalButton"point001",$point_L,$point_T,40,4,4,-1,96,"^7 1 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point101",$point_L+40,$point_T,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
  ENDIF
  BREAK; 
...
 
etc
....
 
  CASE 
12:
    IF(( 
$flagConfirm == )||( $flagConfirm == 18 )||( $flagConfirm == 34 ))
    
THEN 
      openGlobalButton
"point012",$point_L,$point_T+44,40,4,4,-1,96,"^712 : " GetCurrentPlayerVar("NickName") );
      
openGlobalButton"point112",$point_L+40,$point_T+44,6,4,4,-1,32,"^3" GetCurrentPlayerVar"ps_race_points" ) ); 
    ENDIF
    BREAK; 
  DEFAULT: 
# If no value match then do this (in this case, do nothing)
  
BREAK;
 
ENDSWITCH
   
SetCurrentPlayerVar$champs,ToNum(GetCurrentPlayerVar$champs ))+ GetCurrentPlayerVar"ps_race_points" ) ); 
   
setUserStoredValue$champsGetCurrentPlayerVar$champs ) );
?>

This records data into monthly results , year by year. ie. This months users total race points data is saved under the key "October 2010" for each user.
When your finished laughing at my messy, long winded way of doing it try to answer my questions

If your wondering why I didn't just use Longdate and reformat it to show MMM/YYYY , it is because I still wanted the whole date to show on Tims race results button and I couln't seem to set differing formats for LongDate in the script for different occasions.

I have been using:

<?php 
topUser
$champs,$champs,"DESC",$argv );
?>

To show this months leaderboard.

I would like to know ,
1. what does $argv actually mean/do?
2. How could I extract just the top 3 drivers each month? (So the top 3 drivers of last month can be announced on lapper start)
3. Is there a script method to delete all rows of a certain key type from the storedvalue.dbs file?
ie. to delete all previous months entries.
Austin Hedley
S2 licensed
Quote from Krayy :I was going to ask if someone could make a relevant acronym for CLIT

Clever Layout Including Text
Austin Hedley
S2 licensed
I vote for the CIF, Common Interface Framework designation.
I have personalised the tops.lpr file that comes bundled with v6.011 to fit in with the other menu's but Im having problems modifying it into a seperate points based lpr file. That would be a nice feature.
Loving your work so far.

Regards,

Austin.
Austin Hedley
S2 licensed
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.
Austin Hedley
S2 licensed
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
S2 licensed
There's always a solution, glad you found yours.
Austin Hedley
S2 licensed
Hi sin,

Assuming all you really need to do is get laptime in seconds only, then this works in lapperver6.011 for me.


<?php 
 
$lpt 
= (GetCurrentPlayerVar("LapTime")); #make  value of $lpt = raw laptime from DB and
$lptis $lpt/1000;        # convert $lpt into time in seconds only with 2 decimal places.
                            # and store as $lptis
?>

eg. laptime is 1.21.83 and has raw value of 81830 then divide by 1000 to get 81.83

Hope that helps
Last edited by Austin Hedley, .
Austin Hedley
S2 licensed
I have set my voting variables to


<?php 
 
$InRaceLapsVoteMinMax 
"0-0";
$VoteRestart = -1;
 
Event OnVoteRestartChange($PlayerOnTrack$Vote $Need# Lapper Event
 
openGlobalButton"bargr1",60,1,10,6,6,30,96,langEngine"%{main_vote_restart1}%"));
 
openGlobalButton"bargr2",70,1,20,6,6,30,96,langEngine"%{main_vote_restart2}%",$Vote,$PlayerOnTrack,$Need ) );
EndEvent
Event OnVoteRestartReach
($PlayerOnTrack$Vote $Need# Lapper Event
 
closeGlobalButton"bargr1&bargr2" );
EndEvent
Event OnVoteRestartZero
() # Lapper Event
 
closeGlobalButton"bargr1&bargr2" );
EndEvent
?>


But players can still vote to restart.

I also tried


<?php 
 
$InRaceLapsVoteMinMax 
"-2";
?>

Players still able to vote after lap 3 had started.
What have I done wrong?
Austin Hedley
S2 licensed
Quote from Austin Hedley :I am using lapper ver6.011 with Krayys Membership gui v1.0.1 and Yiscs pitboard.lpr ver 2.04f.
When I set myself or a member to AFFILIATE or above then they/I type !pbconfig they/I get the pitboard config light background with the title text, a dark box with display mode, then nothing else till the save settings and close buttons.
Any idea why this is happening?
Has anyone else experienced this?

Screenshot of empty config box attached.

I think I have a solution to the situation.
In gui_admin_membership.lpr look for (line 174-178)

<?php 
Sub LoginMember
($userName)
$NickName GetPlayerVar($userName"NickName");
privMsg ("^7Hi there, ^8" $NickName);
globalMsg ($NickName "^8 has logged in");
EndSub
?>


And change to


<?php 
Sub LoginMember
($userName)
 
$NickName GetPlayerVar($userName"NickName");
 
privMsg ("^7Hi there, ^8" $NickName);
 
globalMsg ($NickName "^8 has logged in");
 
OnConnectClose_Pitboard();
EndSub
?>


I am still testing this solution to see if it may cause other problems, but so far things seem good.
Hunting this problem down has done wonders for my understanding of GL script. I also spent far too long examining how the storedvalue.dbs worked, as I was sure thats where the problem was.
Steep learning curve, but I'm getting there.

Thanks to Gai, Krayy, sinanju ,TimNL and Yisc for your hard work!
Last edited by Austin Hedley, .
Austin Hedley
S2 licensed
Krayys membership gui script allows you to set a player as VISITOR,GUEST,AFFILIATE,FULL or ADMIN.
If I set AFFILIATE or FULL or ADMIN then your pitboard config looks wrong.
Pitboard config bug
Austin Hedley
S2 licensed
I am using lapper ver6.011 with Krayys Membership gui v1.0.1 and Yiscs pitboard.lpr ver 2.04f.
When I set myself or a member to AFFILIATE or above then they/I type !pbconfig they/I get the pitboard config light background with the title text, a dark box with display mode, then nothing else till the save settings and close buttons.
Any idea why this is happening?
Has anyone else experienced this?

Screenshot of empty config box attached.
Austin Hedley
S2 licensed
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
S2 licensed
Quote from Tim NL :
1: When a button is clickable ( when you use -1 ) and using a backcall you always get the mouse cursor.

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, will post into the request thread.

Quote :
2: I use the delayedcommand method in mine scripts and mostly it works ok, very some time it skips a number but mine server is not the fasted one.(P4 1.5Gz 512Mb) so maybe its that why it skips sometimes a number at mine server.

I'm running a quad core 2.8Ghz with almost no unnecessary tasks running on startup and I still get the odd number missing or uneven timing in the countdown delay scripts or %cpt% functions . I think it has to do with the way lapper handles time.

Quote :
3: In case of using the Event OnFinish( $userName ) you have to use
Event OnResult( $userName,$flagConfirm ) # Player event
IF(GetCurrentPlayerVar("FinishedPos")==1)
THEN
$delay=60;
DelayedCommand( $delay, start_countdown );
ENDIF
EndEvent


Thank you for your replies, they are most welcome. I was close to getting it right, after finishing reading all the changelog.txt and playervars.txt. The only thing I was missing was the $flagconfirm , what is this for? I cannot find any reference to it in any of the files I have other than where it is used in lpr files.
Austin Hedley
S2 licensed
I do indeed have Z28.
Let me clarify whats happening.
When in race and the timer is NOT showing, the mouse remains hidden.
When in race and timer IS showing , because the countdown button has a backcall, the mouse becomes visible and the button is clickable until timer runs out, then the mouse returns to its hidden state. The mouse will not hide while the button is active.
SHIFT+Z shows and hides the mouse normally once the buttons are closed.
Austin Hedley
S2 licensed
Quote from Whiskey :I think pressing Shift+Z should solve that

Not on my machine
Austin Hedley
S2 licensed
UPDATE:

Ok, I have managed to get a working timer that counts down evenly and does not miss any numbers.
Quote :
Sub start_countdown()
openGlobalButton( "cdt",89,113,20,4,1,-1,0,"^7RACE RESTARTS IN:" );
openGlobalButton( "cdb",90,110,25,10,1,-1,16,"" );
openGlobalButton( "cdc",108,111,6,8,1,-1,32,"" );
openGlobalButton( "cdn",108,111,6,8,1,2,32,"^310", SC1 );
EndSub
Sub SC1( $KeyFlags,$id )
openGlobalButton( "cdn",108,111,6,8,1,2,32,"^39", SC2 );
EndSub
Sub SC2( $KeyFlags,$id )
openGlobalButton( "cdn",108,111,6,8,1,2,32,"^38", SC3 );
EndSub
Sub SC3( $KeyFlags,$id )
openGlobalButton( "cdn",108,111,6,8,1,2,32,"^37", SC4 );
EndSub
Sub SC4( $KeyFlags,$id )
openGlobalButton( "cdn",108,111,6,8,1,2,32,"^36", SC5 );
EndSub
Sub SC5( $KeyFlags,$id )
openGlobalButton( "cdn",108,111,6,8,1,2,32,"^35", SC6 );
EndSub
Sub SC6( $KeyFlags,$id )
openGlobalButton( "cdn",108,111,6,8,1,2,32,"^34", SC7 );
EndSub
Sub SC7( $KeyFlags,$id )
openGlobalButton( "cdn",108,111,6,8,1,2,32,"^23", SC8 );
EndSub
Sub SC8( $KeyFlags,$id )
openGlobalButton( "cdn",108,111,6,8,1,2,32,"^22", SC9 );
EndSub
Sub SC9( $KeyFlags,$id )
openGlobalButton( "cdn",108,111,6,8,1,2,32,"^21", SC10 );
EndSub
Sub SC10( $KeyFlags,$id )
closeGlobalButton( "cdt&cdb&cdc&cdn" );
# cmdLFS( "/restart" );
EndSub

The problem with the above method is that, as backcalls use keyflags, the mouse shows on the racing screen while the buttons are active.

So I tried a different method.
Quote :
Sub start_countdown2()
openGlobalButton( "cdt",89,113,20,4,1,-1,0,"^7RACE RESTARTS IN:" );
openGlobalButton( "cdb",90,110,25,10,1,-1,16,"" );
openGlobalButton( "cdc",108,111,6,8,1,-1,32,"" );
openGlobalButton( "cdn",108,111,6,8,1,-1,32,"^310" );
DelayedCommand( 1, SC1a );
EndSub
Sub SC1a()
closeGlobalButton( "cdn" );
openGlobalButton( "cdn",108,111,6,8,1,-1,32,"^39" );
DelayedCommand( 1, SC2a );
EndSub
Sub SC2a()
closeGlobalButton( "cdn" );
openGlobalButton( "cdn",108,111,6,8,1,-1,32,"^38" );
DelayedCommand( 1, SC3a );
EndSub
Sub SC3a()
closeGlobalButton( "cdn" );
openGlobalButton( "cdn",108,111,6,8,1,-1,32,"^37" );
DelayedCommand( 1, SC4a );
EndSub
Sub SC4a()
closeGlobalButton( "cdn" );
openGlobalButton( "cdn",108,111,6,8,1,-1,32,"^36" );
DelayedCommand( 1, SC5a );
EndSub
Sub SC5a()
closeGlobalButton( "cdn" );
openGlobalButton( "cdn",108,111,6,8,1,-1,32,"^35" );
DelayedCommand( 1, SC6a );
EndSub
Sub SC6a()
closeGlobalButton( "cdn" );
openGlobalButton( "cdn",108,111,6,8,1,-1,32,"^34" );
DelayedCommand( 1, SC7a );
EndSub
Sub SC7a()
closeGlobalButton( "cdn" );
openGlobalButton( "cdn",108,111,6,8,1,-1,32,"^23" );
DelayedCommand( 1, SC8a );
EndSub
Sub SC8a()
closeGlobalButton( "cdn" );
openGlobalButton( "cdn",108,111,6,8,1,-1,32,"^22" );
DelayedCommand( 1, SC9a );
EndSub
Sub SC9a()
closeGlobalButton( "cdn" );
openGlobalButton( "cdn",108,111,6,8,1,-1,32,"^21" );
DelayedCommand( 1, SC10a );
EndSub
Sub SC10a()
closeGlobalButton( "cdt&cdb&cdc&cdn" );
EndSub

This solved the problem of the mouse cursor showing, but the timing is very poor. Some numbers stay visible longer than others during the countdown.

QUESTIONS:
1. Is it possible to show globalbuttons using backcalls and not have the mouse cursor visible?

2. Is it possible to use the delayedcommand method without the timing issues?

3. I have called this event from:-
Quote :
Event OnFinish( $userName ) # Player event
$delay=60;
DelayedCommand( $delay, start_countdown );
EndEvent

But although it starts the countdown from the first racer to finish, it also starts a new countdown for anyone else finishing withing the 60 seconds. Anyway to fix that?

Sorry for my noobness, but I AM trying.
Austin Hedley
S2 licensed
Ah yes , I should have thought of leaving all the buttons open during the count then close them all at the end. Was so wrapped up trying to get them all to timout at the same time I forgot about that feature :tired::doh:

The only reason I wasnt using global buttons for the test was that I didnt want to annoy the visitors on my test server with constant timers popping up, but still wanted them there to comment on other aspects of the lapper functions I had implemented.

I'm still struggling to delay the FOR loop so the countdown doesnt happen all at once tho'.
Austin Hedley
S2 licensed
Thanks for the heads up on the FOR loop.
I have tried several ways to create a delay but it seems you cannot break out of a loop to backcall a sub. The backcall still works but only AFTER the loop has finished.
Have messed about with DelayedCommand with no good results.
Countdown button
Austin Hedley
S2 licensed
I wanted to make a countdown button to activate between race end and racerestart and tried this method

Quote :
openPrivButton( "tclos",90,105,20,5,1,10,0,"RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,10,16,"" );
openPrivButton( "clos",96,111,8,11,1,10,32,"^3%cpt%" );


It sort of worked, but missed a couple of # in the countdown. After searching around I found that this is a bug, so I tried several different approaches.

Many of them failed

Finally I came up with this for a test private button:
Part 1
Quote :CASE "!test":
MyTest();
IF( UserIsAdmin( $userName ) == 1 )
THEN
openPrivButton( "tclos",90,105,20,5,1,2,0,"^7RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,2,16,"" );
openPrivButton( "clos",96,111,8,11,1,2,32,"^310", SC1 );

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

Part 2
Quote :
Sub SC1( $KeyFlags,$id )
openPrivButton( "tclos",90,105,20,5,1,2,0,"^7RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,2,16,"" );
openPrivButton( "clos",96,111,8,11,1,2,32,"^39", SC2 );
EndSub
Sub SC2( $KeyFlags,$id )
openPrivButton( "tclos",90,105,20,5,1,2,0,"^7RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,2,16,"" );
openPrivButton( "clos",96,111,8,11,1,2,32,"^38", SC3 );
EndSub
Sub SC3( $KeyFlags,$id )
openPrivButton( "tclos",90,105,20,5,1,2,0,"^7RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,2,16,"" );
openPrivButton( "clos",96,111,8,11,1,2,32,"^37", SC4 );
EndSub
Sub SC4( $KeyFlags,$id )
openPrivButton( "tclos",90,105,20,5,1,2,0,"^7RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,2,16,"" );
openPrivButton( "clos",96,111,8,11,1,2,32,"^36", SC5 );
EndSub
Sub SC5( $KeyFlags,$id )
openPrivButton( "tclos",90,105,20,5,1,2,0,"^7RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,2,16,"" );
openPrivButton( "clos",96,111,8,11,1,2,32,"^35", SC6 );
EndSub
Sub SC6( $KeyFlags,$id )
openPrivButton( "tclos",90,105,20,5,1,2,0,"^7RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,2,16,"" );
openPrivButton( "clos",96,111,8,11,1,2,32,"^34", SC7 );
EndSub
Sub SC7( $KeyFlags,$id )
openPrivButton( "tclos",90,105,20,5,1,2,0,"^7RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,2,16,"" );
openPrivButton( "clos",96,111,8,11,1,2,32,"^33", SC8 );
EndSub
Sub SC8( $KeyFlags,$id )
openPrivButton( "tclos",90,105,20,5,1,2,0,"^7RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,2,16,"" );
openPrivButton( "clos",96,111,8,11,1,2,32,"^32", SC9 );
EndSub
Sub SC9( $KeyFlags,$id )
openPrivButton( "tclos",90,105,20,5,1,2,0,"^7RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,2,16,"" );
openPrivButton( "clos",96,111,8,11,1,2,32,"^31" );
EndSub

I had to repeat the lines:

openPrivButton( "tclos",90,105,20,5,1,2,0,"^7RACE STARTS IN:" );
openPrivButton( "bclos",95,110,10,13,1,2,16,"" );

every iteration to make sure all text and buttons finished exactly at the same time.

I have a couple of questions:
1. Is there a more elegant way of coding this?
2. Where abouts do I put this code so it will be visible between races? (races already restart automatically with $AutoRestartRaceSec = 10; )
Austin Hedley
S2 licensed
Cheers for that sinanju, I did try adding a a similar main_careful to test it out and it worked, but then wanted to try a two line message using %nl% between the text which didnt work (using rcm).
Is the only way to use %nl% in a main_* to use a button instead?
How to $IdleExclude = from admin.txt
Austin Hedley
S2 licensed

<?php 
##################################
#Options for idle player on track#
##################################
#$IdleExclude = "Lagamel,Gai-Luron"; # Usernames excluded for idle check
$OnIdleTimeout1 20# Idle timeout for OnIdleAction1 in seconds
Event OnIdle1$userName # Player event
privMsglangEngine"%{main_idle1}%" ) );
EndEvent
$OnIdleTimeout2 
30# Idle timeout for OnIdleAction2 in seconds
Event OnIdle2$userName # Player event
cmdLFS"/spec " GetCurrentPlayerVar("UserName") );
privMsglangEngine"%{main_idle2}%" ) );
EndEvent
?>


How would I change $IdleExclude = "Lagamel,Gai-Luron";
to read list from a txt file instead?
Assuming text file is admin.txt in default.

Finally worked out the answer, so I thought I'd post my working code for others to see.

<?php 
##################################
#Options for idle player on track#
##################################

#$IdleExclude = "names here"; # Usernames excluded for idle check

$OnIdleTimeout1 20# Idle timeout for OnIdleAction1 in seconds

Event OnIdle1$userName # Player event
    
privMsglangEngine"%{main_idle1}%" ) );
EndEvent

$OnIdleTimeout2 
30# Idle timeout for OnIdleAction2 in seconds

Event OnIdle2$userName # Player event
    
UserGroupFromFile"admin""./admin.txt" );
    
$UserName GetCurrentPlayerVar("UserName");
    IF( 
UserInGroup"admin",$UserName ) == )
    
THEN
    privMsg
"^3You have admin status and wont be kicked ;)");
    ELSE
    
cmdLFS"/spec " GetCurrentPlayerVar("UserName") );
    
privMsglangEngine"%{main_idle2}%" ) );
    ENDIF
EndEvent
?>


Last edited by Austin Hedley, . Reason : Answered my own question
Austin Hedley
S2 licensed
Quote from rhodyracing :Looked all over lapper.lpr for this:

Clean racing and have fun ;o)

I want to change that, it comes up just before the race starts..

Any Ideas where thats hiding???

If you are using ver 6.011 you will find that statement in \includes\pitboard.lpr
1
FGED GREDG RDFGDR GSFDG