Class Dialogues


  • public class Dialogues
    extends java.lang.Object
    • 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 on
      static 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​(java.lang.String prompt)  
      static boolean chooseFirstOption​(java.lang.String... options)
      This will go through the provided options in order, and will choose the first available.
      static boolean chooseFirstOptionContaining​(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​(java.lang.String option)
      Chooses the index of the given option NOT CASE SENSITIVE
      static boolean clickContinue()
      Attempts to click the continue dialogue
      static boolean clickOption​(int optionIndex)
      Clicks the given option index.
      static boolean clickOption​(java.lang.String option)
      Clicks a dialogue option with the mouse NOT CASE SENSITIVE
      static boolean continueDialogue()
      Chooses either to click continue or press space to continue based on a profiled distance of your mouse
      static java.lang.String getNPCDialogue()
      Gets the dialogue text in a conversation.
      static int getOptionIndex​(java.lang.String option)
      Gets the index of the option.
      static int getOptionIndexContaining​(java.lang.String option)
      Gets the option index that contains the given text.
      static java.lang.String[] 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 button
      static boolean spaceToContinue()
      Uses the space bar to continue
      static boolean typeOption​(int optionIndex)
      Types the key of the given option index.
      static boolean typeOption​(java.lang.String option)
      Selects a dialogue option using the corresponding number key NOT CASE SENSITIVE
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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​(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 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​(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​(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​(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​(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​(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​(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​(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 java.lang.String[] 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