SCAR Code:
function FindPick: Boolean;
var
c, XH, YH, dx, dy, ex, ey, x, y, cts: Integer;
EC: TBox;
begin // checks for Blue ClickToContinue, but doesnt handle ClickToContinue.
result := true;
if FindColor(x, y, 16711680, 182, 439, 346, 457) then
begin
if FindNPCChatText('Pickaxe', Nothing) then // check for word PickAxe
begin
if InvFull then // First make some space for PickAxeHead
begin
if (FindBitmapSpiralTolerance(Ore, x, y, MIx1, MIy1, MIx2, MIy2, 50)) then
begin
Mouse(x, y, 5, 5, False);
ChooseOption('Drop');
end;
end;
case Wielding of // switch to appropriate GameTab;
True:
begin
GameTab(5);
EC.x1 := 570; EC.y1 := 287; EC.x2 := 603; EC.y2 := 320;
end;
False:
begin
GameTab(4);
EC.x1 := MIx1; EC.y1 := MIy1; EC.x2 := MIx2; EC.y2 := MIy2;
end
end;
if FindBitmapMaskTolerance(BrokenPick, dx, dy, EC.x1, EC.y1, EC.x2, EC.y2, 10, 10) then
begin // Broken Pickaxe Handler
NoPick := True;
case Random(5) of
0: TypeSend('arg');
1: TypeSend('aarg');
2: TypeSend('arghh');
3: TypeSend('dam');
4: TypeSend('sjee.');
end;
Result := False;
Exit;
end;
if FindBitmapMaskTolerance(PickAxeHandle, dx, dy, EC.x1, EC.y1, EC.x2, EC.y2, 10, 10) then
begin // PickHead & Handle Handler
GameTab(4);
repeat
if not (LoggedIn) then Exit;
x := Random(510) + 5;
y := Random(330) + 5;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
if (FindColorSpiralTolerance(x, y, hc1, MSx1, MSy1, MSx2, MSy2, 10)) or
(FindColorSpiralTolerance(x, y, hc2, MSx1, MSy1, MSx2, MSy2, 10)) or
(FindColorSpiralTolerance(x, y, hc3, MSx1, MSy1, MSx2, MSy2, 10)) or
(FindColorSpiralTolerance(x, y, hc4, MSx1, MSy1, MSx2, MSy2, 10)) or
(FindColorSpiralTolerance(x, y, hc5, MSx1, MSy1, MSx2, MSy2, 10)) then
begin
MMouse(x, y, 2, 2);
if IsUpTextMultiCustom(['Take', 'pick', 'head']) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
end;
FFlag(0);
Wait(1000 + Random(100));
end;
c := c + 1;
until ((FindBitmapMaskTolerance(PickAxeHead, x, y, MIx1, MIy1, MIx2, MIy2, 10, 10))
or (c >= 10));
ColorToleranceSpeed(cts);
if not FindBitmapMaskTolerance(PickAxeHead, x, y, MIx1, MIy1, MIx2, MIy2, 10, 10) then
begin
NoPick := True;
Result := False;
Exit;
end;
end;
// Attach
if Wielding then
begin
GameTab(5);
if FindBitmapMaskTolerance(PickAxeHandle, Xh, Yh, 560, 280, 615, 322, 10, 10) then
begin
WriteLn('Found Handle');
Mouse(Xh + 5, Yh + 11, 2, 2, True); // remove the handle, if any.
end;
end;
Wait(500);
GameTab(4);
Wait(500);
if FindBitmapMaskTolerance(PickAxeHead, dx, dy, MIx1, MIy1, MIx2, MIy2, 10, 10)
and FindBitmapMaskTolerance(PickAxeHandle, ex, ey, MIx1, MIy1, MIx2, MIy2, 10, 10) then
begin
Mouse(dx, dy, 0, 0, True);
Wait(1000 + Random(100));
Mouse(ex + 5, ey + 11, 2, 2, True);
PickAxeAttached := PickAxeAttached + 1;
WriteLn('Attached Head & Handle');
NoPick := False;
Result := True;
if Wielding then
begin
Wait(3000);
if FindColor(dx, dy, hc1, MIx1, MIy1, MIx2, MIy2) then
Mouse(dx, dy, 0, 0, True);
end;
end;
end;
end;
end;