SRL Archive - Reflection Development

Object Finder


Nava2

2008-08-18 17:27:15

Use Bobarkinators Object finding, unless you do want to still kick it oldschool kinda with this.

Okay, this works great, but its not perfect. Also, it uses colors not UID's (h)

{*******************************************************************************
function FindObjREF(var x, y: integer; TileX, TileY, TileH, Color, Length, Height, PointRef, Tol: integer; UpText: TStringArray): boolean;
By Nava2
Description: Finds an object using reflection for accuracy. Length and Height
are of the object, and the PointRef is for the area around the MSTile Point to search around.
*******************************************************************************}

function FindObjREF(var x, y: integer; TileX, TileY, TileH, Color, Length, Height, PointRef, Tol: integer; UpText: TStringArray): boolean;

var
I, H, CTS : integer;
P : TPoint;
Pts : TPointArray;
PtsA : T2DPointArray;

begin
P := Point(TileX, TileY);
if (DistanceFrom(P) > 5) then
begin
if not TileOnMM(P) then
begin
Writeln('Could not find object, exiting.');
Exit;
end;
WalkToTile(P, 0, 0);
R_FFlag(1);
Wait(75 + random(50));
end;
P := TileToMS(P, TileH);
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(P.x, P.y, Pts, Color, P.x - PointRef, P.y - PointRef, P.x + PointRef, P.y + PointRef, tol);
Writeln(IntToStr(GetArrayLength(Pts)));
PtsA := SplitTPAEx(Pts, Length, Height);
H := High(PtsA);
for I := 0 to H do
begin
P := MiddleTPA(PtsA[I]);
MMouse(P.x, P.y, 4, 4);
Wait(90 + Random(50));
if IsUpTextMultiCustom(UpText) then
begin
Result := true;
break;
end;
end;
if Result then
GetMousePos(x, y)
else
Writeln('Did not find object.');
ColorToleranceSpeed(CTS);
end;

Feel free to use, just credit.

NiCbaZ

2008-08-19 07:18:49

looks good, good!!!

Naike

2008-08-19 07:44:37

Ahh Nava2 you got me there ^^ Thought it was with UID's >=),
Still it looks good could be useful..

Nava2

2008-08-19 11:27:14

From: N1ke!
Ahh Nava2 you got me there ^^ Thought it was with UID's >=),
Still it looks good could be useful..


It works flawlessly without UID's. So, until the long wait is over, this will work well.

Nava2

2008-08-24 14:55:43

So, this is outdated. Don't use, learn the new way. It dominates this.

Bobarkinator

2008-08-24 15:04:46

From: Nava2
So, this is outdated. Don't use, learn the new way. It dominates this.


No. This is still good and is fine to be used.