Jump to content

How to handle banking?


snowek

Recommended Posts

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!

Link to comment
Share on other sites

Walking: walking.webWalk(Bank.EDGEVILLE);

Opening: bank.open();

Deposit: bank.depositAllExcept("Fly fishing rod", "Feather");

 

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

Edited by snowek
Link to comment
Share on other sites

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

uhh not sure about this but wasn't a fishing spot an npc?

So it'd be NPC fishSpot = getNpcs().closest("Fishing spot") 

check however im not entirely sure lol

Link to comment
Share on other sites

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();
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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