Class LoginUtility


  • public class LoginUtility
    extends java.lang.Object
    This is an API class used to give easier access to scripters to writing their own login handlers. Created by Nezz on 2/20/2018.
    • Constructor Detail

      • LoginUtility

        public LoginUtility()
    • Method Detail

      • isEnterToLogin

        public static boolean isEnterToLogin()
        See setEnterToLogin
        Returns:
      • setEnterToLogin

        public static void setEnterToLogin​(boolean b)
        At the login screen you can hit enter instead of clicking the login button to open up the email/password interface This sets a boolean to true/false as to whether or not to use enter instead of clicking.
        Parameters:
        b - True sets enter to on, False sets enter to off.
      • setEscToCancel

        public static void setEscToCancel​(boolean b)
        At the login screen you can hit escape instead of clicking the cancel button
        Parameters:
        b -
      • isEscToCancel

        public static boolean isEscToCancel()
        Returns:
        true if esc to cancel enabled, else false
      • getLoginEmail

        @Deprecated
        public static java.lang.String getLoginEmail()
        Deprecated.
        Gets the currently typed text in the email field of the login screen.
        Returns:
        String value of what is currently typed in the email field of the login screen.
      • getLoginPassword

        public static java.lang.String getLoginPassword()
        Gets the currently typed text in the password field of the login screen. Note: Unknown what it returns if "hide password" is turned on.
        Returns:
        String value of what is currently typed in the password field of the login screen.
      • getExistingUserButton

        public static java.awt.Rectangle getExistingUserButton()
        Gets the "Existing user" button rectangle
        Returns:
      • login

        public static RSLoginResponse login()
        Logs in to the client with the currently set Account
        Returns:
        RSLoginResponse, LOGGED_IN if logged in, null if in the process of logging in(typing), or the response
      • login

        public static RSLoginResponse login​(org.dreambot.core.Account account)
        Logs in to the client with the given Account
        Parameters:
        account - Account to log in with
        Returns:
        RSLoginResponse, LOGGED_IN if logged in, null if in the process of logging in(typing), or the response
      • setAccount

        public static void setAccount​(org.dreambot.core.Account account)
      • login

        public static RSLoginResponse login​(java.lang.String email,
                                            java.lang.String password)
        Logs in to the client with the given email and password
        Parameters:
        email - Email to log in with
        password - Password to log in with
        Returns:
        RSLoginResponse, LOGGED_IN if logged in, null if in the process of logging in(typing), or the response
      • getResponse

        public static RSLoginResponse getResponse()
        Gets the current login response of the login screen, based on the response text in the login screen.
        Returns:
      • getIndex

        public static int getIndex()
        Gets the current login index of the game.
        Returns:
      • getAccountStatus

        public static int getAccountStatus()
        Gets the account status, only used to determine locked vs banned in login screen.
        Returns:
        0 if banned, 1 if locked, and -1 if neither
      • isWorldScreenOpen

        public static boolean isWorldScreenOpen()
        Checks if the world select screen is open
        Returns:
      • closeWorldScreen

        public static boolean closeWorldScreen()
        Closes the world select screen
        Returns:
        True if screen is not open, or if successfully closed.
      • getCancelLoginButton

        public static java.awt.Rectangle getCancelLoginButton()
      • getMembersBackButton

        public static java.awt.Rectangle getMembersBackButton()
      • getContinueButton

        public static java.awt.Rectangle getContinueButton()
      • getBackButtonOnLauncher

        public static java.awt.Rectangle getBackButtonOnLauncher()
      • getAcceptTOSButton

        public static java.awt.Rectangle getAcceptTOSButton()
      • getTryAgainButton

        public static java.awt.Rectangle getTryAgainButton()
      • getBackButton

        public static java.awt.Rectangle getBackButton()
      • getDisabledBackButton

        public static java.awt.Rectangle getDisabledBackButton()
      • getCancelWorldButton

        public static java.awt.Rectangle getCancelWorldButton()
      • getRememberUsernameButton

        public static java.awt.Rectangle getRememberUsernameButton()
      • getDisconnectedBackButton

        public static java.awt.Rectangle getDisconnectedBackButton()
      • getPlayNowButton

        public static java.awt.Rectangle getPlayNowButton()
      • getPlayNowTryAgainButton

        public static java.awt.Rectangle getPlayNowTryAgainButton()
      • getMustAcceptTosBackButton

        public static java.awt.Rectangle getMustAcceptTosBackButton()
      • getDobBackButton

        public static java.awt.Rectangle getDobBackButton()
      • isRememberUsername

        public static boolean isRememberUsername()
      • setRememberUsername

        public static void setRememberUsername​(boolean rememberUsername)
      • isNoInputLogin

        public static boolean isNoInputLogin()
      • setNoInputLogin

        public static void setNoInputLogin​(boolean useSetters)
      • enterUsername

        public static void enterUsername​(java.lang.String username)
      • enterPassword

        public static void enterPassword​(java.lang.String password)
      • shouldHopOnError

        public static boolean shouldHopOnError()
      • getHopWorld

        public static int getHopWorld()
      • setHopWorld

        public static void setHopWorld​(int hopWorld)