This is the procedure that should repeat but its not. (Will post other functions)
It goes to the first dot and picks up the item, then click the second dot on the MM and then the script ends. Not sure why. Probably something obvious.
Simba Code:
procedure blah;
var
count: integer;
begin
repeat
if (FindDot) then
begin
while (IsMoving) do
begin
Wait(1000+Random(250));
end;
end;
count := InvCount
if Not(IsMoving) then
if (FindItem) and (WaitInvCount(count +1, 5000, ExactCT)) then
Writeln('Got it');
until (not FindDot) or (InvCount = 7) or (not FindItem);
end;
Simba Code:
function FindDot: Boolean;
var
P: TPointArray;
ATPA: array of TPointArray;
begin
P := getminimapdots('red');
ATPA := SplitTPAEx(P, 5, 5);
SortATPAFromFirstPoint(ATPA, Point(MMCX,MMCY));
DeBugATPABounds(ATPA);
for i := 0 to Low(ATPA) do
begin
if (GetArrayLength(ATPA) < 0) then
Exit;
MiddleTPAEx(ATPA[i], x, y);
HumanMMouse(x,y, 2, 2);
ClickMouse2(True);
{if DeBug then Writeln('Found dots, flag present');
if (IsMoving) then
repeat
if DeBug then Writeln('Still Moving');
Wait(500 +Random(750));
until(WaitNotMoving(true) or not FlagPresent);
if DeBug then Writeln('Not moving, should be on dot');}
Result := True;
Exit;
end;
end;
function FindItem: Boolean;
var
CTS: Integer;
TPA: TPointArray;
ATPA: array of TPointArray;
begin
if (not (LoggedIn)) then
Exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2); //.25 .33
SetColorSpeed2Modifiers(0.06 ,0.39);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 9254494, MSX1, MSY1, MSX2, MSY2, 20);
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
RAaSTPA(TPA, 5);
ATPA := SplitTPAEx(TPA, 15, 15);
SortATPAFromFirstPoint(ATPA, Point(MSCX,MSCY)); //just changed from MSY1 to MSCY maybe the problem??
DeBugATPABounds(ATPA);
for i := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
HumanMMouse(x, y, 2, 2);
if WaitUpTextMulti(['Pick', 'Item'], 400) then
if DeBug then Writeln('Found Item');
ClickMouse2(True);
Result := True;
Exit;
end;
end;