Results 1 to 8 of 8

Thread: learning tpa

  1. #1
    Join Date
    Mar 2008
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default learning tpa

    so im going to learn color and use it in tpas.

    Problem is..
    Every tutorial ive done so far ended up failing..
    After realizing they are from 2008 etc.
    And things were outdated =\

    Anyone know a current tut?

    something 2010+ mybe lol

  2. #2
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    what are you trying to do?
    (:
    I'd be happy to help. Also any thread by n3ss3s about TPA's would be good.

    http://villavu.com/forum/showthread.php?t=21786
    Last edited by footballjds; 03-30-2011 at 02:48 PM.

  3. #3
    Join Date
    Mar 2008
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Trying to click a giant rat.

    I just need a working example.
    Even a tree clicking one.



    Just none of them seem to work. =\

  4. #4
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    I will make you one. Can you give me 10 mins? im at work lol.

  5. #5
    Join Date
    Mar 2008
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    2am.
    I'm sure i'll survive for 10 more minutes.
    Thankyou!
    I appreciate it.

  6. #6
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    SCAR Code:
    program New;
    {.include SRL\SRL.scar}

    function AutoColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      R, G, B: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.03, 0.39);

      FindColorsSpiralTolerance(MSCX, MSCY, arP, 5608325, MSX1, MSY1, MSX2, MSY2, 13);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToRGB(arC[i], R, G, B);

        if (R >= 93) and (R <= 167) and (G >= 101) and (G <= 183) and (B >= 64) and (B <= 115) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);

          if (X >= 10.30) and (X <= 35.51) and (Y >= 12.24) and (Y <= 42.80) and (Z >= 6.80) and (Z <= 22.32) then
          begin
            Result := arC[i];
            Writeln('AutoColor = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    function FindTreeColors: TPointArray;
    var
      x, y: integer;
    begin
      FindColorsSpiralTolerance(x, y, result, AutoColor, MSX1, MSY1, MSX2, MSY2, 3);
      Writeln(Length(result));
      for x := 0 to high(result) do
      begin
        MoveMouse(result[x].x, result[x].y);
        wait(1000);
      end;
    end;

    begin
      SetupSRL;
      FindTreeColors;
    end.
    Stand by a tree.
    Worst way to use TPA's but you didn't ask for the best

  7. #7
    Join Date
    Mar 2008
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    *High 5's iTry*

    Okay cool.
    The structure is what i was struggling with.

    =D
    thx

    hhaha
    never ending clicks.
    took me a while to figure out how to stop it
    Last edited by beats-; 03-30-2011 at 03:40 PM.

  8. #8
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Simba Code:
    Function FindIrons: TPointArray;
    var
      TPAA: array of TPointArray;
      TPA: TPointArray;
      CTS, I: Integer;
    begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.22, 0.23);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2964577, 20, 20, MSX2 - 20, MSY2 - 20, 3);
      TPAA := TPAToATPAEx(TPA, 20, 19);//Creats a 2D tpa 20 by 19 big
      for I := 0 To High(TPAA) do
        if GetArrayLength(TPAA[i]) > 7 then
        begin
          SetArrayLength(Result, GetArrayLength(Result) + 1);
          Result[High(Result)] := MiddleTPA(TPAA[i]);
        end;
      SortTPAFrom(Result, IntToPoint(259, 160));
      SetColorSpeed2Modifiers(0.2, 0.2);
      ColorToleranceSpeed(cts);
    end;

    taken out of my old varrock east miner.
    that is legit there,
    i don't remember even writing that code o.O

    That converts a TPA to an ATPA, Checks to see if there are 7 or more points

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
  •