SRL Archive - Research & Development Lounge

CountDownSeconds Function


Dumpin

2007-11-16 15:36:26

Function CountDownSeconds(Time: integer): boolean;
var
Ti : integer;
begin
Ti:= Time;
repeat
wait(1000);
Ti := Ti -1;
Writeln(inttostr(Ti));
until(Ti = 0);
result :=true;
end;

This script Does a countdown in seconds, pretty easy but maybe its usefull for beginners :)

Fill it in as:

CountDownSeconds(5);

5= time of seconds :)

V2 with sound!!! :
Function CountDownSeconds(Time: integer): boolean;
var
Ti : integer;
begin
Ti:= Time;
repeat
wait(1000);
Ti := Ti -1;
playSound('C:\WINDOWS\Media\ding.wav');
Writeln(inttostr(Ti));
until(Ti = 0);
result :=true;
end;

V3 added 10 seconds later =P
Function CountDownSeconds(Time: integer): boolean;
var
Ti : integer;
begin
Ti:= Time;
repeat
wait(1000);
Ti := Ti -1;
playSound('C:\WINDOWS\Media\ding.wav');
Writeln(inttostr(Ti));
until(Ti = 0)
result :=true;
playSound('C:\WINDOWS\Media\tada.wav');
end;

plays nice sound after finishing the countdown

Easy huh? good luck

mark9510

2007-11-16 16:53:51

Uhh Whats The Point Of A Countdown Timer

Dumpin

2007-11-17 03:08:40

Actualy i don't know :P you can see it countdown in the debug box… thats it ;P

n3ss3s

2007-11-17 03:22:19

O.o does anybody know where you could download some robotic/space rocket lounch/etc sounds - "one" "two"…

Would be damn cool XD

So then you could like Eight seconds until rock timeout :p Entertaining scripts

Santa_Clause

2007-11-17 03:31:58

Why is it a function?

Function CountDownSeconds(Time: integer): boolean;
var
I : integer;
begin
for I := Time downto 1 do
begin
Wait(1000);
WriteLn(IntToStr(I));
end;
end;

ShowerThoughts

2007-11-17 03:33:42

w00t this is were i was searching for my whole life!!!(btw i leave tommorow ;))

Dumpin

2007-11-17 03:37:04

From: n3ss3s
O.o does anybody know where you could download some robotic/space rocket lounch/etc sounds - "one" "two"…

Would be damn cool XD

So then you could like Eight seconds until rock timeout :p Entertaining scripts


Ill check for that on the internet ;P


From: Santa_Clause
Why is it a function?

Function CountDownSeconds(Time: integer): boolean;
var
I : integer;
begin
for I := Time downto 1 do
begin
Wait(1000);
WriteLn(IntToStr(I));
end;
end;

Yea possible to ;P

From: hermpie
w00t this is were i was searching for my whole life!!!(btw i leave tommorow ;))


Well here it is for your last day ;P

Dumpin

2007-11-17 04:34:58

Added V2 with Sound ;P thanks n3ss3s for the idea.. note. this is just a sound of Windows XP not sure it works for Vista

MasterKill

2007-11-18 05:23:15

very very very very unless

but fun!

the shounds rule ROFL

n3ss3s

2007-11-18 05:27:54

Nice, but I meant sounds like a robotic voice saying "One" etc xD


But they're maybe lil hard to get..

Dumpin

2007-11-18 05:51:29

yes I think that to :)

Hugolord

2007-11-18 06:11:36

couldn't find any -,-

Dumpin

2007-11-18 06:33:33

From: hugolord
couldn't find any -,-


how you mean?

Hugolord

2007-11-18 06:36:55

sounds i mean

Dumpin

2007-11-18 07:21:39

From: hugolord
sounds i mean


are you using vista?

MasterKill

2007-11-18 07:27:31

i guess he couldn't find count down sounds like

"5"
"4"
"3"

ect.

uncfan1119

2007-11-18 08:41:50

Wouldn't it be the same as
if TimeFromMark(MyMark) > (2 * 60 * 100) then
but without the sound?

Edit: NVM, I re-read the thread.

Dumpin

2007-11-18 09:05:29

From: uncfan1119
Wouldn't it be the same as
if TimeFromMark(MyMark) > (2 * 60 * 100) then
but without the sound?

Edit: NVM, I re-read the thread.


Its more a wait ;P but then it makes cool beep sounds, and it writes in the Debug

Jacobdm0

2007-11-19 15:50:30

I'm using vista, and it makes little beep noises during the countdown, then makes a "ta da" sound when it gets to 0.

Pretty cool function, but kinda pointless for use in scripts…

R0b0t1

2007-11-19 19:14:07

You could give the user "10" seconds to get SCAR hidden so it doesn't block stuff, and give them a verbal warning!

Dumpin

2007-11-20 08:44:17

could be ;P