SRL Archive - First Scripts

debug talker


HarryJames

2007-11-25 14:04:46

Hey, i recently rejoin, i left for about a year so i am saying thatthis is my first script…
:D
program scar;
{.include SRL/SRL.scar}

const
line1 = 'text 1';
line2 = 'text 2';
line3 = 'text 3';
line4 = 'text 4';
line5 = 'text 5';

var
spokenlines: integer;

procedure linea;
begin
Writeln(line1);
spokenlines:=spokenlines+1;
end;

procedure lineb;
begin
Writeln(line2);
spokenlines:=spokenlines+1;
end;

procedure linec;
begin
Writeln(line3);
spokenlines:=spokenlines+1;
end;

procedure lined;
begin
Writeln(line4);
spokenlines:=spokenlines+1;
end;

procedure linee;
begin
Writeln(line5);
spokenlines:=spokenlines+1;
end;

procedure ProgressReport;
begin
ClearDebug;
Writeln('[]========================================[]');
Writeln('---------------->Our Proggy<----------------');
Writeln(' spoke ' + IntToStr(spokenlines) + ' Lines' + ' ');
Writeln('---------------------------------------------');
Writeln('[]========================================[]');
end;


begin
ClearDebug;
SetupSRL;
repeat
linea;
wait(1000 + random(750));
ProgressReport;
lineb;
wait(1000 + random(750));
ProgressReport;
linec;
wait(1000 + random(750));
ProgressReport;
lined;
wait(1000 + random(750));
ProgressReport;
linee;
wait(1000 + random(750));
ProgressReport;
until(False)
end.

Raskolnikov

2007-11-25 19:52:36

First, please work on standards:

program scar;
{.include SRL/SRL.scar}

const
line1 = 'text 1';
line2 = 'text 2';
line3 = 'text 3';
line4 = 'text 4';
line5 = 'text 5';

var
spokenlines: integer;

procedure linea;
begin
Writeln(line1);
spokenlines:=spokenlines+1;
end;

procedure lineb;
begin
Writeln(line2);
spokenlines:=spokenlines+1;
end;

procedure linec;
begin
Writeln(line3);
spokenlines:=spokenlines+1;
end;

procedure lined;
begin
Writeln(line4);
spokenlines:=spokenlines+1;
end;

procedure linee;
begin
Writeln(line5);
spokenlines:=spokenlines+1;
end;

procedure ProgressReport;
begin
ClearDebug;
Writeln('[]========================================[]');
Writeln('---------------->Our Proggy<----------------');
Writeln(' spoke ' + IntToStr(spokenlines) + ' Lines' + ' ');
Writeln('---------------------------------------------');
Writeln('[]========================================[]');
end;


begin
ClearDebug;
SetupSRL;
repeat
linea;
wait(1000 + random(750));
lineb;
wait(1000 + random(750));
linec;
wait(1000 + random(750));
lined;
wait(1000 + random(750));
linee;
wait(1000 + random(750));
until(IsFKeyDown(5)); //Please no endless loops.
ProgressReport; //I put the progress report here so that you don't have a proggie sprouting every time you input something in the debug box :(
end.

I put the proggie at the end of everything so you wouldn't have a proggie sprouting every time the script inputs one line in the debug box ;)
The script will stop when you press F5.
Please read up on SRL standards
here

Hope this helps.

legendimi66

2007-12-05 01:30:08

Yes, standards are always helpful. Some people who judge your script to see if you can get into members, they look at standards. A script with terrible standards will never get in unless it is an awesome script.