Package org.dreambot.api.methods.login
Class LoginUtility
- java.lang.Object
-
- org.dreambot.api.methods.login.LoginUtility
-
public class LoginUtility extends java.lang.ObjectThis 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 Summary
Constructors Constructor Description LoginUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanchangeWorld(int givenWorld)Deprecated.useWorldHopper.changeWorldDirect(World)insteadstatic booleancloseWorldScreen()Closes the world select screenstatic voidenterPassword(java.lang.String password)static voidenterUsername(java.lang.String username)static java.awt.RectanglegetAcceptTOSButton()static intgetAccountStatus()Gets the account status, only used to determine locked vs banned in login screen.static java.awt.RectanglegetBackButton()static java.awt.RectanglegetBackButtonOnLauncher()static intgetBaseX()Deprecated.static intgetBaseY()Deprecated.static java.awt.RectanglegetCancelLoginButton()static java.awt.RectanglegetCancelWorldButton()static java.awt.RectanglegetContinueButton()static java.awt.RectanglegetDisabledBackButton()static java.awt.RectanglegetDisconnectedBackButton()static java.awt.RectanglegetDobBackButton()static java.awt.RectanglegetExistingUserButton()Gets the "Existing user" button rectanglestatic intgetHopWorld()static intgetIndex()Gets the current login index of the game.static java.lang.StringgetLoginEmail()Gets the currently typed text in the email field of the login screen.static java.lang.StringgetLoginPassword()Gets the currently typed text in the password field of the login screen.static java.awt.RectanglegetMembersBackButton()static java.awt.RectanglegetMustAcceptTosBackButton()static java.awt.RectanglegetOpenWorldScreenButton()Deprecated.useWorldHopper.changeWorldDirect(World)insteadstatic java.awt.RectanglegetPlayNowButton()static java.awt.RectanglegetPlayNowTryAgainButton()static java.awt.RectanglegetRememberUsernameButton()static RSLoginResponsegetResponse()Gets the current login response of the login screen, based on the response text in the login screen.static LoginStagegetStage()static java.awt.RectanglegetTryAgainButton()static intgetWorldIndex(int world)Deprecated.useWorldHopper.changeWorldDirect(World)insteadstatic intgetWorldListColumnSize()Deprecated.useWorldHopper.changeWorldDirect(World)insteadstatic java.awt.RectanglegetWorldRectangle(int world)Deprecated.useWorldHopper.changeWorldDirect(World)insteadstatic booleanisEnterToLogin()See setEnterToLoginstatic booleanisEscToCancel()static booleanisNoInputLogin()static booleanisRememberUsername()static booleanisWorldScreenOpen()Checks if the world select screen is openstatic RSLoginResponselogin()Logs in to the client with the currently set Accountstatic RSLoginResponselogin(java.lang.String email, java.lang.String password)Logs in to the client with the given email and passwordstatic RSLoginResponselogin(org.dreambot.core.Account account)Logs in to the client with the given Accountstatic booleanopenWorldScreen()Deprecated.useWorldHopper.changeWorldDirect(World)insteadstatic voidsetAccount(org.dreambot.core.Account account)static voidsetBaseX(int baseX)Deprecated.static voidsetBaseY(int baseY)Deprecated.static voidsetEnterToLogin(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.static voidsetEscToCancel(boolean b)At the login screen you can hit escape instead of clicking the cancel buttonstatic voidsetHopWorld(int hopWorld)static voidsetNoInputLogin(boolean useSetters)static voidsetRememberUsername(boolean rememberUsername)static voidsetWorldListColumnSize(int worldListColumnSize)Deprecated.
-
-
-
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
public static java.lang.String getLoginEmail()
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.
-
getStage
public static LoginStage getStage()
-
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 withpassword- 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:
-
openWorldScreen
@Deprecated public static boolean openWorldScreen()
Deprecated.useWorldHopper.changeWorldDirect(World)instead
-
closeWorldScreen
public static boolean closeWorldScreen()
Closes the world select screen- Returns:
- True if screen is not open, or if successfully closed.
-
getOpenWorldScreenButton
@Deprecated public static java.awt.Rectangle getOpenWorldScreenButton()
Deprecated.useWorldHopper.changeWorldDirect(World)insteadReturns the rectangle of the "Select world" button on the main login screen.- Returns:
-
changeWorld
@Deprecated public static boolean changeWorld(int givenWorld)
Deprecated.useWorldHopper.changeWorldDirect(World)insteadChanges the selected world to the given world Note: Based on getWorldRectangle, see method docs for possible errors.- Parameters:
givenWorld- The world you want to hop to- Returns:
- True if selected world is given world already, or if given world successfully selected.
-
getWorldRectangle
@Deprecated public static java.awt.Rectangle getWorldRectangle(int world)
Deprecated.useWorldHopper.changeWorldDirect(World)insteadGets the rectangle for the world button in the login world screen. Possible Errors: If RS changes their world column list size, rectangle is returned incorrectly. If these do change, you have to set them yourself with setWorldListColumnSize, and then it will work. If RS changes the world list base X/Y you will have to set them yourself using the methods setBaseX, setBaseY These are not things easily auto detected by our client, and as such are manually updated and hardcoded.- Parameters:
world- world number (>300 and <300 both work)- Returns:
- Rectangle of representing the button for the world, null if no world matching ID found
-
getWorldIndex
@Deprecated public static int getWorldIndex(int world)
Deprecated.useWorldHopper.changeWorldDirect(World)insteadGets the location in the worlds array for the given world, used in login world screen- Parameters:
world- world number (>300 and <300 both work)- Returns:
- world index in the worlds array, -1 if no world matching ID found
-
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()
-
getWorldListColumnSize
@Deprecated public static int getWorldListColumnSize()
Deprecated.useWorldHopper.changeWorldDirect(World)insteadWorld List Column Size is the number of worlds listed in the columns (usually you can just use the first column) Used to determine location of world selection buttons. Note: RS may change these, usually they change every time they update the world count.- Returns:
-
setWorldListColumnSize
@Deprecated public static void setWorldListColumnSize(int worldListColumnSize)
Deprecated.
-
getBaseX
@Deprecated public static int getBaseX()
Deprecated.
-
setBaseX
@Deprecated public static void setBaseX(int baseX)
Deprecated.
-
getBaseY
@Deprecated public static int getBaseY()
Deprecated.
-
setBaseY
@Deprecated public static void setBaseY(int baseY)
Deprecated.
-
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)
-
getHopWorld
public static int getHopWorld()
-
setHopWorld
public static void setHopWorld(int hopWorld)
-
-