Jump to content

How to handle banking?


Recommended Posts

Posted

hello, i recently started writing scripts after having a huge interest in them since i was a kid, and since i started taking programming in school i am starting to understand the basics.

 

so far after following tutorials i made a sardine fisher that could pretty much only drop the whole inventory and stop. what i want to work on is making a fly-fisher that banks exclusively at edgeville. as i type now i should be able to code the actual fishing, but banking.. i just have no idea how to approach it (how would i walk to the bank? open it? only deposit trout/salmon?) any advice or tutorials to point me in the right direction would be really appreciated!

Posted

something like this -> http://prntscr.com/ak56m3 ? or am i completely in the wrong direction?

 

edit: the getState() was fucked in the beginning but i fixed it

 

Something like that yes, but you should account for cases where walking fails, or opening the bank fails etc. etc.

 

You will also want to sleep when opening the bank to avoid spam clicking. So something more like this:

private void bank(){
    if(!Banks.EDGEVILLE.cotains(myPosition())) getWalking().webWalk(Banks.EDGEVILLE);
    else if(!getBank().isOpen()) openBank();
    else getBank().depositAllExcept("Fly fishing rod", "Feather");
}

private void openBank(){
    getBank().open();
    new ConditionalSleep(5000) {
        @Override
        public boolean condition() throws InterruptedException {
            return getBank().isOpen();
        }
    }.sleep();
}

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...