Results 1 to 11 of 11

Thread: findcolorsSpiralTolerance, TPA, ATPA, T2DPointArray.

  1. #1
    Join Date
    Jan 2013
    Posts
    146
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default findcolorsSpiralTolerance, TPA, ATPA, T2DPointArray.

    I am trying to write a find bank procedure sine the built in one doesn't want to work for me.
    I found this tut by camel and it was super useful sending me in the right direction.

    but some of it doesnt work anymore, specifically the function that would have been most useful to me.

    I have it noted in the simba code at bottom.

    the first thing that came to mind was something like
    Simba Code:
    while length.ATPA > 0 do
       ATPA.deleteIndex(1);
    but i'm not sure how or if i can get the length of an ATPA.


    i found a temporary fix that would work for this specific compass position, camera angle, and zoom.

    what could i do instead?
    is there a better way i should go about doing this?


    Simba Code:
    procedure findbank;
    var
      x,y : Integer;
      TPA, bTPA : TPointArray;
      ATPA : T2DPointArray;
    begin

      findColorsSpiralTolerance(x, y, TPA, 2181468, mainScreen.getBounds(), 2, colorSetting(2, 4.56, 3.37));
      if (Length(TPA) < 1) then
      begin
        WriteLn('Failed to find bank counter colors');
        Exit;
      end;
      ATPA := TPA.toATPA(55, 20);
      ATPA.sortFromMidPoint(Mainscreen.playerPoint);
      FilterTPAsBetween(ATPA,1,200);
      ATPA.deleteIndex(1);   // this is what i use for this specific instance to filter to the only one i want.
      ATPA.deleteIndex(1);   //  since there are only 3 total given the right camera angle it works.
      //ATPA.excludePointsDist(0, 500 , TRSMainscreen.playerPoint.x, TRSMainscreen.playerPoint.y);  // this is what i found in tutorial but it doesnt work anymore.

      SmartImage.debugATPA(ATPA);
      //SmartImage.debupTPA(bTPA);

    end;

    Im Back... Previously known as Megaleech
    [Herbalife]

  2. #2
    Join Date
    Feb 2015
    Posts
    422
    Mentioned
    41 Post(s)
    Quoted
    226 Post(s)

    Default

    Quote Originally Posted by Saint//+ View Post
    I am trying to write a find bank procedure sine the built in one doesn't want to work for me.
    I found this tut by camel and it was super useful sending me in the right direction.

    but some of it doesnt work anymore, specifically the function that would have been most useful to me.

    I have it noted in the simba code at bottom.

    the first thing that came to mind was something like
    Simba Code:
    while length.ATPA > 0 do
       ATPA.deleteIndex(1);
    but i'm not sure how or if i can get the length of an ATPA.


    i found a temporary fix that would work for this specific compass position, camera angle, and zoom.

    what could i do instead?
    is there a better way i should go about doing this?


    Simba Code:
    procedure findbank;
    var
      x,y : Integer;
      TPA, bTPA : TPointArray;
      ATPA : T2DPointArray;
    begin

      findColorsSpiralTolerance(x, y, TPA, 2181468, mainScreen.getBounds(), 2, colorSetting(2, 4.56, 3.37));
      if (Length(TPA) < 1) then
      begin
        WriteLn('Failed to find bank counter colors');
        Exit;
      end;
      ATPA := TPA.toATPA(55, 20);
      ATPA.sortFromMidPoint(Mainscreen.playerPoint);
      FilterTPAsBetween(ATPA,1,200);
      ATPA.deleteIndex(1);   // this is what i use for this specific instance to filter to the only one i want.
      ATPA.deleteIndex(1);   //  since there are only 3 total given the right camera angle it works.
      //ATPA.excludePointsDist(0, 500 , TRSMainscreen.playerPoint.x, TRSMainscreen.playerPoint.y);  // this is what i found in tutorial but it doesnt work anymore.

      SmartImage.debugATPA(ATPA);
      //SmartImage.debupTPA(bTPA);

    end;
    The more important question is, why aren't the built in ones working!! Also TRSMainScreen is the Type of the record. To use it, do mainScreen.playerPoint.X and mainScreen.playerPoint.Y

    EDIT:

    This is the custom bank finder I use.

    Simba Code:
    function customBanker(): Boolean;
    var
      x, y, i: integer;
      ATPA: T2DPointArray;
      TPA: TPointArray;
    begin
      if bankScreen.isOpen() then
        exit(True);
    //Gather Colors and put them in TPA
      findColorsSpiralTolerance(x, y, TPA, CustomBankCol, mainScreen.getBounds(), CustomBankTol, colorSetting(2,CustomBankHue,CustomBankSat));
    //Checks length of TPA
      if (Length(TPA) < 1) then
        exit(false);
    //Converts to ATPA with bounds 25 by 25 and sorts them by a random point in the player box
      ATPA := TPA.toATPA(25, 25);
      ATPA.sortFromMidPoint(mainScreen.playerBox.getRandomPoint);
    //Filters out the smaller ones
      FilterTPAsBetween(ATPA,1,110);
    //moves the mouse over each ATPA and checks the over text, will left click if it matches
    //the result of the function is the result of bankScreen.isOpen()
      for i := 0 to high(ATPA) do
      begin
        mouse(ATPA[i].getBounds().getRandomPoint());
        wait(gaussRangeInt(80,150));
        if isMouseOverText(['hest','anker','ank','booth']) then
        begin
          fastClick(MOUSE_LEFT);
          result := bankScreen.isOpen(gaussRangeInt(2000,4000));
        end;
      end;
    end;

    If you find something hard to understand, let me know!

  3. #3
    Join Date
    Jan 2013
    Posts
    146
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by fady View Post
    The more important question is, why aren't the built in ones working!! Also TRSMainScreen is the Type of the record. To use it, do mainScreen.playerPoint.X and mainScreen.playerPoint.Y

    EDIT:

    This is the custom bank finder I use.

    Simba Code:
    function customBanker(): Boolean;
    var
      x, y, i: integer;
      ATPA: T2DPointArray;
      TPA: TPointArray;
    begin
      if bankScreen.isOpen() then
        exit(True);
    //Gather Colors and put them in TPA
      findColorsSpiralTolerance(x, y, TPA, CustomBankCol, mainScreen.getBounds(), CustomBankTol, colorSetting(2,CustomBankHue,CustomBankSat));
    //Checks length of TPA
      if (Length(TPA) < 1) then
        exit(false);
    //Converts to ATPA with bounds 25 by 25 and sorts them by a random point in the player box
      ATPA := TPA.toATPA(25, 25);
      ATPA.sortFromMidPoint(mainScreen.playerBox.getRandomPoint);
    //Filters out the smaller ones
      FilterTPAsBetween(ATPA,1,110);
    //moves the mouse over each ATPA and checks the over text, will left click if it matches
    //the result of the function is the result of bankScreen.isOpen()
      for i := 0 to high(ATPA) do
      begin
        mouse(ATPA[i].getBounds().getRandomPoint());
        wait(gaussRangeInt(80,150));
        if isMouseOverText(['hest','anker','ank','booth']) then
        begin
          fastClick(MOUSE_LEFT);
          result := bankScreen.isOpen(gaussRangeInt(2000,4000));
        end;
      end;
    end;

    If you find something hard to understand, let me know!
    Thanks, this makes more sense, I guess i didn't need to remove the other arrays in the first place, just loop through them.

    i'm kind of glad they're not working... if they were i would have never needed to learn to do this.

    Im Back... Previously known as Megaleech
    [Herbalife]

  4. #4
    Join Date
    Feb 2015
    Posts
    422
    Mentioned
    41 Post(s)
    Quoted
    226 Post(s)

    Default

    Quote Originally Posted by Saint//+ View Post
    Thanks, this makes more sense, I guess i didn't need to remove the other arrays in the first place, just loop through them.

    i'm kind of glad they're not working... if they were i would have never needed to learn to do this.
    Sorry, I seem to have missed a very important part in my example,

    Simba Code:
    //the result of the function is the result of bankScreen.isOpen()
      for i := 0 to high(ATPA) do
      begin
        mouse(ATPA[i].getBounds().getRandomPoint());
        wait(gaussRangeInt(80,150));
        if isMouseOverText(['hest','anker','ank','booth']) then
        begin
          fastClick(MOUSE_LEFT);
          result := bankScreen.isOpen(gaussRangeInt(2000,4000));
          break;    //<------ this part, to break out of the loop once we have found the bank!!
        end;
      end;
    end;

  5. #5
    Join Date
    Jan 2013
    Posts
    146
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by fady View Post
    Sorry, I seem to have missed a very important part in my example,

    Simba Code:
    //the result of the function is the result of bankScreen.isOpen()
      for i := 0 to high(ATPA) do
      begin
        mouse(ATPA[i].getBounds().getRandomPoint());
        wait(gaussRangeInt(80,150));
        if isMouseOverText(['hest','anker','ank','booth']) then
        begin
          fastClick(MOUSE_LEFT);
          result := bankScreen.isOpen(gaussRangeInt(2000,4000));
          break;    //<------ this part, to break out of the loop once we have found the bank!!
        end;
      end;
    end;
    lol, i seen it. thanks :P

    Im Back... Previously known as Megaleech
    [Herbalife]

  6. #6
    Join Date
    Feb 2013
    Posts
    342
    Mentioned
    8 Post(s)
    Quoted
    110 Post(s)

    Default

    Are you at Shantay Pass?
    I always have trouble with that one.

  7. #7
    Join Date
    Jan 2013
    Posts
    146
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by GetHyper View Post
    Are you at Shantay Pass?
    I always have trouble with that one.
    I tried a few locations.

    Edgeville, GE, Varrock, Burth.
    and was having trouble at all of them. i got varrock east to work a little bit, if made the camera zoom in and move to a certain angle. but it still wasnt very reliable.

    Im Back... Previously known as Megaleech
    [Herbalife]

  8. #8
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    180
    Mentioned
    14 Post(s)
    Quoted
    101 Post(s)

    Default

    Quote Originally Posted by Saint//+ View Post
    I tried a few locations.

    Edgeville, GE, Varrock, Burth.
    and was having trouble at all of them. i got varrock east to work a little bit, if made the camera zoom in and move to a certain angle. but it still wasnt very reliable.
    Edgeville always works perfectly for me, but I use BANK_NPC_BLUE and it usually never fails to find the bankers at edgeville, this should also work well with the ones in the Varrock bank since they're also blue. The GE banker colors are wonky and I dont recommend using that included one, if you really need to use the GE bankers, I recommend trying to write your own.

  9. #9
    Join Date
    Jan 2013
    Posts
    146
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by Adieux View Post
    Edgeville always works perfectly for me, but I use BANK_NPC_BLUE and it usually never fails to find the bankers at edgeville, this should also work well with the ones in the Varrock bank since they're also blue. The GE banker colors are wonky and I dont recommend using that included one, if you really need to use the GE bankers, I recommend trying to write your own.
    Thanks for the info. between what i had before and what i grabbed from fady, mines working pretty great now.

    Im Back... Previously known as Megaleech
    [Herbalife]

  10. #10
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Saint//+ View Post
    I tried a few locations.

    Edgeville, GE, Varrock, Burth.
    and was having trouble at all of them. i got varrock east to work a little bit, if made the camera zoom in and move to a certain angle. but it still wasnt very reliable.
    We really need to update those. It's probably been 1.5 years since the banker colours were adjusted.

  11. #11
    Join Date
    Aug 2012
    Posts
    188
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    To your length.atpa question, its length(ATPA), or you can use high(ATPA) to get the highest index in the array, useful for loops.

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
  •