Results 1 to 3 of 3

Thread: TPA Help

  1. #1
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Question TPA Help

    So I've been working on getting into TPAs because apparently they're only the coolest thing ever and I want to be an SRL member. So I whipped up a TPA test script to find a color, then left click on it and choose an option. Can anybody tell me what's wrong with my TPA?

    Simba Code:
    program TPAtest;
    {$Define SMART}
    {$I SRL/SRL.Simba}

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Pin  :=''
      Players[0].Active:=True;
    end;

    procedure FindThing;
    var
      X, Y, i: Integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;

    begin
      begin
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.97, 3.83);
        if FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4211012, MSX1, MSY1, MSX2, MSY2, 6) then
          begin
            SplitTPAExWrap(TPA, 4, 4, ATPA);
            if Length(ATPA) > 0 then
              begin
                SortATPASize(ATPA, True);
                MiddleTPAEx(ATPA[0], X, Y);
                MMouse(X, Y, RandomRange(-2, 2), RandomRange(-2, 10));
                if WaitUpTextMulti(['anker', 'nker', 'ker'], 500) then
                  begin
                    case Random(7) of
                      0..4: ClickMouse2(1);
                      5..6: begin
                              ClickMouse2(0);
                              WaitOptionMulti(['ank', 'nk'], 500);
                            end;
                    end;
                  end;
              end;
            end;
       end;
    end;

    begin
      SMART_FIXSPEED := True;
      SRL_SixHourFix:= True;
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
        repeat
          FindThing;
        until (False);
    end.

    It only seems to hover over grey minimized action bar.
    You have permission to steal anything I've ever made...

  2. #2
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,164
    Mentioned
    26 Post(s)
    Quoted
    433 Post(s)

    Default

    Try reading this: http://villavu.com/forum/showthread.php?t=49089

    And get a complete understanding of TPA's (Just incase you don't). Then you should be able to learn to figure out your own errors.

    They are under the Advanced Section.

    Good luck!

  3. #3
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    well lets go through it step by step.

    1. your standards are off and honestly are annoying to me XD.

    2.
    Simba Code:
    ColorToleranceSpeed(2);
    SetColorSpeed2Modifiers(0.97, 3.83);

    good your using cts 2, but u need to revert back to the previous cts once your done finding your colors. (you never do this)

    3.
    Simba Code:
    SplitTPAExWrap(TPA, 4, 4, ATPA);
    if Length(ATPA) > 0 then
    begin
    good, u now have a working atpa, but you do something not needed: you check the length of your ATPA. If the original colors finding function does not return any points, then you wont enter the if statement. if you dont enter the if statement, u cant get to this point. the only way that ATPA<=0 is if the colors are not found. hope that made sense.

    4.
    Simba Code:
    SortATPASize(ATPA, True);
    MiddleTPAEx(ATPA[0], X, Y);
    MMouse(X, Y, RandomRange(-2, 2), RandomRange(-2, 10));
    ok you are sorting from biggest to smallest, but only looking at 1 of your tpas. so essentially, w/e is your biggest tpa found in your ATPA is the ONLY one that you will mmouse to.

    5. now you are being incredibly unclear on what your issue is. i figured out that you wish to find a banker (using the uptext line) and i will assume that since the banker should be bigger than the little skill square, it should go to the banker. the only thing that i can think of that would cause this issue with your code is an inaccurate color/tol. make sure u r using aca to find the best mods/color/tol for your color.
    Last edited by x[Warrior]x3500; 03-24-2013 at 11:29 PM.

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
  •