SRL Archive - SRL Snippets

[OSR] ReturnDTMPointsMS


Sin

2013-04-14 16:53:34

function ReturnDTMPointsMS(DTM:Integer):TPointArray;
var
i,x,y:Integer; //515 x 327
t:TBoxArray;
begin
SetLength(t,100);
SetLength(Result,1);
t := Grid(10, 10, 52, 33, 50, 33, point(26, 26));
for i := 0 to 99 do
begin
if (FindDTM(DTM,x,y,t[i].X1,t[i].Y1,t[i].X2,t[i].Y2)) then
begin
Result[Length(Result)] := Point(x,y);
SetLength(Result, Length(Result) + 1);
end;
end;
end;

Returns a TPA of points it finds on the mainscreen.

Olly

2013-04-14 17:21:03

what is the grid for? also findDTMs may help ;)

Sin

2013-04-14 17:40:30

The grid separates the main screen into boxes.

Turpinator

2013-04-16 01:52:47

From: Ollybest
what is the grid for? also findDTMs may help ;)

Clarifying… I believe the grid separates the main screen into boxes, then searches for a dtm in each box. I presume this is so if you were using a very small dtm, it would/might not appear many times in the same region?

Olly

2013-04-16 11:28:40

Actually iirc it only searches for the main point in the area.

Frement

2013-04-16 11:36:22

And where would you use this function?

Sin

2013-04-16 14:06:02

From: Frement
And where would you use this function?

Someone on IRC wanted it.

John

2013-04-16 18:03:31

It could be helpful looting? Just define which squares to search to avoid false positives.