SRL Archive - Other Scripts

[Sing!] 100 Bottles of Beer on the Wall


Ron

2006-06-30 22:01:25

Here is the script. Just run it, and sing along! :D

This script is fully commented so people learning SCAR could see this as useful. You can change the number of bottles, the speed of each line, and what type of bottles. Beer? Milk? Piss? Anything lol.


{.Script Info:
# ScriptName = BeerBottles
# Author = Ron from moparisthebest.com
# Description = Sing the 100 bottles of beer on the wall song!
# Version = .1
# Date = June 30th, 2006
# Comments = Setup is on line 40. You don't have to set it up, just run it.
/Script Info}

Program BeerBottles;

Var
TotalS, TotalM, WaitTT, WaitT, i : Integer; // All of these are integers.
Liquid : String; // All of these are strings.

// Just give me credit procedure.
Procedure GiveMeCredit;
Begin
WriteLn('BBBB Y Y RRRR OOO N N');
WriteLn('B B Y Y R R O O NN N');
WriteLn('B B Y Y R R O O N N N');
WriteLn('B B Y Y R R O O N N N');
WriteLn('B B Y RRR O O N N N');
WriteLn('B B Y R R O O N N N');
WriteLn('B B Y R R O O N NN');
WriteLn('BBBB Y R R OOO N N');

// Waits a little so you can see it and then starts the script.
Wait(2000);
End;

Begin
// Clears the rectangular box on the bottom.
ClearDebug;

// Just give me credit.
GiveMeCredit;

// Setup These three values.
WaitT := 2500; // How long of a wait per line?
i := 100; // How many bottles?
Liquid := 'beer'; // Bottles of what? Beer? Milk? Piss?

// Total Seconds is calculated by this calculation. I'll break it down.
// WaitT is the wait in milliseconds per line so divide that by 1000 to convert it into seconds.
// Then multiply that number by 3 because the WaitTs are included three times in the repeat loop.
// Finally, multiply that number by i because that's how many times the repeat loop is played.
TotalS := (WaitT/1000)*3*i;

// Divide the Total Seconds by 60 to convert the seconds into minutes.
TotalM := TotalS/60;

// Repeats this section only!
Repeat
// IntToStr converts an integer to a string so you can write it.
// Writes 100 bottles of beer on the wall, 100 bottles of beer.
WriteLn(IntToStr(i) + ' bottles of ' + Liquid + ' on the wall. ' + IntToStr(i) + ' bottles of ' + Liquid + '.');

// Waits so you can sing.
Wait(WaitT);

// Decrease the number of bottles by one.
i := i-1;

// Writes Take on down! Pass it around!
WriteLn('Take one down! Pass it around! ');

// Waits again so you can sing.
Wait(WaitT);

// Writes 99 bottles of beer on the wall.
WriteLn(IntToStr(i) + ' bottles of ' + Liquid + ' on the wall!');

// Writes nothing so there is a space and it's easier to read.
WriteLn('');

// Waits again so you can sing.
Wait(WaitT);

// Keeps repeating until i becomes 0.
Until(i = 0)

// Writes nothing so you can see the middle message more clearly.
WriteLn('');
WriteLn('');

// Ron congratulates you.
WriteLn('Ron says, "Good job man!"');
// Tells you in how many minutes you sang the song in.
WriteLn('You sang the whole song in a total of ' + IntToStr(TotalM) + ' minutes.');

// Writes nothing so you can see the middle message more clearly.
WriteLn('');
WriteLn('');
End.

Enjoy!

~Ron :)

Cheesehunk

2006-06-30 22:32:08

I like how you went through, and commented it all.

Bego

2006-06-30 23:12:04

I see that, who are you talking to?

Ron

2006-06-30 23:34:15

From: Cheesehunk
I like how you went through, and commented it all.


Thank you. I enjoy learning (kind of corny but it's true lol) so I figure if I make simple scripts, other people can learn how to code better too. :D

newguy45

2006-07-01 11:43:29

thats nice how u dident use any nasty procedures XD

Ron

2007-07-14 09:32:16

Hey thanks for the compliment! Don't gimme any crap about bumping! I didn't bump! I just said thank you. You can't put a price on excepting a compliment. :D

teuneboon

2007-07-14 12:05:06

I'm doing a 100 bottles right now, I'll post a "progress report" when it's done :P

EDIT:
2 bottles of piss on the wall. 2 bottles of piss.
Take one down! Pass it around!
1 bottles of piss on the wall!

1 bottles of piss on the wall. 1 bottles of piss.
Take one down! Pass it around!
0 bottles of piss on the wall!



Ron says, "Good job man!"
You sang the whole song in a total of 10 minutes.

GoF

2007-07-14 13:23:59

:) I used to use this a loooong time ago to make people mad.. Well, I won't post anything about this "not a bump" post.

mooman001

2007-07-14 23:04:57

Awsome!!!

turkeyidfool

2007-07-17 01:03:48

awsome man take a look at my who da munkey butt script. it's posted in the smae section 1st page