Results 1 to 4 of 4

Thread: TPA looting help

  1. #1
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default TPA looting help

    I'm trying to make a before and after TPA of the Red MM dots of loot in the Ancient cavern, it should combine the two then delete the duplicate portions leaving only the new loot points. It goes through and sets the loot points and I can tell because of the writeln's, but it doesnt actually have a length because it stops at
    Simba Code:
    if GetArrayLength(LootTPA[i]) > 0 then

    Simba Code:
    procedure FightFiends;
    Var
      BeforeKillTPA, AfterKillTPA: TPointArray;
    begin
      if not Fighting then
        KillFiends;
      if Fighting then
      begin
         BeforeKillTPA := GetMMDotsOnMS('red')
          writeln('getting before kill TPA');
        MarkTime(x);
        repeat
          Eating;
          wait(RandomRange(150, 260));
        until ((TimeFromMark(x) >= 45000) or not Fighting);
        wait(RandomRange(5000, 6000));
        AfterKillTPA := GetMMDotsOnMS('red');
          writeln('getting after kill TPA');
        wait(RandomRange(250, 300));
      end;
    end;

    Procedure Looting2;
      var
        BeforeKillTPA, AfterKillTPA, LootTPA: TPointArray;
        L, i:integer;
        LootPoint: TPoint;
      begin
        writeln('looting');
       LootTPA := combinetpa(BeforeKillTPA, AfterKillTPA)
       cleardoubletpa(LootTPA);
       L := High(LootTPA) for i := 0 to L do
          if GetArrayLength(LootTPA[i]) > 0 then
            begin
            writeln('looting2');
             LootPoint := MMToMSEx(0, 2, LootTPA[i]);
             MMouse(LootPoint.x, LootPoint.y, 1, 1);
             ClickMouse2(False);
             if WaitOptionMulti(['ater orb', 'Rune helm', 'eaweed', 'attlestaff', 'eath rune', 'charm', 'Snape'], 350) then
              begin
                FFlag(1);
                While IsMoving Do Wait(RandomRange(25, 50));
                exit;
              end;
            end;
      end;





    begin
      SetupSRL;
      DeclarePlayers;
      MouseSpeed := 25;
      DeclareDTMz;
      AddOnTerminate('FreeDTMz');
      Init;
      repeat
        if not LoggedIn then
        begin
          LogInPlayer;
          wait(RandomRange(1000, 6000));
        end;
        if not NeedToBank and AtCave then
        begin
          repeat
            FightFiends;
            Looting2;
          until (GoToBank);
        end;
        if AtBank and NeedToBank then
        begin
          OpenZBank;
          DoBanking;
        end;
        if not AtBank and NeedToBank then
        begin
          GetToBank;
          OpenZBank;
          DoBanking;
        end;
        if not NeedToBank and not AtCave then
        begin
          WalkToRing;
          UseFairyRing;
        end;
      until (False);
    end.

  2. #2
    Join Date
    Apr 2013
    Location
    England
    Posts
    223
    Mentioned
    2 Post(s)
    Quoted
    106 Post(s)

    Default

    your TPA's are local variables ... should they not be global? when you call your looter, beforeKill and afterKill are not assigned any values ... so your lootTPA has a length of 0 and so the if statement is not entered

  3. #3
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by EngageTheRage View Post
    your TPA's are local variables ... should they not be global? when you call your looter, beforeKill and afterKill are not assigned any values ... so your lootTPA has a length of 0 and so the if statement is not entered
    Thanks <3 I should have known :P

  4. #4
    Join Date
    Apr 2013
    Location
    England
    Posts
    223
    Mentioned
    2 Post(s)
    Quoted
    106 Post(s)

    Default

    Quote Originally Posted by King View Post
    Thanks <3 I should have known :P
    no worries, only noticed because i did the same thing yesterday with some of my variables :/ took me an age to figure it out! lol

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
  •