Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • possible issue with getDialogues()


    Bmc
     Share

    Recommended Posts

    I was updating my mcmonk script, and noticed that the code I'm using to select a dialogue option to gain access to the edgeville monestary was no longer working.

     

    I vaguely remeber there being 3 options in the second window, and now there's 2 (maybe there were always 2 i dont recall)

     

    either way, here is the use case:

     

    1. click on the ladder

    2. monk interrupts, space to continue to second dialogue pane. (this works with s.getDialogues().spaceToContinue())

    3. once on a screen where there are other options besides just continuing (second dialogue screen), I check 

    s.getDialogues().canEnterInput()

    which incorrectly returns false, as the player is in a dialogue. I tried getDialogues().getOptions(), but am unable to loop through that array and log the options without getting an exception.

    here is the relevant code I'm using:

    if(s.getDialogues().canContinue()) {
        s.getDialogues().spaceToContinue();
    }else if(s.getDialogues().canEnterInput()){
        s.getDialogues().chooseOption("Well can I join your order?"); //or....
        s.getDialogues().chooseOption(1); //doesnt matter cus this if statement never validates to true.
    }
    

    it should be noted that this dialogue doesn't get started by talking to an npc, rather by clicking on a ladder, which might effect things, idk.

    Link to comment
    Share on other sites

    27 minutes ago, Nuclear Nezz said:

    It hasn't been touched in a minute.

    I'd suggest using like getDialogues().getOptionIndex("your text") > 0

    thanks, got it working

    Link to comment
    Share on other sites

    getOptions() returns a string array of possible options. You could iterate through that to check if it exists, but i actually havent seen any errors thrown when I try to click an option that doesn't exist so I dont know if its necessary to check if it exists before clicking. Not sure though

    getOptionIndex(String) will return the index of an option based on the string

     

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.