The Function
SCAR Code:
Function WalkPath(Dir: String): boolean;
var
Path, OnMap: TPointArray;
BankTile: TTile;
ThePoint: TPoint;
i: integer;
begin
SetLength(Path, 40);
SetLength(OnMap, 1);
Path := LoadPath;
BankTile := Tile(3093, 3490);
repeat
if(not(R_LoggedIn))then
if(not(LoggedInBB))then
begin
Players[CurrentPlayer].Active := False;
LogOut;
end;
if(TileOnMM(BankTile))then
begin
ThePoint := TileToMM(BankTile);
Mouse(ThePoint.x, ThePoint.y, 3, 3, true);
Wait(100 + random(50));
R_Flag;
Result := True;
Exit;
end;
for i := 0 to 40 do
begin
ThePoint := TileToMM(Tile(Path[i].x, Path[i].y));
if(PointInBox(ThePoint, IntToBox(mmx1, mmy1, mmcx, mmy2)))then
begin
OnMap[High(OnMap)] := ThePoint;
SetLength(OnMap, High(OnMap) + 2);
end;
end;
if(Length(OnMap) = 0)then
begin
Result := False;
Exit;
end;
if(Dir = 'N')then
SortTPAFrom(OnMap, IntToPoint(mmcx, mmy1))
else
SortTPAFrom(OnMap, IntToPoint(mmcx, mmy2));
ThePoint := OnMap[0];
if(ThePoint.x > 0) and (ThePoint.y > 0)then
begin
Mouse(ThePoint.x, ThePoint.y, 3, 3, true);
Wait(100 + random(50));
R_FFlag(10);
end else
begin
Result := False;
Exit;
end;
until(false)
end;
The error is this line
SCAR Code:
ThePoint := TileToMM(Tile(Path[i].x, Path[i].y));
And I'm using Simba.