SRL Archive - SRL Archives

function WalkToCoordMS(x, y: Integer): Boolean;


Home

2009-09-29 03:01:01

Hey, i have no idea if this already exists. But this will use MS to walk MinimapCoords.

{*******************************************************************************
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

senrath

2009-09-29 03:02:22

Um, what's with PointEx? Point already does the exact same thing.

Home

2009-09-29 03:05:05

From: senrath
Um, what's with PointEx? Point already does the exact same thing.


Ohh i didn't know :P I tried to use Point but it said Duplicate Idenfiters or something :)
So i created this one :P

My bad

~Home

marpis

2009-09-29 23:08:58

I have this in my Firemaker

procedure MSWalk(X, Y, RX, RY: Integer);
var
Left: Boolean;
begin
MMouse(X, Y, RX, RY);
GetMousePos(X, Y);
Left := WaitUpText('alk here', 50 + random(20));
Mouse(X, Y, 0, 0, Left);
if (not Left) then
WaitOption('alk here', 1000 + random(200));
Wait(500 + Random(200));
Flag;
end;

EDIT: Me so stooped, your's converts MM to MS ^^ Excellent idea!

Home

2009-09-30 13:31:42

From: marpis
I have this in my Firemaker

procedure MSWalk(X, Y, RX, RY: Integer);
var
Left: Boolean;
begin
MMouse(X, Y, RX, RY);
GetMousePos(X, Y);
Left := WaitUpText('alk here', 50 + random(20));
Mouse(X, Y, 0, 0, Left);
if (not Left) then
WaitOption('alk here', 1000 + random(200));
Wait(500 + Random(200));
Flag;
end;

EDIT: Me so stooped, your's converts MM to MS ^^ Excellent idea!


Yeah :) Thanks for comment :)
This is good for like Loaction checking and for distance between like Door and so on :)

~Home