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.

Problem with dialogue series

Featured Replies

Hello fellas it's me again,

I'm trying to get my script past a series of dialogues, where there is a continue option or 2 options to choose the script manages to click my chosen option. When the script is at the dialogue which contains 3 options, it somehow fails to choose the option i want it to choose.

Does anybody know why this is / how to fix this?

My code :

	case WALK_BANK_D1:
			if(dialogues.isPendingContinuation()) {
				dialogues.clickContinue();
				sleep(random(200, 600));
			} else if(dialogues.isPendingOption()) {
				dialogues.selectOption("Can I journey on this ship?");
				sleep(random(200, 600));
			} else if(dialogues.isPendingOption()) {
				dialogues.selectOption("Search away, I have nothing to hide.");
				sleep(random(200, 600));
			} else if(dialogues.isPendingOption()) {
				dialogues.selectOption("Ok.");
				sleep(random(200, 600));

This is where the problem occurs :
 

} else if(dialogues.isPendingOption()) {
				dialogues.selectOption("Search away, I have nothing to hide.");
				sleep(random(200, 600));

I feel you don't fully understand else statements.

  String[] options = new String[]{"Can I journey on this ship?",
                                  "Search away, I have nothing to hide.",
                                  "Ok." };
                    if(dialogues.isPendingContinuation()){
                        dialogues.clickContinue();
                    }else if (dialogues.isPendingOption()){
                        if(dialogues.selectOption(options)){
                            sleep(random(200, 600));
                        }
                    }

Edited by Isolate

  • Author

 

I feel you don't fully understand else statements.

  String[] options = new String[]{"Can I journey on this ship?",
                                  "Search away, I have nothing to hide.",
                                  "Ok." };
                    if(dialogues.isPendingContinuation()){
                        dialogues.clickContinue();
                    }else if (dialogues.isPendingOption()){
                        if(dialogues.selectOption(options)){
                            sleep(random(200, 600));
                        }
                    }

 

Yes, you are right i'm still looking into all of it.

Could you rewrite this code for me with the method you just did?

http://pastebin.com/SEMnP0FX

 

Yes, you are right i'm still looking into all of it.

Could you rewrite this code for me with the method you just did?

http://pastebin.com/SEMnP0FX

 

  private final String[] SEAMAN_OPTIONS = new String[]{"Can I journey on this ship?",
                                                       "Search away, I have nothing to hide."
      };

    void handleSeaman() throws InterruptedException {
        if(dialogues.inDialogue()){
             if(dialogues.isPendingContinuation()){
                 if(dialogues.clickContinue()){
                     sleep(random(200, 600));
                 }
             }else if(dialogues.isPendingOption()){
                 if(dialogues.selectOption(SEAMAN_OPTIONS)){
                     sleep(random(200, 600));
                 }
             }
        }else{
            NPC seaman = npcs.closest(new Filter<NPC>() {
                @Override
                public boolean match(NPC npc) {
                    return npc != null && npc.getName().contains("Seaman");
                }
            });
            if(seaman != null){
                if(seaman.isVisible()){
                    if(seaman.interact("Pay-fare")){
                        sleep(random(750, 900));
                    }
                }else{
                    camera.toEntity(seaman);
                }
            }
        }
    }
}

Even though i'm pretty sure that's the dialog for the customs officer...

  • Author
  private final String[] SEAMAN_OPTIONS = new String[]{"Can I journey on this ship?",
                                                       "Search away, I have nothing to hide."
      };

    void handleSeaman() throws InterruptedException {
        if(dialogues.inDialogue()){
             if(dialogues.isPendingContinuation()){
                 if(dialogues.clickContinue()){
                     sleep(random(200, 600));
                 }
             }else if(dialogues.isPendingOption()){
                 if(dialogues.selectOption(SEAMAN_OPTIONS)){
                     sleep(random(200, 600));
                 }
             }
        }else{
            NPC seaman = npcs.closest(new Filter<NPC>() {
                @Override
                public boolean match(NPC npc) {
                    return npc != null && npc.getName().contains("Seaman");
                }
            });
            if(seaman != null){
                if(seaman.isVisible()){
                    if(seaman.interact("Pay-fare")){
                        sleep(random(750, 900));
                    }
                }else{
                    camera.toEntity(seaman);
                }
            }
        }
    }
}

Even though i'm pretty sure that's the dialog for the customs officer...

 

 

Using that doesn't work for me.

But the other series of dialogues runs fine for me, same method :

 

case WALK_BACK_D1:
			if(dialogues.isPendingContinuation()) {
				dialogues.clickContinue();
				sleep(random(200, 700));
			} else if(dialogues.isPendingOption()) {
				dialogues.selectOption("Yes please.");
				sleep(random(200, 700));
			} else {
				Entity sailor = npcs.closest("Seaman Thresnor", "Seaman Lorris", "Captain Tobias");
				if (sailor!= null) {
					sailor.interact("Pay-fare");
				} else {
					log("Sailor is null");
				}
			}
			sleep(random(200, 600));
			break;

Create an account or sign in to comment

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.