Procedure WillowTreesToShop; //Borrowed from Tehq's Vial Filler
var
Failsafe, x, y: Integer;
WT2S: TPointArray;
InShop: TBox;
begin
WT2S:= [Point(3718, 3874), Point(3687, 3848), Point(3675, 3810), Point(3637, 3802)];
InShop := PointToBox(Point(3631, 3793), Point(3629, 3810));
Failsafe := 0;
repeat
ClearDebug;
WriteLn('Walking to the general store...');
SPS_WalkPath(WT2S);
Inc(Failsafe);
until (PointInBox(SPS_GetMyPos, InShop)) or (Failsafe = 4);
if (Failsafe = 4) then
begin
Wait(1300 + Random(400));
if FindSymbolIn(x, y, 'store', MMX1, MMY1, MMX2, MMY2) then
Mouse(x, y, 3, 3, mouse_left);
end;
end;