Results 1 to 7 of 7

Thread: GetBankItemAmount

  1. #1
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default GetBankItemAmount

    This,
    Simba Code:
    function GetBankIndexItemAmount(const Index: Integer): Integer;
    begin
      Result := getAmountBox(BankIndexToMSBox(Index));
    end;
    I put this into a script, told it to terminate the script if the count is equal to or under 50. I have ~120m of an item and it doesn't recognize the item stack to be greater than 50..(it does work when I remove the size to be under 10m of the item)

    I don't know what I would/could do to turn this into a suggestion (to remedy the situation) so I posted this in bugs.

    Let me know if I can do anything to assist,
    ~Jingle

  2. #2
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Can you post the code you're testing with?

  3. #3
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Eops lol

    Sure, it's essentially this;
    Simba Code:
    program LearningViaMarkUps1;
      {$DEFINE SMART}
      {$DEFINE SRL5}
      {$i srl/srl.simba}

    var
      CheckBankSlot: Integer;

    procedure BankChest;
    begin
      OpenBankChest(SRL_BANK_SW);
      if (BankScreen) then
        begin
          Exit;
        end else
      BankChest;
    end;


    procedure LeItemProcess;
    begin
      BankChest;
      if (BankScreen) then
        begin
          CheckBankSlot := GetBankIndexItemAmount(BankPointToBankIndex(Point(9, 0)));
            if CheckBankSlot <= 50 then
              begin
                  Writeln('Just about out of items, Turning Off.');
                  Logout;
                  TerminateScript;
              end;
        end else

      if not (BankScreen) then
        begin
          Logout;
          TerminateScript;
        end;
      LeItemProcess;
    end;

    begin
      SetupSRL;
      ActivateClient;
      LogInPlayer;
      repeat
          BankChest;
          LeItemProcess;
      until(CheckBankSlot <= 50);
      if (CheckBankSlot <= 50) then
        Writeln('Ciao, torna presto! / Bye, come again!');
        LogOut;
        TerminateScript;
        CloseWindow;
    end.

    But the mark-up's I placed are on a script not done by myself, so I don't know if posting my marked up full script of theirs would be legit; so I just posted this snippet.

  4. #4
    Join Date
    Jun 2006
    Posts
    694
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default

    Change CheckBankSlot <= 50 to CheckBankSlot < 50

  5. #5
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Simba Code:
    program new;
    {$i srl/srl.simba}

    begin
      setupsrl;
      WriteLn(GetBankIndexItemAmount(3))
    end.

    That worked perfectly fine for me. I had 161K of an item in the 3rd slot of my bank.

    SRL Compiled in 0 msec
    161000
    Successfully executed.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  6. #6
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by wyn10 View Post
    Change CheckBankSlot <= 50 to CheckBankSlot < 50
    Thanks, this worked.

    E: &Kyle, I was thinking there was a bug in reading the 'M' at the end of the item amount, but switching the less than or equal to to just less than fixed my problem. But I didn't know you could writeln the amount like that, thanks for teaching me that. :>

    Thanks for the help everyone
    Last edited by Le Jingle; 03-22-2012 at 11:07 PM.

  7. #7
    Join Date
    Jun 2006
    Posts
    694
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default

    Glad to help.

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
  •