If my clickDeposite box procedure, I am using a function that clicks the desposite box to bank, and I picked some really good colors and it seems that all is good according to the debug form:




But instead, it hovers the mouse near the box (about 15-30 pixels away) then moves the mouse like 200-400 y pixels down and clicks!


Sometimes it succesfuly banks but this bug is really annoying and I don't know what the problem is.


Code:

Simba Code:
function ClickBox: Boolean;
var
  tmpCTS, i, L, Counter: Integer;
  ObjTPA: TPointArray;
  ObjATPA: T2DPointArray;
  X, Y, DMCount, Moves, BankCount: Integer;
begin
  //if not invfull then
 // begin
   // walkMine;
   // exit;
 // end;
  Moves := 0;
  DMCount := 0;
  tmpCTS := GetToleranceSpeed;
  SetColorToleranceSpeed(2);
  SetToleranceSpeed2Modifiers(0.33, 0.12); 6
  FindColorsTolerance(ObjTPA, 6976635, MSX1, MSY1, MSX2, MSY2, 3);
  SplitTPAWrap(ObjTPA, 10, ObjATPA);
  SortATPAFromFirstPoint(ObjATPA, Point(MSCX, MSCY))
  SetColorToleranceSpeed(tmpCTS);
  SetToleranceSpeed2Modifiers(0.02, 0.02);
  DMCount := RandomRange(3, 5);
  L := High(ObjATPA) MarkTime(Counter);
  DebugATPABounds(ObjATPA);
  while ismoving do
  wait(10);
  for i := 0 to L do
  begin
    MiddleTPAEx(ObjATPA[i], X, Y);
    repeat
      begin
        Moves := Moves + 1;
        Wait(RandomRange(25, 200));
        HumanMMouse(RandomRange(X - 6, X + 6), RandomRange(y - 6, y + 6), 0, 0);
        if (IsUpTextMultiCustom(['eposit', 'Bank', 'box'])) then
        begin
          clickmouse2(mouse_Left);
          Wait(RandomRange(25, 200));
          MarkTime(BankCount);
          if didyellowclick then break;
          repeat
            Wait(RandomRange(25, 300));
          Until (TimeFromMark(BankCount) > 3000) or(BoxScreen);
          Break;
        end;
      end;
    until (Moves > DMCount) if (TimeFromMark(Counter) > 4000) then
    begin
      Break;
    end;
  end;
  Result := False;
end;