January 23, 20179 yr jesus christ, it just keeps interacting with karim & when i went to bank "manually" it opened it without depositing. Im pretty sure it fucks up at getState() (probably missed something, but im tired af) private State getState() { //this part is where it fucks up probably if(KebabGuy.contains(myPlayer()) || !getInventory().isFull()) return State.BUYING; else { if(!bankArea.contains(myPlayer())) { if(getInventory().isFull()) return State.WALKING_TO_BANK; } } if (bankArea.contains(myPosition())) { if (getInventory().isFull()) return State.BANKING; } return State.WALKING_TO_KARIM; } public int onLoop() throws InterruptedException{ switch (getState()){ case BUYING: log("******** ******** ******** KARIM"); NPC karim = getNpcs().closest("Karim"); if(karim != null){ karim.interact("Talk-to"); sleep(700); dialogues.clickContinue(); sleep(700); dialogues.selectOption("Yes please"); sleep(700); dialogues.clickContinue(); sleep(700); log("Buying some kebab dawg"); break; } case WALKING_TO_KARIM: log("Walking to Karim"); if(!getInventory().isFull()) getWalking().webWalk(KebabGuy); break; case WALKING_TO_BANK: if (getInventory().isFull()) getWalking().webWalk(bankArea); break; case BANKING: log("Banking"); if (!getBank().isOpen() || getInventory().isFull()) getBank().open(); else getBank().depositAllExcept("Coins"); break; } return random(600,800); } Edited January 23, 20179 yr by atoo
January 23, 20179 yr When you're inventory is full at the KEBAB place, you will never exit this state if(KebabGuy.contains(myPlayer()) || !getInventory().isFull()) return State.BUYING; else { You are still in the Kebab place. Use a && instead Remember when you use || as long as 1 is true, it returns that boolean as true. You will never exit this state Edited January 23, 20179 yr by Juggles
January 23, 20179 yr if (getInventory().isFull()){ bankStuff(); } else { buykebab(); } private void buykebab(){ if (!AREA_KEBAB_SHOP.contains(myPosition())){ getWalking().walk(AREA_KEBAB_SHOP); return; } if (getDialogues().inDialogue()) { if (getDialogues().isPendingOption()){ getDialogues().selectOption(2); } else getDialogues().clickContinue(); } else { final NPC worker = getNPCS().closest("Karim"); if (worker != null) { worker.interact("Talk-to"); new FConditionalSleep(() -> getDialogues().inDialogue(), 7000).sleep(); } } } private void bankStuff() throws InterruptedException { if (!Banks.AL_KHARID.contains(myPosition())){ getWalking().walk(Banks.AL_KHARID); return; } if (!getBank().isOpen()){ getBank().open(); new FConditionalSleep(() -> getBank().isOpen(), random(2300, 10000)).sleep(); } else { if (getBank().depositAllExcept("Coins")){ new FConditionalSleep(() -> getInventory().isEmptyExcept("Coins"), random(2000, 8000)).sleep(); } } } np Edited January 23, 20179 yr by Chris
January 23, 20179 yr Author if (getInventory().isFull()){ bankStuff(); } else { buykebab(); } private void buykebab(){ if (!AREA_KEBAB_SHOP.contains(myPosition())){ getWalking().walk(AREA_KEBAB_SHOP); return; } if (getDialogues().inDialogue()) { if (getDialogues().isPendingOption()){ getDialogues().selectOption(2); } else getDialogues().clickContinue(); } else { final NPC worker = getNPCS().closest("Karim"); if (worker != null) { worker.interact("Talk-to"); new FConditionalSleep(() -> getDialogues().inDialogue(), 7000).sleep(); } } } private void bankStuff() throws InterruptedException { if (!Banks.AL_KHARID.contains(myPosition())){ getWalking().walk(Banks.AL_KHARID); return; } if (!getBank().isOpen()){ getBank().open(); new FConditionalSleep(() -> getBank().isOpen(), random(2300, 10000)).sleep(); } else { if (getBank().depositAllExcept("Coins")){ new FConditionalSleep(() -> getInventory().isEmptyExcept("Coins"), random(2000, 8000)).sleep(); } } } np Ye i already fixed it, thanks though. Will steal some codenz from that