My mouse gets stuck on the lamp in the Guild Mine (Ok, i know I'm releasing too many scripts but come on, give me a chance here ;p) So it has problems mining coal....I tried making it avoid the lamps my going south. But i need a better idea...

should i do SplitTPA to TPAtoATPAEx....



SCAR Code:
function FindOres: Boolean;
var
  CTS, I, OreColor: Integer;
  OreTPA: TPointArray;
  OreATPA: T2DPointArray;
begin
  if (Players[CurrentPlayer].Strings[0] = 'Both') then
  begin
    OreColor := MithrilOre;
    CTS := GetColorToleranceSpeed;
    ColorToleranceSpeed(2);
    FindColorsSpiralTolerance(MSCX, MMCY, OreTPA, OreColor, MSX1, MSY1, MSX2, MSY2, 5);
    if (Length(OreTPA) < 1) then Exit;
    OreATPA := SplitTPA(OreTPA, 15);
    for I := 0 To High(OreATPA) do
    If MiddleTPAEX(OreATPA[i], x, y) then
    begin
      MMouse(x, y, 0, 0);
      Wait(400 + Random(265));
      if (IsUpText('ine')) then
      begin
        GetMousePos(X, Y);
        Result := True;
        Exit;
      end;
    end;
  end;
  if (Players[CurrentPlayer].Strings[0] = 'Coal') or (Players[CurrentPlayer].Strings[0] = 'Both') then
  begin
    OreColor := CoalOre;
    CTS := GetColorToleranceSpeed;
    ColorToleranceSpeed(2);
    FindColorsSpiralTolerance(MSCX, MMCY, OreTPA, OreColor, MSX1, MSY1, MSX2, MSY2, 5);
    if (Length(OreTPA) < 1) then Exit;
    OreATPA := SplitTPA(OreTPA, 15);
    for I := 0 To High(OreATPA) do
    If MiddleTPAEX(OreATPA[i], x, y) then
    begin
      MMouse(x, y, 0, 0);
      Wait(400 + Random(265));
      if (IsUpText('ine')) then
      begin
        GetMousePos(X, Y);
        Result := True;
        Exit;
      end
      else
        Exit;
    end;
  end;
end;