The online racing simulator
Searching in All forums
(7 results)
Hunhard
Demo licensed
Quote from Krayy :Timers are tricky in Lapper because the app is running indepedantly of the LFS server and also only displays information to you as buttons on the client.

This induces a certain period of lag, as any timer needs to first calculate the time to display then cycle through all connections one by one updating the button used to display that timer. Each client will have a particular response time (say 20ms to 200ms) that adds to the time each update takes.

This is why sometimes with you use the %cnt% variable in a text button it will count down but may skip a number...it is taking more than 1 second to cycle through all of the clients.

Technically a function to create a button and update it with a timer, time of day etc, but there is no guarantee that it would be smooth.

maybe in the next version of InSim they will add functions that can do a simultaneous write or button update to all connections, which would solve the problem, but until then i could have a look but it would not be 100% accurate or smooth.

BTW, what sort of time do you want to display, race time, time of day?

Of course that time of day.

It should not only naturally display the date and time but also show the speed is definitely not changing every minute. It should show that as well as it shows LFSExternal.
Hunhard
Demo licensed
Quote from sinanju :Ah, get you now. I thought you had a syntax error. My bad.

However.

Not sure that it will update as my understanding is that getting a variable only gives you a snapshot at the time you call it.

The only way I can see to do what you want is to use the RegisterScheduleAction along with a sub-routine, e.g.

RegisterScheduleAction( "0 1 * * * * *", SA_Timer );

Sub SA_Timer
closePrivButton("Timer");
openPrivButton("Timer",1,5,30,5,10,-1,0,"^2" . GetLapperVar("ShortTime"));
End Sub

Maybe someone else has better idea?

By the by; If (?) this is being used as a host timer, why not use a Global button instead of a private one?


And if you still want to show clock and seconds you would do then?
There is no real-time.

Or can we any code can be used from C# ?
Hunhard
Demo licensed
Quote from sinanju :You were close.....

...should be

<?php 
    openPrivButton
("Time",1,5,30,5,10,-1,16,"^2" GetLapperVar("ShortTime"));
?>

Notice space both sides of full stop before GetLapperVar and you don't need the double quotes at the end of the line.

No it didn't help. Time stands still on the spot, not updating, do not change. It's like the clock stopped.
Time to change every minute.
Last edited by Hunhard, .
Hunhard
Demo licensed

openPrivButton("Time",1,5,30,5,10,-1,16,"^2".GetLapperVar("ShortTime")."");

Why time stands instead?
Last edited by Hunhard, .
Hunhard
Demo licensed
Quote from Hunhard :It should be that if the $argv is not a number that missed conditions.
Only numbers allowed.
preg_replace(); or something like that.
It's like:
ereg_replace("[^A-Za-z0-9]", "", $argv);

It is impossible to?
Hunhard
Demo licensed
Quote from sinanju :== equals equal to
^0 equals black text
-9 equals negative number

So you are saying if argument is equal to a black -9?

-EDIT-

Or are you trying to use the ^ pow symbol for a number to the power of (e.g. squared, cubed, etc)?

It should be that if the $argv is not a number that missed conditions.
Only numbers allowed.
preg_replace(); or something like that.
It's like:
ereg_replace("[^A-Za-z0-9]", "", $argv);
Last edited by Hunhard, .
Hunhard
Demo licensed
Welcome,

Do you know how to make
[^0-9]

does not work and why?

IF ( $argv != "" && $argv == "[^0-9]" && $argv >= "1")
THEN

Last edited by Hunhard, .
FGED GREDG RDFGDR GSFDG