Bmc 23 Share Posted November 4, 2018 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 More sharing options...
Bmc 23 Author Share Posted November 4, 2018 @Nuclear Nezz @Articron @Pandemic Link to comment Share on other sites More sharing options...
Nuclear Nezz 2055 Share Posted November 4, 2018 That is the wrong usage of canEnterInput entering input is entering in values yourself, eg: withdraw X Link to comment Share on other sites More sharing options...
Bmc 23 Author Share Posted November 4, 2018 ok thank you, maybe this was updated in the last few months. I'll modify my code. Link to comment Share on other sites More sharing options...
Nuclear Nezz 2055 Share Posted November 4, 2018 It hasn't been touched in a minute. I'd suggest using like getDialogues().getOptionIndex("your text") > 0 Link to comment Share on other sites More sharing options...
Bmc 23 Author Share Posted November 5, 2018 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 More sharing options...
zetrux 2 Share Posted November 5, 2018 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.