Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Tired as fuck, what am i doing wrong?

Featured Replies

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 by atoo

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 by Juggles

                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 by Chris

  • 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

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.