SCAR Code:
Tilee := MMCoordToTile(Point(TPA.x, TPA.y));
Tilee := TileToMM(tilee);
mouse(tilee.x, tilee.y, 5, 5, true);
The above code snippet will change the point into a tile, and then proceed to click it.
SCAR Code:
function MMCoordToTile(OurPoint: TPoint): TTile;
var
PlayerPos: TTile;
NewTileX, NewTileY: Integer;
begin
if (OurPoint.x > MMCX) then
NewTileX := OurPoint.x - MMCX
else if (OurPoint.x < MMCX) then
NewTileX := MMCX - OurPoint.x
else if (OurPoint.x = MMCX) then
NewTileX := 0;
if (OurPoint.y > MMCY) then
NewTileY := OurPoint.y - MMCY
else if (OurPoint.y < MMCY) then
NewTileY := MMCY - OurPoint.y
else if (OurPoint.y = MMCY) then
NewTileY := 0;
PlayerPos := GetMyPos;
Writeln('Current position is ' + IntToStr(PlayerPos.x) + ', '
+ IntToStr(PlayerPos.y) + '.');
if (OurPoint.x > MMCX) then
NewTileX := PlayerPos.x + NewTileX
else if (OurPoint.x < MMCX) then
NewTileX := PlayerPos.x - NewTileX
else if (OurPoint.x = MMCX) then
NewTileX := PlayerPos.x;
if (OurPoint.y > MMCY) then
NewTileY := PlayerPos.y + NewTileY
else if (OurPoint.y < MMCY) then
NewTileY := PlayerPos.y - NewTileY
else if (OurPoint.y = MMCY) then
NewTileY := PlayerPos.y;
Writeln('Point position is ' + IntToStr(NewTileX) + ', '
+ IntToStr(NewTileY) + '.');
Result := Tile(Round(NewTileX+1.5), Round(NewTileY-0.5));
end;