SRL Archive - SRL Archives

New Flag stuff.


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.

NCDS

2009-05-28 00:36:53

They don't look bad at all.

But what is the point of 'FlagPresent' if it is the same exact thing as 'FindFlag'?

Just Curious :o

Naike

2009-05-28 00:40:49

Seems like rs did some updates to the static colors?
More then just flag.

Finally some stuff that can be updated :o

noidea

2009-05-28 00:41:00

From: NCDS
They don't look bad at all.

But what is the point of 'FlagPresent' if it is the same exact thing as 'FindFlag'?

Just Curious :o


FindFlag returns the x, y values used for like FlagDistance, and things like in the FFlag() procedure.

Quickmarch

2009-05-28 00:42:48


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;

Why not?


Function FindFlag(var x, y: Integer): Boolean;
begin
Result := FindColor(x, y, 255, MMX1, MMY1, MMX2. MMY2);
end;

noidea

2009-05-28 00:49:13

From: Quickmarch

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;

Why not?


Function FindFlag(var x, y: Integer): Boolean;
begin
Result := FindColor(x, y, 255, MMX1, MMY1, MMX2. MMY2);
end;


Alot of graphic updates happened today, and 255 is nolonger the colour of teh flag. The flag has several colours now, and a gray stem.

Quickmarch

2009-05-28 00:57:12

From: noidea
Alot of graphic updates happened today, and 255 is nolonger the colour of teh flag. The flag has several colours now, and a gray stem.


Ahh ok. :) Havn't played rs recently. :p