jimmy_mac
2009-12-13 08:41:11
What do you think of this. Converts an x,y location on the minimap to a TPoint x,y location on the main screen.
Heres an example:
Function MiniMap2MainScreen(x, y : Integer) : TPoint;
begin
if inRange(x, 602, 652) and inRange(y, 68, 99) then
begin
result.x := round((x - 601) * 10.66666);
result.y := round((y - 67) * 10.77419);
end;
end; Heres an example:
var
Example:TPoint;
x, y: Integer;
begin
if FindColorTolerence(x, y, 66281, 602, 68, 652, 99, 0) then
Begin
Example := MiniMap2MainScreen(x, y);
SetAngle(True);
Mouse(Example.x, Example.y, 0, 0, true);
Writeln('Found and Clicked.');
end else Writeln('Didnt find the color you were looking for.');
end;
Anyway, let me know what you think. If theres already a function like this, dont flame ;)
I've updated it a bit since the first one up the top, changed the numbers a tiny bit. but its still got the general gist of things.