Home
2009-09-29 03:01:01
Hey, i have no idea if this already exists. But this will use MS to walk MinimapCoords.
~Home
{*******************************************************************************
function PointEx(x, y : Integer): TPoint;
By: Home
Description: Turns a Integers to TPoint.
*******************************************************************************}
function PointEx(x, y: Integer): TPoint;
begin
Result.x := X;
Result.y := y;
end;
{*******************************************************************************
function PointInMS(Point :TPoint) :Boolean;
By: Home
Description: Checks is Point in MS.
*******************************************************************************}
function PointInMS(Point: TPoint): Boolean;
begin
Result := PointInBox(Point, IntToBox(MSX1, MSY1, MSX2, MSY2));
end;
{*******************************************************************************
function WalkToCoordMS(x, y :Integer) :Boolean;
By: Home
Description: Walks to the coord using the MS.
*******************************************************************************}
function WalkToCoordMS(x, y: Integer): Boolean;
var ScreenCoord: TPoint;
begin
ScreenCoord := MMToMS(PointEx(x, y));
if not PointInMS(ScreenCoord) then Exit;
MMouse(ScreenCoord.x + 20, ScreenCoord.y, 0, 0);
GetMousePos(ScreenCoord.x, ScreenCoord.y);
if WaitUpText('alk her', 300) then begin
Mouse(ScreenCoord.x, ScreenCoord.y, 0, 0, True);
Result := True;
end
else
begin
Mouse(ScreenCoord.x, ScreenCoord.y, 0, 0, False);
Result := WaitOption('alk her', 300);
end;
end;~Home