Batko 0 Share Posted September 29, 2019 Hi, New here. Started writing my own scripts just for fun. Written a WC and a Mining script already with banking and now trying out a Tutorial Island script. At the start when you need to talk to the "Gielinor guide" you get to choose three options: "I am an experienced player." "I've played in the past, but not recently." "I am brand new! This is my first time here." Now when i try to get the options of the dialogue, it only returns the first one. Example code Dialogues box = getDialogues(); if (box != null) { log("Found dialogue"); String[] opts = box.getOptions(); for (String o : opts) log("Options " + o); } only prints out the first option in the conversation. Is it possible to get all options, or am I doing something wrong? Link to comment Share on other sites More sharing options...
CliveLewis 1 Share Posted September 30, 2019 Not sure why it returns only 1 option, but this is how I handle dialogues. Maybe will help: final String[] OPTIONS = {"Yes please, I need woad leaves.", "How about 20 coins?"}; if (getDialogues().inDialogue() && !getDialogues().continueDialogue()) { for(String option : OPTIONS) { if (getDialogues().chooseOption(option)) { break; } } } This code snippet finds dialogue box with player choice. Then it loops my array and chooses correct option. getDialogues.chooseOption() checks for valid value so you don't need any null checks. Link to comment Share on other sites More sharing options...
Nuclear Nezz 2055 Share Posted September 30, 2019 5 hours ago, Batko said: Hi, New here. Started writing my own scripts just for fun. Written a WC and a Mining script already with banking and now trying out a Tutorial Island script. At the start when you need to talk to the "Gielinor guide" you get to choose three options: "I am an experienced player." "I've played in the past, but not recently." "I am brand new! This is my first time here." Now when i try to get the options of the dialogue, it only returns the first one. Example code Dialogues box = getDialogues(); if (box != null) { log("Found dialogue"); String[] opts = box.getOptions(); for (String o : opts) log("Options " + o); } only prints out the first option in the conversation. Is it possible to get all options, or am I doing something wrong? I believe something is a little different with the dialogues in tutorial island. If I recall, the options dialogue has a different layout, which changes up how the actual dialogue options how up in the widgets. The widget is 219,1 You want the children of that widget, that's where you'll find the dialogue options. In normal dialogues there are extra widgets as children under that widget, which throws off how we usually find the chat options. Link to comment Share on other sites More sharing options...
Batko 0 Author Share Posted October 1, 2019 Thanks Nezz. The widget solution worked just fine! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.