SCAR Code:
procedure PickFlax;
var
x, y, a, b : Integer;
begin
if (FindObjCustom(x, y, ['Pick','Flax','ick','lax'], [Flax1,Flax2,Flax3], 8)) then
begin // ^^Finds the flax and stores coords in x, y
MMouse(x, y, 3, 3); //Move mouse to where we already are with random 3
Status('Picking Flax');
GetMousePos(a, b); //saves coords into a, b again? useless?
repeat
Mouse(a, b, 10, 10, True); //Click the mouse with a huge random on a spot with flax (hopefully?)
Wait(50+random(250));
FFlag(0);
{there is no looping using the same coordinates here! it will keep resetting a, b because of your
until line below this}
until (not(FindObjCustom(a, b, ['Pick','Flax','ick','lax'], [Flax1,Flax2,Flax3], 8)))
if (InvFull) then Exit; //!!!
end;
end;
The line with exclamation points next to it will most likely never be run. FindObjCustom will almost never be false simply because there will be flax on the screen all of the time. So in essence you've created an endless loop.
Randoms on that Mouse are way too high. That gives it a high probability of missing the flax entirely and just clicking next to it.