snowek Posted March 26, 2016 Posted March 26, 2016 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!
Token Posted March 26, 2016 Posted March 26, 2016 Walking: walking.webWalk(Bank.EDGEVILLE); Opening: bank.open(); Deposit: bank.depositAllExcept("Fly fishing rod", "Feather"); 1
snowek Posted March 26, 2016 Author Posted March 26, 2016 (edited) 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 March 26, 2016 by snowek
Token Posted March 26, 2016 Posted March 26, 2016 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 Yes something like that but the enum was Banks not Bank actually.
Saiyan Posted March 26, 2016 Posted March 26, 2016 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
Psvxe Posted March 26, 2016 Posted March 26, 2016 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 You´re correct.
Explv Posted March 27, 2016 Posted March 27, 2016 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(); }