Class Dialogues
- java.lang.Object
-
- org.dreambot.api.methods.dialogues.Dialogues
-
public class Dialogues extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
CHAT_AREA_WIDGET_ID
static int
CHAT_BOX_PARENT_ID
static int
CHAT_ENTER_VALUE_ID
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
areOptionsAvailable()
Checks if there are any available options that you can click onstatic boolean
canContinue()
Checks if you can continue in a dialogue via "Click here to continue" or "Click to continue"static boolean
canEnterInput()
Returns true if you are able to enter input into the dialogue (like withdrawing X from bank and such)static boolean
canEnterInput(@NonNull java.lang.String prompt)
static boolean
chooseFirstOption(@NonNull java.lang.String... options)
This will go through the provided options in order, and will choose the first available.static boolean
chooseFirstOptionContaining(@NonNull java.lang.String... options)
This will go through the provided options in order, and will choose the first available option that contains one of your provided options.static boolean
chooseOption(int optionIndex)
Chooses whether to click the given option index or press the key based on mouse distance and profiled values.static boolean
chooseOption(@NonNull java.lang.String option)
Chooses the index of the given option NOT CASE SENSITIVEstatic boolean
clickContinue()
Attempts to click the continue dialoguestatic boolean
clickOption(int optionIndex)
Clicks the given option index.static boolean
clickOption(@NonNull java.lang.String option)
Clicks a dialogue option with the mouse NOT CASE SENSITIVEstatic boolean
continueDialogue()
Chooses either to click continue or press space to continue based on a profiled distance of your mousestatic @Nullable java.lang.String
getNPCDialogue()
Gets the dialogue text in a conversation.static int
getOptionIndex(@NonNull java.lang.String option)
Gets the index of the option.static int
getOptionIndexContaining(@NonNull java.lang.String option)
Gets the option index that contains the given text.static @NonNull java.lang.String @Nullable []
getOptions()
Gets all the available options in the dialogue, not including "Click here to continue"static boolean
inDialogue()
Checks if you're currently in a dialogue screen.static boolean
isProcessing()
Checks if the "Please wait..." widget is present, can be found after clicking the continue buttonstatic boolean
spaceToContinue()
Uses the space bar to continuestatic boolean
typeOption(int optionIndex)
Types the key of the given option index.static boolean
typeOption(@NonNull java.lang.String option)
Selects a dialogue option using the corresponding number key NOT CASE SENSITIVE
-
-
-
Field Detail
-
CHAT_BOX_PARENT_ID
public static final int CHAT_BOX_PARENT_ID
- See Also:
- Constant Field Values
-
CHAT_AREA_WIDGET_ID
public static final int CHAT_AREA_WIDGET_ID
- See Also:
- Constant Field Values
-
CHAT_ENTER_VALUE_ID
public static final int CHAT_ENTER_VALUE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
inDialogue
public static boolean inDialogue()
Checks if you're currently in a dialogue screen.- Returns:
- True if the scrollbar isn't visible, else false.
-
canEnterInput
public static boolean canEnterInput()
Returns true if you are able to enter input into the dialogue (like withdrawing X from bank and such)- Returns:
- False if not in dialogue or if widget is not visible, else true
-
canEnterInput
public static boolean canEnterInput(@NonNull java.lang.String prompt)
- Parameters:
prompt
- CASE SENSITIVE - widget text contains your prompt text- Returns:
- True if chat input widget is not hidden, is visible, and contains your text
-
getNPCDialogue
public static @Nullable java.lang.String getNPCDialogue()
Gets the dialogue text in a conversation. This includes all html tagging RS uses! (br tags, color tags)- Returns:
- empty string if not in dialogue, otherwise dialogue widget text
-
continueDialogue
public static boolean continueDialogue()
Chooses either to click continue or press space to continue based on a profiled distance of your mouse- Returns:
- True if click/space Continue returns true, else false.
-
clickContinue
public static boolean clickContinue()
Attempts to click the continue dialogue- Returns:
- true if successful
-
spaceToContinue
public static boolean spaceToContinue()
Uses the space bar to continue- Returns:
- true if successful
-
chooseOption
public static boolean chooseOption(int optionIndex)
Chooses whether to click the given option index or press the key based on mouse distance and profiled values.- Parameters:
optionIndex
- Index of the option you want to choose. *NOTE* OPTIONS START AT 1- Returns:
- True if option is chosen.
-
chooseFirstOption
public static boolean chooseFirstOption(@NonNull java.lang.String... options)
This will go through the provided options in order, and will choose the first available. It will not choose multiple options even if multiple are available, only the first. NOT CASE SENSITIVE- Parameters:
options
- The options to choose- Returns:
- true if it finds and chooses any options, otherwise false
-
chooseFirstOptionContaining
public static boolean chooseFirstOptionContaining(@NonNull java.lang.String... options)
This will go through the provided options in order, and will choose the first available option that contains one of your provided options. It will not choose multiple options even if multiple are available, only the first. NOT CASE SENSITIVE- Parameters:
options
- The options to look for- Returns:
- true if it finds and chooses any options, otherwise false
-
chooseOption
public static boolean chooseOption(@NonNull java.lang.String option)
Chooses the index of the given option NOT CASE SENSITIVE- Parameters:
option
- Option you want to choose- Returns:
- true if option found and selected, else false
-
clickOption
public static boolean clickOption(int optionIndex)
Clicks the given option index.- Parameters:
optionIndex
- Index of the option you want to click. *NOTE* OPTIONS START AT 1- Returns:
- True if clicked successfully.
-
clickOption
public static boolean clickOption(@NonNull java.lang.String option)
Clicks a dialogue option with the mouse NOT CASE SENSITIVE- Parameters:
option
- The option to click- Returns:
- True if it clicks
-
typeOption
public static boolean typeOption(int optionIndex)
Types the key of the given option index.- Parameters:
optionIndex
- Index of the option you want to choose. NOTE: Dialogues option keys start at 1!- Returns:
- True if it is selected
-
typeOption
public static boolean typeOption(@NonNull java.lang.String option)
Selects a dialogue option using the corresponding number key NOT CASE SENSITIVE- Parameters:
option
- The option to click- Returns:
- True if it is selected
-
getOptionIndex
public static int getOptionIndex(@NonNull java.lang.String option)
Gets the index of the option. NOT CASE SENSITIVE- Parameters:
option
- Option that you want to get the index of- Returns:
- -1 if not found, otherwise return MINIMUM OF 1
-
getOptionIndexContaining
public static int getOptionIndexContaining(@NonNull java.lang.String option)
Gets the option index that contains the given text. NOT CASE SENSITIVE- Parameters:
option
- Option you're looking for- Returns:
- -1 if not found, otherwise returns MINIMUM OF 1
-
areOptionsAvailable
public static boolean areOptionsAvailable()
Checks if there are any available options that you can click on- Returns:
- true if there are, false otherwise
-
getOptions
public static @NonNull java.lang.String @Nullable [] getOptions()
Gets all the available options in the dialogue, not including "Click here to continue"- Returns:
- String[] of options or null
-
canContinue
public static boolean canContinue()
Checks if you can continue in a dialogue via "Click here to continue" or "Click to continue"- Returns:
- True if you can continue in a dialogue, else False
-
isProcessing
public static boolean isProcessing()
Checks if the "Please wait..." widget is present, can be found after clicking the continue button- Returns:
- true if it is, false otherwise
-
-