Author Topic: Display time using prints?  (Read 1399 times)

You know, where on servers like Spade's Arcade, display time and number of bricks on print bricks, Is there a way to do this?

If you want to do this, know that with default events, there is an issue you can run into.

You can't count in minutes, only in multiples of ten.

Create an infinite-loop relay that increments the print count of the seconds brick once per second.
When the print number overflows on the seconds brick, increment the tens-of-seconds brick, and so on.

There was once a set of bricks Kalphiter made which told the time (computer's time)

Ya but there are 60 seconds in a minute. So youd have to figure 8ut hout to make the print count overflow when it hit 60. And same thing with minutes in hours


You can't count in minutes, only in multiples of ten.
false

and for the current time and number of bricks on the server, try using VCE

store the number of bricks on the server to a variable, mod (%) 10 to a variable will give you the 1s place, which you can then do a few checks on and setprintcount the brick
store the other variable / 10 to another variable, % 10 again and that's your 10s place
store the other variable / 100 to another variable, % 10 again and that's your 100s place
and so on until you have as many digits as you want

and for the time, I have no idea in what format it's stored

try using VCE
I was about to suggest using VCE.
If your making a timer, you dont need to use variables.
If the timer is counting up, have these events to count in minutes:
with four print bricks named m00 m0 : s00 s0 thats what i use, to keep track of the ten's digit
Also. have a brick evented to incriment s0's print count each second.

s0- on printcount overflow, s00 incriment printcount 1
on printcount overflow, s00 ifvalue <var:brick:printcount> = =  6

s00- onvariabletrue, self set print count 0
onvariabletrue, m0 incriment print count 1

m0- onprintcountoverflow, m00 incrimentprintcount 1


If yur building a timer that counts down, its far simpler.
Just change the relay to decriment s0, set s0 do decrement s00 when it underflows. event s00 with
onprintcountunderflow, self set print count 5

You can't count in minutes, only in multiples of ten.
Create an infinite-loop relay that increments the print count of the seconds brick once per second.
When the print number overflows on the seconds brick, increment the tens-of-seconds brick, and so on.
also, another simple way to make a timer that counts up is to have a display that says "0.0 minutes have passed" and have a relay that incriments the decimal every 6 seconds, so that after 30 seconds it says "0.5 minutes have passed" and after 78 seconds it says "1.3 minutes have passed" and so on.