noidea
2009-05-28 00:31:49
program New;
{.include srl/srl.scar}
(* Colour Key [Static Colours] *)
// - Gray - 3026478
// - Green - 9764763
// - Black - 65536
// - DarkRed - 65917
// - LightRed - 205052
// - LightGray - 11382189
Function FindFlag(var x, y: Integer): Boolean;
var
TPA: TPointArray;
i, AL, Mark: Integer;
begin
if not loggedin then exit;
MarkTime(Mark);
FindColorsSpiralTolerance(mmcx, mmcy, TPA, 205052, mmx1, mmy1, mmx2, mmy2, 0);
If Length(TPA) < 1 then
exit;
AL := GetArrayLength(TPA);
For i := 0 to AL - 1 do
begin
If GetColor(Tpa[i].x + 2, Tpa[i].y) = 3026478 then
if GetColor(Tpa[i].x + 1, Tpa[i].y - 1) = 9764763 then
begin
Result := True;
x := Tpa[i].x;
y := Tpa[i].y;
Writeln('Took: '+inttostr(TimeFromMark(Mark))+' ms');
writeln('Try ['+inttostr(i)+']: Flag Present at ('+inttostr(Tpa[i].x)+', '+inttostr(Tpa[i].y)+')');
exit;
end;
end;
end;
Function FlagPresent: Boolean;
var x, y: Integer;
begin
result := FindFlag(x, y);
end;
begin
setupsrl;
Writeln(BoolTostr(FindFlag));
end.New Flag Present.
FindFlag - Don't tell me it's slow. It's actually really fast. Added the x and y for things like FlagDistance() and teh actuall FFlag. And ofcourse the writeln's could be removed.
I dunno. I thought I would give it a shot.