SetupSRL; is the first line of my script.
The problem is in my DFindAxe; function. I commented out everywehre that this function is called and it started working right again.
I created a custom FindAxe function because the one in SRL's Woodcutting does not state if it's in the inventory or not:
SCAR Code:
function DFindAxe : string;
var
i, bx, by : integer;
begin
if not LoggedIn then Exit
else begin
GameTab(4);
for i := 47 to 54 do begin
if FindBitmapToleranceIn(SRL_GetBitmap(i), bx, by, MIX1, MIY1, MIX2, MIY2, 5) then
Result := 'Inv'
else Result := '';
SRL_FreeBitmaps;
if not(Result = '') then Exit;
end;
if not(Result = '') then Exit
else begin
GameTab(5);
for i := 47 to 54 do begin
if FindBitmapToleranceIn(SRL_GetBitmap(i), bx, by, 569, 288, 602, 319, 5) then
Result := 'Equip'
else Result := '';
SRL_FreeBitmaps;
if not(Result = '') then Exit;
end;
end;
end;
end;
I'll try rewriting this function to use DTMs instead of bitmaps to find the axe.
**Edit**
Rewriting this function worked. However, now it's starting to go back into the loop??
The loop happens right after a tree disapears:
SCAR Code:
if DFindYew then begin
WriteLn('Yew Found');
Mouse(Cx, Cy, 0, 0, True);
Flag;
Wait(500 + Random(300));
FindNormalRandoms;
FindEnt(x, y, True);
MarkTime(Mark);
while (TimeFromMark(Mark) < (15000 + Random(10000))) and
(FindColorTolerance(x, y, 4489077, MSX1, MSY1, MSX2, MSY2, 10)) and
not InvFull do begin
case Random(5) of
0 : DAntiBan;
1 : Sleep(200 + Random(300));
2 : Sleep(300 + Random(400));
3 : Sleep(400 + Random(500));
4 : FindEnt(x, y, True);
end;
FindNormalRandoms;
Wait(100 + Random(500));
if not (FindColorTolerance(x, y, 4489077, MSX1, MSY1, MSX2, MSY2, 10)) and
(DGetLoc = 'Yew1') then begin
MarkTime(Tree1);
DGoToYew(2);
end;
if not (FindColorTolerance(x, y, 4489077, MSX1, MSY1, MSX2, MSY2, 10)) and
(DGetLoc = 'Yew2') then begin
MarkTime(Tree2);
DGoToYew(1);
end;
end;
end;