SRL Archive - OSR Help

Identifier expected


rya

2010-03-16 13:27:13

I'm trying to compile and well i can't

{.include srl/srl.scar}

Function FalseAndWrite(Text:String):Boolean;
Begin
Result := False;
WriteLn(Text);
End;

Function SetOre(Ore,What:Integer):Integer;
Begin

Case What Of
0:Begin //Colour
Case Ore Of
0: Result := 1;//Bronze Colour
1: Result := 1;//tin colour
2: Result := 2634057;//Iron colour
End;
End;
1:Begin
Case Ore Of //Toll
0: Result :=1;
1: Result :=1;
2: Result :=22;
End;
End;
End;
End;

Function FindOre(Ore:Integer) :Boolean;
Var Time,Colour,Toll,i,a,x,y:Integer;//Time = for failsafe latter
MyTpa :TPointArray;
ClickPoint :TPoint;
Begin

X := MSCX
Y := MSCY
Colour := SetOre(Ore,0);
Toll := SetOre(Ore,1);

If Not FindColorsSpiralTolerance(x,y,MyTpa,Colour,Msx1,msy1,msx2,msy2,Toll) Then
Exit;

For i:= 0 To High(MyTpa) Do
Begin
ClickPoint := MyTpa[i]
Inc(a);
MMouse(ClickPoint.x,ClickPoint.y,4,4);
If IsUpText('ine') Then
Begin
GetMousePos(x,y);
Result := True
If Random(20)=5 Then
Begin
Mouse(x,y,0,0,False);
ChooseOption('ine');
End Else Mouse(x,y,0,0,True);
If A>=25 Then
Begin
Result := FalseAndWrite('UpText not found after moving mouse 25 time!!!');
Exit;
End;
End;
End;










Begin
SetupSRL;
End.

Failed when compiling
[Error] (22094:4): Identifier expected

Thanks
~Rya

Dgby714

2010-03-16 13:36:54

You're missing a end;

program test;
{.include srl/srl.scar}

function FalseAndWrite(Text: string): Boolean;
begin
Result := False;
WriteLn(Text);
end;

function SetOre(Ore, What: Integer): Integer;
begin
case What Of
0: begin //Colour
case Ore of
0: Result := 1;//Bronze Colour
1: Result := 1;//tin colour
2: Result := 2634057;//Iron colour
end;
end;
1: begin
case Ore of //Toll
0: Result :=1;
1: Result :=1;
2: Result :=22;
end;
end;
end;
end;

function FindOre(Ore: Integer): Boolean;
var
Time, Colour, Toll, i, a, x, y: Integer; //Time = for failsafe latter
MyTpa: TPointArray;
ClickPoint: TPoint;
begin
X := MSCX
Y := MSCY
Colour := SetOre(Ore,0);
Toll := SetOre(Ore,1);

if not FindColorsSpiralTolerance(x, y, MyTpa, Colour, MSX1, MSY1, MSX2, MSY2, Toll) then
Exit;

for i := 0 to High(MyTpa) do
begin
ClickPoint := MyTpa[i]
Inc(a);
MMouse(ClickPoint.x, ClickPoint.y, 4, 4);
if IsUpText('ine') then
begin
GetMousePos(x, y);
Result := True
if (Random(20) = 5) then
begin
Mouse(x, y, 0, 0, False);
ChooseOption('ine');
end else
Mouse(x, y, 0, 0, True);
if A>=25 then
begin
Result := FalseAndWrite('UpText not found after moving mouse 25 time!!!');
Exit;
end;
end;
end;//<-- Here
end;

begin
SetupSRL;
end.

mixster

2010-03-16 13:38:01

At the end of the FindOre function, you need an extra end; - you don't indent (actually un-indent) on the "If IsUpText('ine') Then" line, which made it not line up properly - fix this and you see you have a missing end;

Edit: Dgby cheated!

Dgby714

2010-03-16 13:39:41

From: mixster
At the end of the FindOre function, you need an extra end; - you don't indent (actually un-indent) on the "If IsUpText('ine') Then" line, which made it not line up properly - fix this and you see you have a missing end;

Edit: Dgby cheated!


How did I cheat? LOL

rya

2010-03-16 13:48:15

From: Dgby714
How did I cheat? LOL


Yea he helped