SCAR Code:
{*******************************************************************************
function FindHead: Boolean;
By: Liquid and Starblaster100
Description: Will check if the axehead is still on the axe handle. If not, it
will start to look for the head and if it finds it, it will reattach
the head
*******************************************************************************}
function FindHead: Boolean;
var
c, AxeHeadDTM, Tries, x, y: Integer;
hStart: Boolean;
begin
AxeHeadDTM := DTMFromString('78DA63CC62626078C180021C2312191E02694' +
'620FE0F048C694035CF18D000231209A473816A9E12A1E6150135' +
'A94035AF09A801B9F9090135994498930C54F392809A3CCCF0415' +
'70300FB8311DF');
GameTab(4);
Result := True;
c := CreateBitmapMaskFromText('You do not have an axe', SmallChars);
if (FindBitmapMaskTolerance(c, x, y, 17, 410, 495, 452, 10, 85)) then
begin
if ((EquipAxe = False) and
not (GetColor(590, 220) = Head) or
not (GetColor(587, 219) = Head2) or
not (GetColor(588, 218) = Head3)) then
hStart := True;
if (EquipAxe) then
begin
GameTab(5);
Wait(200 + Random(200));
if not (GetColor(597, 294) = Head) or
not (GetColor(600, 295) = Head2) or
not (GetColor(599, 298) = Head3) then
begin
hStart := True;
Mouse(592, 297, 2, 2, True);
Wait(1000);
end;
end;
end;
if (hStart = True) then
begin
Result := False;
Tries := 0;
repeat
if not LoggedIn then Exit;
if (FindDTM(AxeHeadDTM, x, y, 550, 200, 745, 465)) then
Break;
if not (FindObjMulti('Take', Head, Head2, Head3, 5)) then
begin
Tries := Tries + 1;
WriteLn('Axe head not found. Taken ' + IntToStr(tries) + ' tries');
Status('Axe Head not found - Rotating Screen');
KeyDown(VK_LEFT);
Wait(1000 + Random(1000));
KeyUp(VK_LEFT);
Wait(400 + Random(300));
if not FindObjMulti('Take', Head, Head2, Head3, 5) then
begin
Status('Axe Head not found - Moving to Red Dot');
x := 648;
y := 83;
FindColorSpiral(x, y, 241, 570, 5, 725, 155)
Mouse(x + 3, y + 3, 2, 2, True);
Flag;
Wait(500 + Random(300));
end;
end;
if FindObjMulti('Take', Head, Head2, Head3, 5) then
begin
Status('Found Axe Head');
WriteLn('Axe head was found. Picking it up');
Wait(450 + Random(400));
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Flag;
Wait(500 + Random(300));
end;
until (tries > 9) or
(FindDTM(AxeHeadDTM, x, y, 550, 200, 745, 465))
if not (tries > 9) then
if (AttachHead) then
Result := True;
end;
FreeBitmap(c);
FreeDTM(AxeHeadDTM);
end;