Line 41: [Error] (19838:1): Identifier expected in script C:\Program Files\SCAR 3.21\Scripts\rich loop.scar
its the els its pointing at but must be something els, tried to fix it but i dont understand.
can you also attach it as script if it aint to much of a problem, never copies right allways one line of code
Edit: Dont worry fixed it, working great thanks R1ch. it loops through last array twice is the only thing i noticed
Edit:fixed looping by adding
SCAR Code:
if NoMoreArrays = True then Exit;
in the test procedure
Finishing code is
SCAR Code:
program ChatTest;
{.include SRL\SRL.scar}
var
ArrayLoop : Integer;
ArrayLoad : TStringArray;
NoMoreArrays : Boolean;
function LoadArray(ArrayLoop : Integer) : Boolean;
begin
if ArrayLoop > 1 then
begin
WriteLn('ArrayLoop is to be either 0 or 1');
NoMoreArrays:= True;
Exit;
end;
case ArrayLoop of
0: begin
ArrayLoad:= ['dave', 'dom'];
writeln('Array 0 loaded');
end;
1: begin
ArrayLoad:= ['jane', 'jess', 'gem'];
WriteLn('Array 1 loaded');
end;
end;
end;
procedure Test;
var
I : Integer;
PCheck, Msg : string;
ChatFound : Boolean;
begin
PCheck:= Lowercase(GetChatBoxText(8, clMessage));
Msg:= Lowercase(GetChatBoxText(8, clChat));
if PCheck = '' then Exit;
if NoMoreArrays = True then Exit;
for I:= 0 to High(ArrayLoad)do
begin
if(Pos(ArrayLoad[i], Msg) > 0 )then
begin
ChatFound:= True;
end else
WriteLn('Chat not found');
end;
end;
begin
SetupSRL;
ArrayLoop:= 0;
repeat
LoadArray(ArrayLoop);
Test;
Inc(ArrayLoop);
until(NoMoreArrays)
end.