Hey I made two woodcutting functions for a script I am making and I realized that they are actually pretty dang useful. One, called IsChopping returns true if you are actually cutting a tree and false if you aren't. The other, IsChopped, figures out if you are done cutting down the tree. While pretty useless by themselves (since they use the text that comes up), together they make a powerful tool that allows you to wait between cutting without having to guess how long it will take to cut down a tree. Simple yet efficient. If there are any bugs or possibilities I forgot let me know!
SCAR Code:
function IsChopping: Boolean;
begin
FixChat;
if ((FindBlackChatMessage('You do not have an axe which you have the woodcutting level to use.')) or (FindBlackChatMessage('You need a Woodcutting level of'))) then
begin
Result := False;
end;
if (FindBlackChatMessage('You swing your axe at the tree')) then
begin
Result := True;
end else
begin
Result := False;
end;
end;
SCAR Code:
function IsChopped: Boolean;
begin
FixChat;
if (FindColorTolerance(x, y, 16711680, MIx1, MIy1, MIx2, MIy2, 5)) then
begin
Mouse(x, y, 10, 1, True);
end;
if (FindBlackChatMessage('You get some logs.')) then
begin
Result := True;
end else
begin
Result := False;
end;
end;
Here is a sample on how you can use them in combination (used after you pick and click on a tree):
SCAR Code:
if (IsChopping) then
begin
repeat
Wait(500+random(150));
until(IsChopped);
end;