turbobk
2008-09-06 00:15:30
Hey guys,
This little sexy function will walk anywhere in a Box of Tiles, as long as they are on the MM.
So for example,
If I wanted to walk into this Shop,

I would make the compass WEST to get the proper box.
Then get the x1, y1 Tiles from the green dot, and get the x2, y2 Tiles from the blue dot.
It will then make an invisible box, and click anywhere inside of it.
I had to make this for the script im making, and it is also usefull, so I released it. :)
Hope you like,
If you can think of anything I missed, then please tell me.
Thanks,
TurboBk. :)
This little sexy function will walk anywhere in a Box of Tiles, as long as they are on the MM.
{*******************************************************************************
Function: WalkBox(TileX1, TileY1, TileX2, TileY2, Click, FFlag): Boolean;
By: TurboBk.
Description: Will click anywhere in the box on the MM, defined by, x1 y1 x2 y2.
Click = (1 - LeftClick, 2 - RightClick, 3 - NoClick).
Flag = FFlag.
*******************************************************************************}
Function WalkBox(x1, y1, x2, y2: Integer; Click: Integer; Flag: Integer): Boolean;
Var
P: TPoint;
Y, Z: TPoint;
Begin
If Not LoggedIn Then Exit;
P := GetMyPos;
If PointInBox(P, IntToBox(x1, y1, x2, y2)) Then
Begin
Result := True;
Exit;
End;
Y := TileToMM(IntToPoint(x1, y1));
Z := TileToMM(IntToPoint(x2, y2));
MouseBox(Y.x, Y.y, Z.x, Z.y, Click);
Wait(200 + Random(200)); // Edit
FFlag(Flag);
P := GetMyPos;
If PointInBox(P, IntToBox(x1, y1, x2, y2)) Then
Begin
Result := True;
Exit;
End;
End;
So for example,
If I wanted to walk into this Shop,

I would make the compass WEST to get the proper box.
Then get the x1, y1 Tiles from the green dot, and get the x2, y2 Tiles from the blue dot.
It will then make an invisible box, and click anywhere inside of it.
I had to make this for the script im making, and it is also usefull, so I released it. :)
Hope you like,
If you can think of anything I missed, then please tell me.
Thanks,
TurboBk. :)