Results 1 to 4 of 4

Thread: 4 new additions for Bank.scar

  1. #1
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default 4 new additions for Bank.scar

    Hi all

    SCAR Code:
    {*******************************************************************************
    Function BankScrollTo(Index: Integer): Integer;
    By: Nadeem
    Last Edit: 29 Jul 2009
    Description: Scrolls bank down until the Index slow appears
    *******************************************************************************}

    function BankScrollTo(Index: Integer): Integer;
    var x, y, C, R, SL, MR: Integer;
        BPoint: TPoint;
    begin
      if not BankScreen then
      begin
        srl_Warn('MMBankItem', 'Bank not open.', warn_AllVersions);
        Exit;
      end;
      FixBank;
      BPoint := BankIndexToBankPoint(Index);
      C := BPoint.x;
      R := BPoint.y;
      while (C > 9) do begin
        C := C - 9;
        R := R + 1;
      end;
      if (R > 3) then
      begin
        while SimilarColors(4939368, GetColor(489, 103 + SL), 3) do Inc(SL);
        MouseBox(483, 103, 493, 103 + (SL - Round(SL div 4)), 3);
        GetMousePos(x, y);
        HoldMouse(x, y, True);
        while (R > 3) do begin
          MMouse(x, y + MR, 0, 0);
          Wait(13 + Random(13));
          IncEx(MR, 19 + Random(3));
          R := R - 1;
        end;
        MMouse(x, y + MR, 0, 0);
        Wait(13 + Random(13));
        GetMousePos(x, y);
        ReleaseMouse(x, y, True);
      end;
      Result := Index;
      while Result > 40 do DecEx(Result, 40);
    end;

    SCAR Code:
    {*******************************************************************************
    Function BankItemExists(Index: Integer): Boolean;
    by: Nadeem
    Last Edit: 29 Jul 2009
    Description: Checks to see if an item on Index in Bank exists
    *******************************************************************************}

    function BankItemExists(Index: Integer; Scroll: Boolean): Boolean;
    var BBox: TBox;
    begin
      if not BankScreen then
      begin
        srl_Warn('MMBankItem', 'Bank not open.', warn_AllVersions);
        Exit;
      end;
      if Scroll then Index := BankScrollTo(Index);
      BBox   := BankIndexToMSBox(Index);
      Result := FindColor(BBox.x1, BBox.y1, 65536, BBox.x1, BBox.y1, BBox.x2, BBox.y2);
    end;

    SCAR Code:
    {*******************************************************************************
    Procedure MMBankItem(Index: Integer);
    by: Nadeem
    Last Edit: 29 Jul 2009
    Description: Moves mouse to a specfic index in the bank. No limit on index.
    *******************************************************************************}

    procedure MMBankItem(Index: Integer);
    var BBox: TBox;
    begin
      if not BankScreen then
      begin
        srl_Warn('MMBankItem', 'Bank not open.', warn_AllVersions);
        Exit;
      end;
      if (CurrentBankTab <> 1) then BankTab(1);
      FixBank;
      BBox := BankIndexToMSBox(BankScrollTo(Index));
      MouseBox(BBox.x1 + 3, BBox.y1 + 33, BBox.x2 - 9, BBox.y2 + 1, 3);
    end;

    SCAR Code:
    {*******************************************************************************
    Function CreateBankTab(Index: Integer): Integer;
    by: Nadeem
    Last Edit: 29 Jul 2009
    Description: Creates a new tab with the item on Index
    *******************************************************************************}

    function CreateBankTab(Index: Integer): Integer;
    var x, y: Integer;
        NBox: TBox;
    begin
      if not BankScreen then
      begin
        srl_Warn('MMBankItem', 'Bank not open.', warn_AllVersions);
        Exit;
      end;
      FixBank;
      if not CurrentBankTab = 1 then BankTab(1);
      Result := 1;
      while ExistsBankTab(Result) do Result := Result + 1;
      MMBankItem(Index);
      GetMousePos(x, y);
      HoldMouse(x, y, True);
      Wait(RandomRange(150, 250));
      NBox := IntToBox(27 + (Result - 1) * 48, 51, 70 + (Result - 1) * 48, 81); // Formula from ExistsBankTab()
      MouseBox(NBox.x1 + 5, NBox.y1 + 15, NBox.x2 - 5, NBox.y2 - 3, 3);
      GetMousePos(x, y);
      Wait(RandomRange(150, 250));
      ReleaseMouse(x, y, True);
      Wait(RandomRange(150, 250));
      while CurrentBankTab = Result do Wait(100);
    end;

    Please give feedback, Thanks!



    ~NS
    Last edited by Nadeem; 07-31-2009 at 12:35 AM.

  2. #2
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Looks good, but is it just me or are the Bank Indexes in SRL all messed up?

  3. #3
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    Looks good, but is it just me or are the Bank Indexes in SRL all messed up?
    No it works good, unless you mean that it gives an index number higher than 40 which does not exist on the screen..?

    Well I kind worked around that aswell, i'm making it scroll down to the right index number (i.e 83) and then subtract the other index we passed to get the current index for that same item on the screen now

    So really, I think the indexes are functioning quite well



    ~NS

  4. #4
    Join Date
    Feb 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well I kind worked around that aswell, i'm making it scroll down to the right index numbe

    **snipped links**
    Last edited by Nava2; 02-25-2011 at 03:58 AM. Reason: snipped links..

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
  •