Jump to content

why wont it open the bank??


Recommended Posts

Posted

package begin;

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(author = "Mousbros", info = "", logo = "", name = "EZBEGIN", version = 0) 

public class Begin extends Script {

    final Area BEGIN_AREA = new Area (3233,3218,3237,3226);
    final Area BANK_AREA = new Area(3092,3240,3095,3246);
    
        
    
    public void onExit() {
            
    }
        
        public void onStart() {
            
            
        }    
        
        
        @Override
        public int onLoop() throws InterruptedException {
            
        
        if(!getInventory().isEmpty()) {
            if (BEGIN_AREA.contains(myPlayer())) {    
                log("not empty");
                getWalking().webWalk(BANK_AREA);
                
            }
            
        }else {
            if(!getInventory().isEmpty()) {
            if (BANK_AREA.contains(myPlayer())) {
                RS2Object banker = getObjects().closest(10355);
                
                if (bank.getBank().isOpen()) {
                    bank.depositAll();
            } else {
                
                if (banker != null) {
                    if (banker.isVisible()) {
                        banker.interact("Bank");
                        sleep(random(998, 7896));
                    }
                    }
                }
                
            }else {
                getWalking().webWalk(BANK_AREA);
            }
        }
                 
        }    
                
                
                

                
            
            
            
            
            
            
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        return 50;
    }
    
        }

Posted (edited)

how do I remove a topic??

2 minutes ago, Gunman said:

@mousbros Don't use id's if you can use the String name for starters as ids change more often than Strings. Also just use the bank API method to open it.
getBank().open

Also look into conditional sleep so you can sleep until the bank is open.

i found the problem tho yaaay it was a syntax error.... 

thank you for the answer much love!

Edited by mousbros

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...