Issue: Open collectbox

  1. issueid=400 02-11-2015 08:44 PM
    SRL Junior Member
    Open collectbox

    I noticed we have collectbox functions but we don't have a function for actually opening the collectbox screen.
    bankscreen.openbank functions only open the bank, but can we get an extra argument to choose to open the collectbox instead?
    Unless it already exists, in which case i'm stoopid.
Issue Details
Issue Number 400
Issue Type Feature
Project SRL Bugs and Suggestions
Status On Hold
Votes for this feature 1
Votes against this feature 0
Assigned Users (none)
Tags (none)




  1. 02-11-2015 11:09 PM
    The Academic
    It could be added relatively easily. About 4/5 functions would need to be modified. I'll put it on the to-do list.

    E: Quite a few other bugs to fix. I'll put this on hold until I or someone else gets the time.
  2. 03-09-2015 08:50 AM
    SRL Member
    Any way I can help? Also need this myself.
  3. 03-09-2015 10:03 AM
    The Academic
    Quote Originally Posted by lovebotter
    Any way I can help? Also need this myself.
    Not without understanding bankscreen.simba, which is pretty complicated if you don't know what you're doing ;) You're best bet would be to make a custom bank finder and just MOUSE_RIGHT -> chooseOption( )

    I'm really busy IRL atm so can't do any coding :(
  4. 03-09-2015 02:34 PM
    SRL Member
    Code:
    function TRSBankScreen.__openGE(): Boolean;
    
      function findBankerAreas(): TBoxArray;
      var
        TPA: TPointArray;
        ATPA: T2DPointArray;
        i: Integer;
        b: TBox;
      begin
        FindColorsTolerance(TPA, 6580588, MainScreen.GetBounds(), 5, ColorSetting(2, 2.09, 0.55));
        ATPA := ClusterTPAEx(TPA, 5, 5);
    
        for i := 0 to High(ATPA) do
        begin
          if (Length(ATPA[i]) < 100) then
            Continue;
    
          b := GetTPABounds(ATPA[i]);
    
          if (b.getWidth() < 15) or (b.getHeight() < 15) or
             (b.getWidth() > 220) or (b.getHeight() > 220) or
             (ATPA[i].getDensity() < 0.10) then
            Continue;
    
          b.Expand(10);
          b.setLimit(MainScreen.getBounds());
    
          Result := Result + b;
        end;
      end;
    
      function findBanker(const Area: TBox): Boolean;
      var
        tFace, TPA: TPointArray;
        aFace, ATPA: T2DPointArray;
        i, j: Integer;
        b: TBox;
        p: TPoint;
      begin
        if (not FindColorsTolerance(tFace, 5408694, Area, 15, ColorSetting(2, 0.18, 0.67))) then
          Exit(False);
    
        aFace := ClusterTPAEx(tFace, 3, 3);
        SortATPAFromMidPoint(aFace, MiddleBox(Area));
    
        for i := 0 to High(aFace) do
          if (Length(aFace[i]) > 4) and (Length(aFace[i]) < 50) then
          begin
            p := MiddleTPA(aFace[i]);
            b := intToBox(p.x - 12, p.y, p.x + 12, p.y + 30);
    
            if (not FindColorsTolerance(TPA, 11382432, b, 9, ColorSetting(2, 5.57, 0.48))) then
              Continue();
    
            ATPA := ClusterTPAEx(TPA, 4, 4);
            SortATPASize(ATPA, True);
    
            for j := 0 to High(ATPA) do
            begin
              if (Length(ATPA[j]) < 15) then
                Continue();
    
              mouse(ATPA[j].getMiddle().randRange(-4, 5));
    
              if (isMouseOverText(['Bank Banker', 'ank Bank'])) then
              begin
                fastClick(MOUSE_LEFT);
    
                if (minimap.isFlagPresent(Random(300, 600))) then
                  minimap.waitFlag(10);
    
                Result := _waitBankOrPinScreen(Random(4000, 5000));
                if (Result) then
                  Exit(True);
             end;
            end;
          end;
      end;
    
    var
      i: Integer;
      Boxes: TBoxArray;
    begin
      Result := False;
      Boxes := findBankerAreas();
    
      if (Length(Boxes) = 0) then
        Exit(print('bankScreen.__openGE(): Found no possible area''s for a banker to be in', False));
    
      SortBoxesFromMidPoint(Boxes, MainScreen.playerPoint);
    
      for i := 0 to High(Boxes) do
        if (FindBanker(Boxes[i])) then
          Exit(print('bankScreen.__openGE(): Succesfully opened the GE bank', True, '', TDebug.DEBUG));
    end;
    I edit the
    ' fastClick(MOUSE_LEFT);'
    Line to rightclick, chose option It should be able to open the collect box at the GE banker?
  5. 03-10-2015 03:02 AM
    The Academic
    Quote Originally Posted by lovebotter
    Code:
    function TRSBankScreen.__openGE(): Boolean;
    
      function findBankerAreas(): TBoxArray;
      var
        TPA: TPointArray;
        ATPA: T2DPointArray;
        i: Integer;
        b: TBox;
      begin
        FindColorsTolerance(TPA, 6580588, MainScreen.GetBounds(), 5, ColorSetting(2, 2.09, 0.55));
        ATPA := ClusterTPAEx(TPA, 5, 5);
    
        for i := 0 to High(ATPA) do
        begin
          if (Length(ATPA[i]) < 100) then
            Continue;
    
          b := GetTPABounds(ATPA[i]);
    
          if (b.getWidth() < 15) or (b.getHeight() < 15) or
             (b.getWidth() > 220) or (b.getHeight() > 220) or
             (ATPA[i].getDensity() < 0.10) then
            Continue;
    
          b.Expand(10);
          b.setLimit(MainScreen.getBounds());
    
          Result := Result + b;
        end;
      end;
    
      function findBanker(const Area: TBox): Boolean;
      var
        tFace, TPA: TPointArray;
        aFace, ATPA: T2DPointArray;
        i, j: Integer;
        b: TBox;
        p: TPoint;
      begin
        if (not FindColorsTolerance(tFace, 5408694, Area, 15, ColorSetting(2, 0.18, 0.67))) then
          Exit(False);
    
        aFace := ClusterTPAEx(tFace, 3, 3);
        SortATPAFromMidPoint(aFace, MiddleBox(Area));
    
        for i := 0 to High(aFace) do
          if (Length(aFace[i]) > 4) and (Length(aFace[i]) < 50) then
          begin
            p := MiddleTPA(aFace[i]);
            b := intToBox(p.x - 12, p.y, p.x + 12, p.y + 30);
    
            if (not FindColorsTolerance(TPA, 11382432, b, 9, ColorSetting(2, 5.57, 0.48))) then
              Continue();
    
            ATPA := ClusterTPAEx(TPA, 4, 4);
            SortATPASize(ATPA, True);
    
            for j := 0 to High(ATPA) do
            begin
              if (Length(ATPA[j]) < 15) then
                Continue();
    
              mouse(ATPA[j].getMiddle().randRange(-4, 5));
    
              if (isMouseOverText(['Bank Banker', 'ank Bank'])) then
              begin
                fastClick(MOUSE_LEFT);
    
                if (minimap.isFlagPresent(Random(300, 600))) then
                  minimap.waitFlag(10);
    
                Result := _waitBankOrPinScreen(Random(4000, 5000));
                if (Result) then
                  Exit(True);
             end;
            end;
          end;
      end;
    
    var
      i: Integer;
      Boxes: TBoxArray;
    begin
      Result := False;
      Boxes := findBankerAreas();
    
      if (Length(Boxes) = 0) then
        Exit(print('bankScreen.__openGE(): Found no possible area''s for a banker to be in', False));
    
      SortBoxesFromMidPoint(Boxes, MainScreen.playerPoint);
    
      for i := 0 to High(Boxes) do
        if (FindBanker(Boxes[i])) then
          Exit(print('bankScreen.__openGE(): Succesfully opened the GE bank', True, '', TDebug.DEBUG));
    end;
    I edit the
    ' fastClick(MOUSE_LEFT);'
    Line to rightclick, chose option It should be able to open the collect box at the GE banker?
    Yes, after the fastClick(MOUSE_RIGHT) if you add chooseOption.select(''); then it should work ;)
  6. 03-10-2015 08:45 PM
    SRL Member
    Didn't seem to work. Do I have to edit anything else from what I posted? Perhaps the result = waitbankorpinscreen?
  7. 03-12-2015 02:09 PM
    SRL Member
    Any ETA on this? Whatever I do, I can't seem to get it to work.
  8. 03-12-2015 06:56 PM
    The Academic
    Yea you will have to change waitbankorpinscreen to collectBox.isOpen(5000)

    As for eta I can't say. This isn't a simple addition, the logic in all of the bank.opens will need to be modified. There are still a few other bugs which take priority :)
+ Reply