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 intCHAT_AREA_WIDGET_IDstatic intCHAT_BOX_PARENT_IDstatic intCHAT_ENTER_VALUE_ID
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanareOptionsAvailable()Checks if there are any available options that you can click onstatic booleancanContinue()Checks if you can continue in a dialogue via "Click here to continue" or "Click to continue"static booleancanEnterInput()Returns true if you are able to enter input into the dialogue (like withdrawing X from bank and such)static booleancanEnterInput(@NonNull java.lang.String prompt)static booleanchooseFirstOption(@NonNull java.lang.String... options)This will go through the provided options in order, and will choose the first available.static booleanchooseFirstOptionContaining(@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 booleanchooseOption(int optionIndex)Chooses whether to click the given option index or press the key based on mouse distance and profiled values.static booleanchooseOption(@NonNull java.lang.String option)Chooses the index of the given option NOT CASE SENSITIVEstatic booleanclickContinue()Attempts to click the continue dialoguestatic booleanclickOption(int optionIndex)Clicks the given option index.static booleanclickOption(@NonNull java.lang.String option)Clicks a dialogue option with the mouse NOT CASE SENSITIVEstatic booleancontinueDialogue()Chooses either to click continue or press space to continue based on a profiled distance of your mousestatic @Nullable java.lang.StringgetNPCDialogue()Gets the dialogue text in a conversation.static intgetOptionIndex(@NonNull java.lang.String option)Gets the index of the option.static intgetOptionIndexContaining(@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 booleaninDialogue()Checks if you're currently in a dialogue screen.static booleanisProcessing()Checks if the "Please wait..." widget is present, can be found after clicking the continue buttonstatic booleanspaceToContinue()Uses the space bar to continuestatic booleantypeOption(int optionIndex)Types the key of the given option index.static booleantypeOption(@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
-
-