My problem is that i have two scripts, one i use to Hold the procedures and one i use to execute, however when i run the code, or change the names of the functions i call(like change "Procedure M;" then calling it as "Main;") does not give me an error.
It just compiles and says its successful.
Here is the code for both files
First the Main
SCAR Code:
{.include ChatProcedures.scar}
program Try1;
Procedure Main;
begin
Spam(10, false, 'Trade');
writeln('--------------------');
writeln('Case 0 happened:' + IntToStr(x) + 'times.');
writeln('Case 1 happened:' + IntToStr(y) + 'times.');
writeln('Case 2 happened:' + IntToStr(z) + 'times.');
end;
begin
ClearDebug;
Main;
end.
And now the Procedures(They dont really have a purpose, i just havent coded for a while and i was practicing, theres still a couple things i could make faster in there[For statements])
Sorry it snakes for so long. =)
SCAR Code:
var
i,r,x,y,z : integer;
Chat : array [1..3] of String;
Trade : array [1..3] of String;
Procedure LoadSpeech;
begin
Chat[1]:= 'Hows the Weather?';
Chat[2]:= 'Oh Shoot!';
Chat[3]:= 'Stupid Game...';
Trade[1]:= 'Trade?';
Trade[2]:= 'Sellin Lobbies!';
Trade[3]:= 'hurry up...';
end;
Procedure Spam(RepeatTimes : integer; InfRepeat : boolean; ChatOrTrade : string);
begin
LoadSpeech;
if ChatOrTrade = 'Chat' then
begin
if InfRepeat = false then
begin
i:=0;
x:= 0;
y:=0;
z:=0;
repeat
r := Random (3)
Case r of
0 : begin
writeln(Chat[1] + IntToStr(x));
x:= x+1;
end;
1 : begin
writeln(Chat[2] + IntToStr(y));
y:= y+1;
end;
2 : begin
writeln(Chat[3] + IntToStr(z));
z:= z+1;
end;
end;
i:= i +1
wait(100);
until(i = RepeatTimes);
end;
if InfRepeat = true then
begin
x:= 0;
y:= 0;
z:= 0;
repeat
r := Random (3)
Case r of
0 : begin
writeln(Chat[1] + IntToStr(x));
x:= x+1;
end;
1 : begin
writeln(Chat[2] + IntToStr(y));
y:= y+1;
end;
2 : begin
writeln(Chat[3] + IntToStr(z));
z:= z+1;
end;
end;
wait(100);
until(false);
end;
end;
if ChatOrTrade = 'Trade' then
begin
if InfRepeat = false then
begin
i:=0;
x:= 0;
y:=0;
z:=0;
repeat
r := Random (3)
Case r of
0 : begin
writeln(Trade[1] + IntToStr(x));
x:= x+1;
end;
1 : begin
writeln(Trade[2] + IntToStr(y));
y:= y+1;
end;
2 : begin
writeln(Trade[3] + IntToStr(z));
z:= z+1;
end;
end;
i:= i +1
wait(100)
until(i = RepeatTimes);
end;
if InfRepeat = true then
begin
x:= 0;
y:= 0;
z:= 0;
repeat
r := Random (3)
Case r of
0 : begin
writeln(Trade[1] + IntToStr(x));
x:= x+1;
end;
1 : begin
writeln(Trade[2] + IntToStr(y));
y:= y+1;
end;
2 : begin
writeln(Trade[3] + IntToStr(z));
z:= z+1;
end;
end;
wait(100);
until(false);
end;
end;
end;
begin
Spam(2,false,'chat');
end.
Result:
Successfully compiled (26 ms)
Successfully executed