Results 1 to 4 of 4

Thread: [Advanced] TPA's being a bum

  1. #1
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default [Advanced] TPA's being a bum

    Hey guys, So finally using APTA to find my IVY's in my ivy cutter.

    Only problem is it still wont find nests. I've genuinely been asking help on skype but no one understands why nests aren't being found

    Simba Code:
    program xtraivy;

    {$DEFINE SMART}
    {$i SRL\SRL.simba}
    {$i SRL/SRL/skill/woodcutting.simba}
    {$i sps/sps.simba}
    {$i SRL/SRL/Misc/Debug.simba}

      {===================================================================

         Instructions:
         1. Start by IVY (This script was written for CastleWars but it should work
              elsewhere.
         2. Make sure hatchet is equiped
         3.Leave bot to work it's magic
         4. Check every now and again as Simba hasn't done all Randoms!

            XtraIVY

            Release Date : 17/02/2012

            Author : xtrapsp

            Support: [url]http://villavu.com/forum/showthread.php?t=75528[/url]

        Changelog:
          06/03/2012 - Theres been a huge SRL Update so I'm learning source. Tweaking parts of code!
          23/02/2012 - Changed around with the Nest Settings
          20/02/2012 - Cleaned up script a bit + Setup script for addons
          17/02/2012 - Chopping done.
          18/02/2012 - Added Various antiban.
          19/02/2012 - Added elements which aren't in use yet.


       ===================================================================}


     Const
     SRLStats_Username = '';
     SRLStats_Password = '';
     NumbOfPlayers=      1;
     StartPlayer=        0;
     Debug = True;


    procedure DeclarePlayers;

    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer  := 0;

      with Players[0] do
      begin
        Name := '';
        Pass := '';
        Nick := '';
        Pin  := '';
        BoxRewards := ['amp'];
        lampSkill := SKILL_WOODCUTTING;
        Member := True;
        Active := True;
      end;

    end;

    function ClickNest: Boolean;
    var
      x, y, i, h : Integer;
      TPA : TPointArray;
      ATPA : T2DPointArray;
    begin
      if not LoggedIn then Exit;

      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.15, 0.27);
        FindColorsSpiralTolerance(x, y, TPA, 5727592, MSX1, MSY1, MSX2, MSY2, 21);
        ATPA := SplitTPAEx(TPA, 5, 5);

        if (Length(ATPA) = 0) then
        begin
          writeln('Could not find Nest colour');
          Exit;
        end;
        SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
        h := High(ATPA);
        for i := 0 to h do
        begin
          Writeln('Length: ' + IntToStr(Length(ATPA[i])));
          MiddleTPAEx(ATPA[i], x, y);
          MMouse(x, y, 4, 4);
          if WaitUpText('est', 100) then
          begin
            Writeln('Found Nest!');
            Mouse(x, y, 2, 2, True);
            Result := True;
            Wait(8000 + Random(16000));
          end else
            Writeln('Couldn''t find the right uptext for a Nest.');
            wait (100 + Random(1000));
            Makecompass('N');
        end;

      SetColorSpeed2Modifiers(0.2, 0.2);//Don't forget to reset back to default.
      ColorToleranceSpeed(1);
    end;
    Procedure AFK;
    begin
      if not loggedIn then Exit;
      Case Random (100) Of
        1..15 : Wait(1000 + Random (3050));
        16..24 : Wait (1340 + Random (1093));
        25..45: Wait (1211 + Random (6000));
        46..47: Wait (20000 + Random (10000)); // This looks like you've gone to get a drink
        48..67: BoredHuman;
      end;
    end;

    Procedure Birdsnest2;
      var
        x, y: Integer;   //IsChatBoxTextAnyLine(Text: string; TextCol: Integer): Boolean;
    begin
      if IsChatBoxTextAnyLine('A bird', 255) Then
        begin
          FindObjEx(x, y, ['ake B', 'Bird', 'nest'], [2767422, 2961972, 3818051], 5, 50, 191, 149, 354, 252);
          Mouse(x, y, 0, 0, True);
          Wait(1500+Random(500))
        end;
    end;

    procedure Invfull_bank;
    var
      myPath:TPointArray;
      BankSymbol,x,y:integer;
    begin
      if not LoggedIn then exit else
      FindNormalRandoms;
      SetColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.02, 0.07);
      if InvFull Then begin
        Writeln('Inventory full. Attempting to walk to bank in Castle Wars');
        SPS_Setup(RUNESCAPE_SURFACE,['3_10','4_10']);//SPS Areas
        myPath :=[  Point(1503, 4368), Point(1564, 4365), Point(1606, 4366),
                    Point(1635, 4355), Point(1643, 4324), Point(1648, 4300),
                    Point(1645, 4286), Point(1628, 4279), Point(1605, 4280),
                    Point(1595, 4309), Point(1575, 4280), Point(1597, 4311)];//Path
        SPS_WalkPath(myPath);
        BankSymbol := DTMFromString('mggAAAHicY2NgYAhmYmCIAOIgIPYB4kAgjgRiRUYGBjkg'+
                                    'lgJiBSBWB2JlIC4KEmY4cOAAw5bFrmCagYGR4fvbtwzYA'+
                                    'DNYFjuGAAC7xwyd');
        if FindDTM(BankSymbol,x, y,1, 1, 200, 200) then
        begin
          Writeln('looking for DTM Symbol');
          Mouse(x,y,1,1,True);
          While (IsMoving) do
          begin
            repeat
              OpenBankChestEdge(SRL_BANK_CW);
            Until(BankScreen); //there's no failsafe here, but it's fine standards wise
            DepositAll;
          end;
          Writeln('Attempting to walk to back to IVY');
          SPS_Setup(RUNESCAPE_SURFACE,['3_10','4_10','3_11']);//SPS Areas
          myPath :=  [Point(1592, 4279), Point(1635, 4279), Point(1645, 4314),
                      Point(1647, 4351), Point(1594, 4385), Point(1543, 4410),
                      Point(1517, 4372), Point(1534, 4368), Point(1505, 4370),
                      Point(1519, 4369), Point(1522, 4372), Point(1514, 4375),
                      Point(1509, 4372), Point(1518, 4372), Point(1510, 4365),
                      Point(1528, 4373)];
          SPS_WalkPath(myPath);
          (* We revert back to the defaults here. *)
          SetColorSpeed2Modifiers(0.2, 0.2);
          SetColorToleranceSpeed(1);
        end;
      end;
    end;

    function ClickIVY: Boolean;
    var
      x, y, i, h : Integer;
      TPA : TPointArray;
      ATPA : T2DPointArray;
    begin
      if not LoggedIn then Exit;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.02, 0.7);
        FindColorsSpiralTolerance(x, y, TPA, 4619873, MSX1, MSY1, MSX2, MSY2, 11);
        ATPA := SplitTPAEx(TPA, 10, 10);
        DebugATPA(ATPA, 'aptatest');

        if (Length(ATPA) = 0) then
        begin
          writeln('Could not find IVY colour');
          Exit;
        end;
        SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
        h := High(ATPA);
        for i := 0 to h do
        begin
          Writeln('Length: ' + IntToStr(Length(ATPA[i])));
          MiddleTPAEx(ATPA[i], x, y);
          MMouse(x, y, 4, 4);
          if WaitUpText('vy', 100) then
          begin
            Writeln('Found Ivy!');
            Mouse(x, y, 2, 2, True);
            Result := True;
            Wait(8000 + Random(16000));
            AFK;
          end else
            Writeln('Couldn''t find the right uptext for IVY.');
            wait (100 + Random(1000));
        end;
      SetColorSpeed2Modifiers(0.2, 0.2);//Don't forget to reset back to default.
      ColorToleranceSpeed(1);
    end;

    procedure x_Stats_Commit;
    var
    Gained: Integer;
    begin
      stats_IncVariable('Woodcutting EXP', (Gained));
      Stats_Commit;
      Writeln('Updated SRL Stats')
    end;

    Procedure ProgressReport;
      var
        startEXP, newExp, Gained : Integer;
    begin
        startExp := Players[CurrentPlayer].Integers[0];
        newExp := GetXPBarTotal;
        Gained := newExp - startExp;
        WriteLn('Exp gained: ' + ToStr(Gained));
        x_Stats_Commit;
    end;

    Procedure Antiban_Upgrade;
    var
      I: Integer;
      CurrentCompassDegree: Extended;
    begin
      I := Random(1000);
      case (I) of
        0..99 :
          begin
            GameTab(tab_Stats);
            HoverSkill('ccWoodcutting', False);
            GameTab(28);
          end;
        100..200 :
          begin
            SleepAndMoveMouse(7000 + Random(500));
            MakeCompass(CurrentCompassDegree-18+Random(32));
          end;
        200..210 :
          begin
            GameTab(Tab_Stats);
            MakeCompass(CurrentCompassDegree-2+Random(34));
            Wait(3000 + Random(500));
            GameTab(28);
          end;
        211..220 :
          begin
            BoredHuman;
            MakeCompass('N');
          end;
        221..300 :
          begin
          GameTab(Tab_Stats);
          Wait(100 + Random(1000));
          end;
      end;
    end;

    Procedure FindNest_old;
    var
      X, Y: Integer;
    Begin
      if not LoggedIn then
        Exit;
      FindNormalRandoms;

      If FindObjCustom(x, y, ['Ne', 'st'], [3290938,3883332], 5) Then
      begin
        Mouse( x, y, 2, 2, True);
        Writeln('Found a nest... Attempting to pickup');
        MakeCompass(10 + random(50));
      end;
    End;

    begin
      SMART_Server := 1;
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      ToggleXPBar(True);
      Players[CurrentPlayer].Integers[0] := GetXPBarTotal;
      Writeln('Your using XtraIvy V 2.00');
      Writeln('Please report any bugs on the thread');
      Writeln('Thanks for using the most flawless IVY script on Simba :)');
      MakeCompass('N');
      Repeat
        FindNormalRandoms;
        ClickIVY;
          Case Random (77) Of
            1..15 : Antiban_Upgrade;
          end;
      until(Not LoggedIn);
    End.

  2. #2
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Simba Code:
    program Untitled;
    //{$DEFINE SMART}
    {$I SRL/SRL.scar}
    {$I SRL/SRL/misc/debug.simba}

    const
      color = 0; //color to search for
      hmod = 0; //hue mod
      smod = 0; //sat mod
      tol = 0; //tol mod
      Adist = 0; //distance for ATPA

    var
      c : TIntegerArray;
      i : Integer;
      tpa : TPointArray;
      atpa : T2DPointArray;

    begin
     {}
     ColorToleranceSpeed(2);
     SetToleranceSpeed2Modifiers(hmod, smod);
     findcolorstolerance(tpa, col, msx1, msy1, msx2, msy2, tol);
     atpa := SplitTPA(tpa, 7);
     sortATPASize(atpa, true);
     DebugATPABounds(atpa);
     {}
    end.

    debug your tpas + atpas.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  3. #3
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Quote Originally Posted by Awkwardsaw View Post
    Simba Code:
    program Untitled;
    //{$DEFINE SMART}
    {$I SRL/SRL.scar}
    {$I SRL/SRL/misc/debug.simba}

    const
      color = 0; //color to search for
      hmod = 0; //hue mod
      smod = 0; //sat mod
      tol = 0; //tol mod
      Adist = 0; //distance for ATPA

    var
      c : TIntegerArray;
      i : Integer;
      tpa : TPointArray;
      atpa : T2DPointArray;

    begin
     {}
     ColorToleranceSpeed(2);
     SetToleranceSpeed2Modifiers(hmod, smod);
     findcolorstolerance(tpa, col, msx1, msy1, msx2, msy2, tol);
     atpa := SplitTPA(tpa, 7);
     sortATPASize(atpa, true);
     DebugATPABounds(atpa);
     {}
    end.

    debug your tpas + atpas.
    So I put the nest settings into that script and run it and check the debug window?

  4. #4
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by xtrapsp View Post
    So I put the nest settings into that script and run it and check the debug window?
    yes, it shows the atpas that it found. You could easily change it to the other debug functions, like DebugTPA and DebugATPA
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

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
  •