Results 1 to 6 of 6

Thread: FindPick!

  1. #1
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default FindPick!

    Okay, well SRL's current FindPick uses the colors got with FindPickHeadColors from inventory with zero tolerance to find the pick head that started to fly - ever wondered where did all those pick heads end up while you were testing your powerminer?

    QuickFix:

    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;

  2. #2
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    if FindColor(x, y, 16711680, 182, 439, 346, 457) then
    Can be replaced with if ClickContinue(False,False) then ...

    False, False finds the text, but will not wait for it, nor click on it.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  3. #3
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Harry read...


    a) I said this is a QuickFix
    b) That was already in SRL
    c) I fixed what is need to be fixed, no style stuffs fixed...

  4. #4
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    I think this needs more attention if what you're written is correct. (About the pickaxe heads.) Nice work!

    I.. Don't really have so much more to say about this. Devs should really take a look. Maybe for REV15 this will be included, who knows?

  5. #5
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Well I once asked Wizzup did he commit it... /check... Well he has a strong opinion about "bbl"

  6. #6
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    Well I once asked Wizzup did he commit it... /check... Well he has a strong opinion about "bbl"
    I just committed it.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •