SRL Archive - Other Scripts

Color flasher.


Harled

2007-09-26 08:10:29

Flashes colors.. :garfield:

// Flashes colors. i tested canvases and this is the result.
// credit to GoF i guess.
PROGRAM Flashy;

const
Interval = 10; // Interval in ms?
Loops = 10; // Times to loop.
Ch = 250; // Canvas height?
Cw = 250; // Canvas width?

var
CCol, Back: Integer;

const ColNum = 15;

procedure FlashIt(IV, LoopCount: Integer);
var
Sex, Sey: Integer;
begin
for Sex := 0 to LoopCount do
for Sey := 1 to ColNum do
begin
case Random(Sey) + 1 of // random colors from scar
1: CCol:= clAqua;
2: CCol:= clNicePurple;
3: CCol:= clBronzeII;
4: CCol:= clBrightGold;
5: CCol:= clDarkPurple;
6: CCol:= clCream;
7: CCol:= clWhite;
8: CCol:= clBlueViolet;
9: CCol:= clDarkTurquoise;
10: CCol:= clGreen;
11: CCol:= clMaroon;
12: CCol:= clNavy;
13: CCol:= clRed;
14: CCol:= clYellow;
15: CCol:= clMediumVioletRed;
end;
FastDrawClear(Back, CCol);
SafeDrawBitmap(Back, GetDebugCanvas, 0, 0);
Wait(IV);
end;
end;

begin
GetApplication.Title := 'Flashy';
ClearDebug;
Writeln('Flashy by Harled!');
Wait(2000);
DisplayDebugImgWindow(Cw, Ch);
Back := BitmapFromString(Cw, Ch, '');
Writeln('Time to flash!');
FlashIt(Interval, Loops);
RaiseException(erException, 'Script ends here');
end.

Bourdou!

2007-09-26 08:14:46

Lol. Nice, but why do you add the error?

Harled

2007-09-26 08:15:46

read the whole script. its in the end of it. Press ctrl +space in scar and type er to find other errors.

Bourdou!

2007-09-26 08:18:28

No, I know how to do it, but I don't see the point?

Harled

2007-09-26 08:20:15

oh. misread it. there is a point as i was just testing stuff. :spot:

Bourdou!

2007-09-26 08:29:29

Oh cool. well, gj, keep it up.

Harled

2007-09-26 08:33:53

I could have sworn you said how though.. :o and thanks.