Results 1 to 9 of 9

Thread: PreciseTPA DepositBox Clicking.

  1. #1
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default PreciseTPA DepositBox Clicking.

    As you see in the picture below
    A lot of TPA's, and I tried to narrow them down, but the Deposit color isn't unique enough.
    It even highlight the bankers

    What I was wondering is how I could get my ATPA to only click on the depositbox, since it will hover 2 times now, bankers then the desk on my right side.

    Since I'm not always ending in that exact position. I'm not only searching for the left side. This is for learning purposes too, for further causes. So I would know how to filter the objects I don't need.




    Simba Code:
    function OpenDepositBoxCustom:Boolean;
    var
      TooLong, x, y, i, H, CTS :Integer;
      TPA: TpointArray;
      ATPA: T2DPointArray;

    begin

      if Depositscreen then
      begin
        Result := True;
        Exit;
      end;

      Marktime(Toolong)

      CTS := GetToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.48,0.08);

      if FindColorsTolerance(TPA, 6381925, MSX1, MSY1, MSX2, MSY2, 12)  then
        begin

           SetColorToleranceSpeed(CTS);
           SetToleranceSpeed2Modifiers(0.02, 0.02);

           SplitTPAExWrap(TPA, 20, 20, ATPA);
           SortATPAFromMidPoint(ATPA, Point(MSCX, MSCY));
           SortATPASize(ATPA, True);
          // Smart_DebugATPA(True, ATPA);

           H := High(ATPA)

           begin
            for i:=0 to H do
            begin
              MiddleTpaEx(ATPA[i], x, y);
              HumanMMouse(x, y, 10, 10)
              if WaitUptextMulti(['Dep','pos', 'box'] , 800) then
              begin
                Fastclick(True);
                if WaitFunc(@DepositScreen, 100, 3000) then
                begin
                  Result :=True;
                  Exit;
                end;
              end;
            end;
           end;
       end;
    end;

    Creds to DannyRS for this wonderful sig!

  2. #2
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    I edited the one i put in the includes, all i did was change the 2 colours

    Simba Code:
    (*
    OpenDepositBox
    ~~~~~~~~~~~~~~

    .. code-block:: pascal

        function OpenDepositBox : Boolean;

    Opens the light deposit box (such as the boxes in edgeville).

    .. note::

        Author: Ollybest

    Example:

    .. code-block:: pascal

      if (OpenDepositBox) then
        DepositAll;
    *)

    function OpenDepositBox: Boolean;
    var
      i, CTS, c, Timeout: Integer;
      TPA, TPA1, TPA2: TPointArray;
      ATPA: T2DPointArray;
      P: TPoint;
    begin
      Result := (DepositScreen);
      if not (LoggedIn) or (Result) then
        Exit;

      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      Timeout := 5000 + Random(1000);

      // getting the dark edge
      SetColorSpeed2Modifiers(0.06, 0.27);
      FindColorsTolerance(TPA1, 1002342, MSX1, MSY1, MSX2, MSY2, 4);
      // getting the light middle
      SetColorSpeed2Modifiers(0.53, 0.57);
      FindColorsTolerance(TPA2, 6184802, MSX1, MSY1, MSX2, MSY2, 8);

      SetColorSpeed2Modifiers(0.2, 0.2);
      ColorToleranceSpeed(CTS);

      // combining and sorting
      CombineTPAWrap(TPA1, TPA2, TPA);
      SplitTPAWrap(TPA, 5, ATPA);
      SortATPASize(ATPA, True);

      if Length(TPA) < 1 then
        Exit;

      for i := 0 to High(ATPA) do
        if Length(ATPA[i]) > 30 then
        begin
          P := MiddleTPA(ATPA[i]);
          MMouse(P.X, P.Y, RandomRange( -5, 5), RandomRange( -5, 5));
          if WaitUpTextMulti(['Deposit Bank', 'deposit box', 'osit bo', 'eposit '], 400 + Random(100)) then
          begin
            ClickMouse2(True);
            Flag;
            MarkTime(c);
            repeat
              Wait(RandomRange(50, 100));
            until (DepositScreen) or (PinScreen) or (TimeFromMark(C) > Timeout);
            Result := (DepositScreen) or (PinScreen);
            if (Result) then
              Exit;
          end;
        end;
    end;

  3. #3
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Ollybest View Post
    I edited the one i put in the includes, all i did was change the 2 colours

    Simba Code:
    (*
    OpenDepositBox
    ~~~~~~~~~~~~~~

    .. code-block:: pascal

        function OpenDepositBox : Boolean;

    Opens the light deposit box (such as the boxes in edgeville).

    .. note::

        Author: Ollybest

    Example:

    .. code-block:: pascal

      if (OpenDepositBox) then
        DepositAll;
    *)

    function OpenDepositBox: Boolean;
    var
      i, CTS, c, Timeout: Integer;
      TPA, TPA1, TPA2: TPointArray;
      ATPA: T2DPointArray;
      P: TPoint;
    begin
      Result := (DepositScreen);
      if not (LoggedIn) or (Result) then
        Exit;

      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      Timeout := 5000 + Random(1000);

      // getting the dark edge
      SetColorSpeed2Modifiers(0.06, 0.27);
      FindColorsTolerance(TPA1, 1002342, MSX1, MSY1, MSX2, MSY2, 4);
      // getting the light middle
      SetColorSpeed2Modifiers(0.53, 0.57);
      FindColorsTolerance(TPA2, 6184802, MSX1, MSY1, MSX2, MSY2, 8);

      SetColorSpeed2Modifiers(0.2, 0.2);
      ColorToleranceSpeed(CTS);

      // combining and sorting
      CombineTPAWrap(TPA1, TPA2, TPA);
      SplitTPAWrap(TPA, 5, ATPA);
      SortATPASize(ATPA, True);

      if Length(TPA) < 1 then
        Exit;

      for i := 0 to High(ATPA) do
        if Length(ATPA[i]) > 30 then
        begin
          P := MiddleTPA(ATPA[i]);
          MMouse(P.X, P.Y, RandomRange( -5, 5), RandomRange( -5, 5));
          if WaitUpTextMulti(['Deposit Bank', 'deposit box', 'osit bo', 'eposit '], 400 + Random(100)) then
          begin
            ClickMouse2(True);
            Flag;
            MarkTime(c);
            repeat
              Wait(RandomRange(50, 100));
            until (DepositScreen) or (PinScreen) or (TimeFromMark(C) > Timeout);
            Result := (DepositScreen) or (PinScreen);
            if (Result) then
              Exit;
          end;
        end;
    end;
    Thanks!!

    Creds to DannyRS for this wonderful sig!

  4. #4
    Join Date
    Jul 2012
    Posts
    279
    Mentioned
    5 Post(s)
    Quoted
    46 Post(s)

    Default

    Something you can add to make your TPAs more accurate is minimum and maximum length/width/height. It's actually quite simple and remarkably effective. In your loop, you can add things like:

    For length:

    Simba Code:
    if (Length(ATPA[a]) < Obj.Length) then
          Continue;

    For width and height:

    Simba Code:
    B := GetTPABounds(ATPA[a]);
    if ((B.X2 - B.X1) < Obj.Width) or ((B.Y2 - B.Y1) < Obj.Height) then
      Continue;
    if Obj.MaxWidth > 0 then
      If ((B.X2 - B.X1) > Obj.MaxWidth) then
        Continue;

    Etc.

    I often find this method to be much more effective and time efficient than scrupulous colour picking.

    Here is the info I use for bank booths and it works like a charm at the place I use it.:

    Simba Code:
    with BankBooth do
       begin
        Col := 5008776;
        Tol := 10;
        Hue := 1.0;
        Sat := 1.0;
        Length := 100;
        Width := 20;
        Height := 5;
        UpText := 'Bank'
       end;

    As you can see, I really didn't make -any- effort with tol, hue and sat. It's a time saver, really.

  5. #5
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Wardancer View Post
    Something you can add to make your TPAs more accurate is minimum and maximum length/width/height. It's actually quite simple and remarkably effective. In your loop, you can add things like:

    For length:

    Simba Code:
    if (Length(ATPA[a]) < Obj.Length) then
          Continue;

    For width and height:

    Simba Code:
    B := GetTPABounds(ATPA[a]);
    if ((B.X2 - B.X1) < Obj.Width) or ((B.Y2 - B.Y1) < Obj.Height) then
      Continue;
    if Obj.MaxWidth > 0 then
      If ((B.X2 - B.X1) > Obj.MaxWidth) then
        Continue;

    Etc.

    I often find this method to be much more effective and time efficient than scrupulous colour picking.

    Here is the info I use for bank booths and it works like a charm at the place I use it.:

    Simba Code:
    with BankBooth do
       begin
        Col := 5008776;
        Tol := 10;
        Hue := 1.0;
        Sat := 1.0;
        Length := 100;
        Width := 20;
        Height := 5;
        UpText := 'Bank'
       end;

    As you can see, I really didn't make -any- effort with tol, hue and sat. It's a time saver, really.
    Thanks! Will practice using this, very useful ^^

    Creds to DannyRS for this wonderful sig!

  6. #6
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Maybe combine the brown and grey color and exlude the TPAs which are less that MinPoints and more than MaxPoints. This is what I usually do.
    Simba Code:
    SortATPASize(ATPA,False);
    for i:=0 to High(ATPA) do
    begin
      if High(ATPA[i]) > MaxPoints then
        Break;
    end;
    if i = 0 then Exit;
    SetArrayLength(ATPA,i);

    InvertATPA(ATPA);
    for i:=0 to High(ATPA) do
    begin
      if High(ATPA[i]) < MinPoints then
        Break;
    end;
    if i = 0 then Exit;
    SetArrayLength(ATPA,i);

  7. #7
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Shatterhand View Post
    Maybe combine the brown and grey color and exlude the TPAs which are less that MinPoints and more than MaxPoints. This is what I usually do.
    Simba Code:
    SortATPASize(ATPA,False);
    for i:=0 to High(ATPA) do
    begin
      if High(ATPA[i]) > MaxPoints then
        Break;
    end;
    if i = 0 then Exit;
    SetArrayLength(ATPA,i);

    InvertATPA(ATPA);
    for i:=0 to High(ATPA) do
    begin
      if High(ATPA[i]) < MinPoints then
        Break;
    end;
    if i = 0 then Exit;
    SetArrayLength(ATPA,i);
    What's the quicket/easiest way to determin how many points the tpa has?

    Creds to DannyRS for this wonderful sig!

  8. #8
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    What's the quicket/easiest way to determin how many points the tpa has?
    Length(TPA). Actually I used High(TPA) which is Length(TPA)-1. It does not matter.

  9. #9
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Thanks for the help guys!

    Creds to DannyRS for this wonderful sig!

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
  •