Macrosoft
2008-08-07 23:47:49
Hi. This is a simple function that will walk to a tile by clicking on the main screen. I think TileToMS is not working right now so this shouldn't work.
function R_MSWalk(TileX, TileY, Height: Integer): Boolean;
var
MBox: Tbox;
MPoint: Tpoint;
x, y: Integer;
begin
MBox := IntToBox(MSX1, MSY1, MSX2, MSY2);
TileToMS(Tilex, Tiley, Height, MPoint.x, MPoint.y);
if(PointInBox(MPoint, MBox))then
begin
MMouse(MPoint.x, MPoint.y, 10, 5);
GetMousePos(x, y);
if(IsUpText('alk'))then Mouse(x, y, 0, 0, true)
else
begin
Mouse(x, y, 0, 0, false);
if(not(ChooseOption('alk')))then
begin
Result:=False;
Exit;
end;
end;
R_Flag;
end else
begin
WriteLn('Tile not on MS');
Result:=False;
Exit;
end;
end;