SCAR Code:
/////////////////////////////////////////////////////////////////////
//// FindDukeDoor(var rx, ry: Integer; Click: Boolean): Boolean; ////
//// *By Stur Pure* ////
////=============================================================////
//// This Function will search for the color red within the given////
//// Parameters, so it will only be able to find the actual door ////
//// If it is found, it will create a box in which it will check ////
//// for a quest symbol, which should be there. If it isn't found////
//// then it isn't the right door, and you are standing in a ////
//// wrong spot, and it will make one last attempt to get into ////
//// the right place, if that still won't work, it will terminate////
//// the script and send you a message saying it did not work ////
////=============================================================////
//// Please post feedback of this function, or any advice for it ////
/////////////////////////////////////////////////////////////////////
Program Test;
{.include srl/srl.scar}
Var
x, y: Integer;
Function FindDukeDoor(var rx, ry: Integer; Click: Boolean): Boolean;
Var
sx, sy, x, y, x1, y1, x2, y2, FlagBMP, count: Integer;
Begin
Wait(3000);
FlagBMP := BitmapFromString(30, 29, 'beNr7/38UjILBDhgYYo0Fa' +
'WEsTUwGG0t9k2HGUtlkJGOpaTKqsVQzGcNYWqWN//+PhbGMmjxq8r' +
'AxeRSMAioAADDjvkI=');
Symbolaccuracy := 0.5;
RoadColor := FindRoadColor;
MakeCompass('N');
LoadSymbolBitmapColor('Quest');
x1 := 632;
x2 := 662;
y1 := 20;
y2 := 50;
If not (FindColor(sx, sy, 255, x1, y1, x2, y2)) Then
begin
RadialWalk(RoadColor,200,170,72,1,-1);
Wait(200);
FFlag(0);
end;
If (FindColor(sx, sy, 255, x1, y1, x2, y2)) Then
Begin
x1 := x - 5;
x2 := y - 8;
y1 := x + 15;
y2 := y + 15;
If not (FindSymbolIn(x, y, 'quest', x1, y1, x2, y2)) Then
Begin
Writeln('There are no Quest symbols here, wrong place');
Writeln('Error : Reason1 (Wrong Location)');
TerminateScript;
end;
If (FindSymbolIn(x, y, 'quest', x1, y1, x2, y2)) Then
Begin
Writeln('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
Writeln('!!!==========#Function Success#=========!!!');
Writeln('!!!=======Found door at ' + IntToStr(sx) + 'x and ' + IntToStr(sy) + 'y=======!!!');
Writeln('!!!===Please Inform Me If This Worked===!!!');
Writeln('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
Result := True;
If (Click = True) Then
Begin
Mouse(sx, sy, 0, 0, True);
Wait(150);
FFlag(0);
end;
end;
end else
begin
If not (FindSymbolIn(x, y, 'quest', mmx1, mmx2, mmy1, mmy2)) Then
begin
Writeln('There are no Quest symbols here, wrong place');
Writeln('Error : Reason1 (Wrong Location)');
end;
If (FindSymbolIn(x, y, 'quest', mmx1, mmx2, mmy1, mmy2)) Then
begin
repeat
Mouse(x,y,0,0,true);
Wait(200);
If Not FindBitmap(x,y,FlagBMP) then
begin
x := x - 2;
y := y - 2;
end;
Count := Count + 1;
until (FindBitmap(x,y,FlagBMP)) or (Count >= 10);
FFlag(0);
end;
end;
FreeBitmap(FlagBMP);
end;
begin
FindDukeDoor(x,y,true);
end.
Now please, I am not yet ready for critisism, this one function is not yet completed, and is only an idea of what it should look like later on.