Results 1 to 8 of 8

Thread: Advice on Banking

  1. #1
    Join Date
    Oct 2015
    Location
    Texas
    Posts
    37
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default Advice on Banking

    So I have been looking at other scripts as well as the tutorials to code in banking into my script. However both methods that i try(whether it be using the ACA program to find the colors or the spl-6 bankScreen,open(BANK_TABLE_BURTHORPE) my player will not open the bank. Nor will he deposit his inventory when i use quick deposit. He waits a couple of seconds then walks back to the fish spot. Curious if there is a piece of code that i am missing.

    Any help will be appreciated or even a point in the right direction to another thread. Thanks!

    Simba Code:
    procedure depositFish();

    begin
      if (not isLoggedIn()) then
        exit;
      bankScreen.open(BANK_TABLE_BURTHORPE);
      Wait(1000 + random(1000));
      bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
      Wait(1000 + random(1000));
      bankScreen.close();
      if (not bankScreen.close()) then
      begin
          if (bankScreen.close()) then
            exit
          else
            terminatescript;
      end;
          inc(LoadsDone);

    end;]

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

    Default

    can you post the SRL debug output? also what do your interfaces look like?

    anything can be wrong here tbh

  3. #3
    Join Date
    Dec 2014
    Posts
    383
    Mentioned
    2 Post(s)
    Quoted
    206 Post(s)

    Default

    My guess is that your script is messing up because you called

    " if not bankscreen.close() "

    instead of " not bankscreen.isOpen()"

    made some changes below, try that and give it a shot.

    if you aren't depositing items from bank reset your interface to oldschool defualt

    Simba Code:
    procedure depositFish();

    begin
      if (not isLoggedIn()) then
        exit;
    /// for buth banking, I did my own color finding procedure, the booth one is pretty hard to find IMO
      Wait(1000 + random(1000));
      bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
      Wait(1000 + random(1000));
      bankScreen.close();
      wait(1000 + random(1000));
      /// wrong logic IMO... would instead do.
      if bankscreen.isOpen() then
        begin
          bankscreen.close();
        end else
          begin
            writeln('did not close bank for some reason, terminating');
            terminateScript();
          end;
        exit();
      inc(LoadsDone);
    end;


    im not 100% that will terminate script if bank isnt closed, never had a problem with bankscreen functions :S

  4. #4
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Quote Originally Posted by theholyone View Post
    My guess is that your script is messing up because you called

    " if not bankscreen.close() "

    instead of " not bankscreen.isOpen()"

    made some changes below, try that and give it a shot.

    if you aren't depositing items from bank reset your interface to oldschool defualt
    Naw, his logic looks sound enough. Pretty much everything in SRL-6 is a boolean function, so if bankScreen.close() returns false, it means that it failed to close for some reason. Your code is a little redundant because you're checking if bankScreen.isOpen(), but you already know that it's open because you opened it.



    New to scripting? Procedures & Functions for Beginners
    Do you use your computer at night? Just get f.lux

  5. #5
    Join Date
    Oct 2015
    Location
    Texas
    Posts
    37
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by fady View Post
    can you post the SRL debug output? also what do your interfaces look like?

    anything can be wrong here tbh
    I'll get one posted up tomorrow.

  6. #6
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,164
    Mentioned
    26 Post(s)
    Quoted
    433 Post(s)

    Default

    You could always try something along these lines:

    Simba Code:
    function openBank(): boolean;
    var
      x,y,i : Integer;
      tellerTPA : TPointArray;
      tellerATPA : T2DPointArray;
    begin

      if not isLoggedIn() then
          exit();


      findColorsSpiralTolerance(x, y, tellerTPA, bankColour, mainScreen.getBounds(), bankTol, colorSetting(2, bankHue, BankSat));
      if (Length(tellerTPA) < 1) then
      begin
        WriteLn('Failed to find bank colors');
        Exit;
      end;

      tellerATPA := tellerTPA.toATPA(15,15);

      SmartImage.debugATPA(tellerATPA);

        for i := 0 to high(tellerATPA) do
      begin

        if not isLoggedIn() then
          exit();

        mouse(middleTPA(tellerATPA[i]), MOUSE_MOVE);
          if isMouseOverText(['ank']) then
          begin
            fastClick(MOUSE_LEFT);
            smartImage.clear();
            wait(randomrange(1250,1500));
            exit(true);
          end;
      end;

      clearDebugs;
      exit(false);

    end;

    It will draw on SMART and show you where the selected colours are.

    This will just open the bank. If you want something to deposit, you might wanna try something like this:

    Simba Code:
    function banking(): Boolean;
    var
      Time: TTimeMarker;
    begin
      if not isLoggedIn() then
          exit();


      if (not openBank) then
        if (not openBank) then
          if (not openBank) then //Tries to open bank 3 times before deciding to quit
            exit();

      if (not bankScreen.isOpen(10000)) then
          exit;
      if not (bankScreen.isOpen or pinScreen.isOpen) then
        exit;
      if pinScreen.isOpen then
      begin
        pinScreen.Enter(players[currentPlayer].bankPin);
      end;
      bankScreen.clickButton(BANK_BUTTON_PRESET_1);
      Time.start;
      while (bankScreen.isOpen) and (Time.getTime < randomRange(2500, 8000)) do
      begin
        wait(random(100));
      end;
      result:= (not bankScreen.isOpen);
    end;

  7. #7
    Join Date
    Dec 2014
    Posts
    383
    Mentioned
    2 Post(s)
    Quoted
    206 Post(s)

    Default

    Quote Originally Posted by Incurable View Post
    Naw, his logic looks sound enough. Pretty much everything in SRL-6 is a boolean function, so if bankScreen.close() returns false, it means that it failed to close for some reason. Your code is a little redundant because you're checking if bankScreen.isOpen(), but you already know that it's open because you opened it.
    You learn something new everyday!

    yeah, after I posted that, I was thinking about it while working, wasn't sure if the bankscreen.close was a boolean or not, but realized pretty much everything i've been using is a T/F :P

  8. #8
    Join Date
    Oct 2015
    Location
    Texas
    Posts
    37
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    So I am not sure what happened and it might have just been the simple change as to setting the quick preset to old school again but my character is now properly banking with my existing code. Thanks for the help guys!

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
  •