pwnaz0r
2007-02-20 19:52:20
Hey guys well im making a door finder for SRL membs community using alot of diff functions(not done yet). Anyways this is what I have so far.
And this is the error I get
program New;
{.include srl/srl.scar}
function DoorOpen : boolean;
var
DoortmpBox1,DoortmpBox2 : TBox;
Dx, Dy : integer;
SkipX1,Skipy1,SkipX2,SkipY2,SkipX3,SkipY3,SkipX4,SKipY4 : integer;
COSX, COSY : integer;
begin
COSX := 260;
COSY := 137;
If(FindColorFromCentre(Dx,Dy,COSX,COSY,1659242,100,10))then
begin
MMouse(Dx,Dy,1,1);
If(IsUpText('lose'))then
begin
result := true;
Exit;
end;
If(IsUpText('pen'))then
begin
result := false;
Exit;
end;
If not(IsUpText('pen'))and not(IsUpText('lose'))then
begin
SkipX1 := GetMousePos(x-20,y);
SkipY1 := GetMousePos(x,y-20);
SkipX2 := GetMousePos(x+20,y);
SkipY2 := GetMousePos(x,y+20);
DoortmpBox1 := cBox2(SkipX1,SkipY1,SkipX2,SkipY2);
If(FindColorSkipBoxTolerance(Dx,Dy,1659242,7,7,510,337,10,DoortmpBox1))then
begin
MMouse(Dx,Dy,1,1,);
If(IsUpText('lose'))then
begin
result := true;
Exit;
end;
If(IsUpText('pen'))then
begin
result := false;
Exit;
end;
If not(IsUpText('pen'))and not(IsUpText('lose'))then
begin
SkipX3 := GetMousePos(x-20,y);
SkipY3 := GetMousePos(x,y-20);
SkipX4 := GetMousePos(x+20,y);
SkipY4 := GetMousePos(x,y+20);
DoortmpBox2 := cBox2(SkipX3,SkipY3,SkipX4,SkipY4);
If(FindColorSkipBoxTolerance(Dx,Dy,1659242,7,7,510,337,10,DoortmpBox1))andIf(FindColorSkipBoxTolerance(Dx,Dy,1659242,7,7,510,337,10,DoortmpBox2))then
begin
MMouse(Dx,Dy,1,1,);
If(IsUpText('lose'))then
begin
result := true;
Exit;
end;
If(IsUpText('pen'))then
begin
result := false;
Exit;
end;
If not(IsUpText('pen'))and not(IsUpText('lose'))then
begin
result := true;
Writeln('Could Not Find Door.. Hope its Open');
Exit;
end;
end;
end;
end;
end;
end;
end;
begin
SetupSRL;
If(DoorOpen)then writeln('Door Open');
end.
And this is the error I get
Line 1: [Error] (1:1): Variable Expected in script