Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Bank Will not Open


    OPEX

    Recommended Posts

    Posted

    I've tried several ways, but can't seem to get the bank to open. When I tried creating a Bank GameObject, I just got an error over and over once it reached the interact. With the code below the log just looks like the image below, but the bank is never opened. The cursor never moves or does anything.

    image.png.ed79b1ec97666d9b7c41239d963e0600.png

     

    if(BANK_AREA.contains(c.getLocalPlayer())){
                    c.log("Trying");
                    c.getBank().openClosest();
    
                    c.sleepUntil((bankOpen),5000);
                    c.log("Tried");
                }

     

    Posted
    42 minutes ago, OPEX said:

    I've tried several ways, but can't seem to get the bank to open. When I tried creating a Bank GameObject, I just got an error over and over once it reached the interact. With the code below the log just looks like the image below, but the bank is never opened. The cursor never moves or does anything.

    image.png.ed79b1ec97666d9b7c41239d963e0600.png

     

    
    if(BANK_AREA.contains(c.getLocalPlayer())){
                    c.log("Trying");
                    c.getBank().openClosest();
    
                    c.sleepUntil((bankOpen),5000);
                    c.log("Tried");
                }

     

    if(BANK_AREA.contains(getLocalPlayer().getTile())&&!getBank().isOpen()){
        /* here is how you check if you are already in the area by checking if the wanted Area (BANK_AREA)
        contains the actuall Tile of your local player... and checking if the bank is not open already .
         */
        
        c.log("Trying");
        
        c.getBank().openClosest();
        
        sleepUntil(() ->getBank().isOpen(), (5000));
        
        c.log("Tried");
    }

    hope i helped :)

    Posted
    52 minutes ago, Nuclear Nezz said:

    What is c, and what do you mean you tried *creating* a bank object

    c is the main class. The code in question is in a "Banking" node. I'm at work now, so I'll have to wait til I'm back home to see exactly how I had it... but it was something like below.

    GameObject bank = getGameObjects().closest(c -> c != null && c.getName().equals("Bank booth") && c.hasAction("Bank")); 
    
    bank.interact("Bank");

     

    Posted
    1 hour ago, sadgonzer said:
    
    if(BANK_AREA.contains(getLocalPlayer().getTile())&&!getBank().isOpen()){
        /* here is how you check if you are already in the area by checking if the wanted Area (BANK_AREA)
        contains the actuall Tile of your local player... and checking if the bank is not open already .
         */
        
        c.log("Trying");
        
        c.getBank().openClosest();
        
        sleepUntil(() ->getBank().isOpen(), (5000));
        
        c.log("Tried");
    }

    hope i helped :)

    Is adding the ".getTile()" better? I've used the ".contains(getLocalPlayer())" without issue until this point.

    Posted
    1 hour ago, OPEX said:

    Is adding the ".getTile()" better? I've used the ".contains(getLocalPlayer())" without issue until this point.

    its the same thing. 

    also in the first post. Maybe you didn't null check the gameobject so you got an npe error

    Posted
    51 minutes ago, Miami 369 said:

    its the same thing. 

    also in the first post. Maybe you didn't null check the gameobject so you got an npe error

    i dont think you need to null check bank ?

    Posted

    Where are you running the script?

    Try running it through command prompt (quickstart will still launch clients for regular members, just won't auto start the script), it might give you more errors than the debug log will.

     

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.