PDA

View Full Version : CountDownSeconds Function



Dumpin
11-16-2007, 08:36 PM
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
11-16-2007, 09:53 PM
Uhh Whats The Point Of A Countdown Timer

Dumpin
11-17-2007, 08:08 AM
Actualy i don't know :P you can see it countdown in the debug box... thats it ;P

n3ss3s
11-17-2007, 08:22 AM
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
11-17-2007, 08:31 AM
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
11-17-2007, 08:33 AM
w00t this is were i was searching for my whole life!!!(btw i leave tommorow ;))

Dumpin
11-17-2007, 08:37 AM
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



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


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
11-17-2007, 09:34 AM
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
11-18-2007, 10:23 AM
very very very very unless

but fun!

the shounds rule ROFL

n3ss3s
11-18-2007, 10:27 AM
Nice, but I meant sounds like a robotic voice saying "One" etc xD


But they're maybe lil hard to get..

Dumpin
11-18-2007, 10:51 AM
yes I think that to :)

Hugolord
11-18-2007, 11:11 AM
couldn't find any -,-

Dumpin
11-18-2007, 11:33 AM
couldn't find any -,-

how you mean?

Hugolord
11-18-2007, 11:36 AM
sounds i mean

Dumpin
11-18-2007, 12:21 PM
sounds i mean

are you using vista?

MasterKill
11-18-2007, 12:27 PM
i guess he couldn't find count down sounds like

"5"
"4"
"3"

ect.

uncfan1119
11-18-2007, 01:41 PM
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
11-18-2007, 02:05 PM
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
11-19-2007, 08:50 PM
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
11-20-2007, 12:14 AM
You could give the user "10" seconds to get SCAR hidden so it doesn't block stuff, and give them a verbal warning!

Dumpin
11-20-2007, 01:44 PM
could be ;P