Basically i just want it to cycle through each inventory spot and click any grimy herbs in inventory once, but what happens is it will go through and do that but when there are no grimy herbs left it goes back and clicks the ones that have already been clicked, just waiting for runescape to do the magic and make them cleaned... so any help appreciated on how i can achieve this

Simba Code:
Procedure CleanHerbs;

var
  x, y, t1, t2, t3, t4, i: Integer;

begin
  for i:= 1 to 28 do
  begin
    t1:= InvBox(i).X1
    t2:= InvBox(1).Y1
    t3:= Invbox(i).X2
    t4:= InvBox(i).Y2
    writeln(inttostr(t1))
    if findDTM(Grimy, x, y, t1, t2, t3, t4) the
      Mouse(x, y, 5, 5, True);
  end;
  Writeln('No grimy herbs present.');
end;