Package org.dreambot.api
Class Client
- java.lang.Object
-
- org.dreambot.api.Client
-
public class Client extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
fireScriptEvent(@NonNull RuneScriptEvent event)
static void
gainFocus()
Calls a focus gained event if the client does not currently have focus This behaves as if you were to click the icon in your task bar, no separate events needed.static int
getAccountStatus()
static @NonNull Tile
getBase()
Returns the region's base tile (UsesgetBaseX()
andgetBaseY()
) to position tile.static int
getBaseX()
Returns the region's base xstatic int
getBaseY()
Returns the region's base ystatic @NonNull java.awt.Canvas
getCanvas()
Gets the RS canvasstatic @NonNull java.awt.image.BufferedImage
getCanvasImage()
static @NonNull CollisionMap[]
getCollisionMaps()
Gets all collision mapsstatic int
getCurrentWorld()
Deprecated.static @Nullable Tile
getDestination()
Gets the tile of your destinationstatic int
getDestX()
Gets the destination Xstatic int
getDestY()
Gets the destination Ystatic @NonNull java.util.List<Entity>
getEntities()
static int
getForcedFPS()
static @Nullable ForumUser
getForumUser()
static int
getFPS()
Gets the FPS limit set by the client, or 50 FPS if it's not activestatic @NonNull FriendHandler
getFriendHandler()
Deprecated.seeFriends
insteadstatic int
getGameCycle()
Gets the game cyclestatic @Nullable java.net.Socket
getGameSocket()
static @NonNull GameState
getGameState()
Gets the current game statestatic int
getGameStateID()
Gets the current game state ID.static int
getGameTick()
Gets the current game tick, which increases roughly every 600msstatic @NonNull java.util.List<GraphicsObject>
getGraphicsObjects()
Deprecated.static @NonNull java.lang.String
getHost()
static int
getIdleTime()
Gets idle timestatic @NonNull Instance
getInstance()
Gets the bot instancestatic int
getLoginIndex()
Gets the login indexstatic @NonNull RSLoginResponse
getLoginResponse()
static int
getMapAngle()
Gets map rotationstatic int
getMembershipLeft()
static @Nullable java.lang.String
getMessage0()
static @Nullable java.lang.String
getMessage1()
static @Nullable java.lang.String
getMessage2()
static @NonNull java.util.List<org.dreambot.api.wrappers.cache.MessageContainer>
getMessageContainers()
Returns all message containersstatic int
getMyPlayerIndex()
Gets your local player's indexstatic @Nullable java.lang.String
getPassword()
Returns the player's passwordstatic int
getPlane()
Gets your current planestatic @NonNull java.util.List<Projectile>
getProjectiles()
Deprecated.static int
getRunescapeFps()
static @NonNull SocialHandler
getSocialHandler()
Deprecated.static int[][][]
getTileHeights()
Gets tile heightsstatic byte[][][]
getTileSettings()
Gets tile settingsstatic @Nullable java.lang.String
getUsername()
Gets the username or email that was entered at the login screenstatic @NonNull Viewport
getViewport()
Returns the current viewportstatic int
getViewportHeight()
static @NonNull ViewportTools
getViewportTools()
Returns viewport tool.static int
getViewportWidth()
static boolean
hasFocus()
Returns if the RS client currently has focusstatic boolean
hasMembersAccess()
Checks if you currently have access to members features in OSRSstatic void
ignoreScriptId(int id)
static boolean
isCameraInMotion()
Checks if the camera is in motionstatic boolean
isCpuSaver()
static boolean
isDynamicRegion()
Shows if you are in a dynamic/instanced regionstatic boolean
isGroupIronman()
Checks if the current character is a group ironmanstatic boolean
isInCutscene()
Checks if an in game cutscene is activestatic boolean
isIronman()
Checks if the current character is any non-group ironmanstatic boolean
isLoggedIn()
Checks if you're logged instatic boolean
isMembers()
static boolean
isRenderingDisabled()
static boolean
isUltimateIronman()
Checks if the current character is an ultimate ironmanstatic boolean
isWorldSelectorOpen()
Checks if the world selector is openstatic void
loseFocus()
Sends a focus lost event if the client currently has focus This sends no other events, losing focus by mouse would suggest moving mouse off canvas and then losing focus Losing focus by keyboard would expect the alt key to be pressed at least (for alt+tab)static boolean
readyToLoad()
static void
removeIgnoreScriptId(int id)
static double
seededRandom()
Returns a random number seeded by account name between .9 and 1.1static void
setCameraInMotion(boolean cameraInMotion)
Sets the camera in motionstatic void
setForcedFPS(int fps)
static void
setIdleTime(int idleTime)
static void
setMapAngleDirect(int angle)
static void
setRenderingDisabled(boolean disabled)
static void
setViewport(@NonNull Viewport viewport)
Sets the viewport
-
-
-
Method Detail
-
setForcedFPS
public static void setForcedFPS(int fps)
-
isRenderingDisabled
public static boolean isRenderingDisabled()
-
setRenderingDisabled
public static void setRenderingDisabled(boolean disabled)
-
getForumUser
public static @Nullable ForumUser getForumUser()
-
getHost
public static @NonNull java.lang.String getHost()
-
getAccountStatus
public static int getAccountStatus()
-
getGameSocket
public static @Nullable java.net.Socket getGameSocket()
-
getCanvasImage
public static @NonNull java.awt.image.BufferedImage getCanvasImage()
-
readyToLoad
public static boolean readyToLoad()
-
getGameCycle
public static int getGameCycle()
Gets the game cycle- Returns:
- game cycle
-
getFPS
public static int getFPS()
Gets the FPS limit set by the client, or 50 FPS if it's not active- Returns:
- FPS
-
isCpuSaver
public static boolean isCpuSaver()
-
getIdleTime
public static int getIdleTime()
Gets idle time- Returns:
- idle time
-
setIdleTime
public static void setIdleTime(int idleTime)
-
isLoggedIn
public static boolean isLoggedIn()
Checks if you're logged in- Returns:
- true if you're logged in false if you're not
-
getGameState
public static @NonNull GameState getGameState()
Gets the current game state- Returns:
- game state
-
getGameStateID
public static int getGameStateID()
Gets the current game state ID.- Returns:
- game state
-
getLoginIndex
public static int getLoginIndex()
Gets the login index- Returns:
- login index
-
getMapAngle
public static int getMapAngle()
Gets map rotation- Returns:
- map angle
-
setMapAngleDirect
public static void setMapAngleDirect(int angle)
-
getPlane
public static int getPlane()
Gets your current plane- Returns:
- plane
-
getBaseY
public static int getBaseY()
Returns the region's base y- Returns:
- y
-
getBaseX
public static int getBaseX()
Returns the region's base x- Returns:
- x
-
getBase
public static @NonNull Tile getBase()
Returns the region's base tile (UsesgetBaseX()
andgetBaseY()
) to position tile.- Returns:
- the base tile of the region.
-
isWorldSelectorOpen
public static boolean isWorldSelectorOpen()
Checks if the world selector is open- Returns:
- true if it's open false if it's not
-
isInCutscene
public static boolean isInCutscene()
Checks if an in game cutscene is active- Returns:
- true if there's a cutscene active, otherwise false
-
getTileSettings
public static byte[][][] getTileSettings()
Gets tile settings- Returns:
- tile settings
-
getTileHeights
public static int[][][] getTileHeights()
Gets tile heights- Returns:
- tile heights
-
getCurrentWorld
@Deprecated public static int getCurrentWorld()
Deprecated.
-
getMessageContainers
public static @NonNull java.util.List<org.dreambot.api.wrappers.cache.MessageContainer> getMessageContainers()
Returns all message containers- Returns:
- message containers
-
getProjectiles
@Deprecated public static @NonNull java.util.List<Projectile> getProjectiles()
Deprecated.
-
getGraphicsObjects
@Deprecated public static @NonNull java.util.List<GraphicsObject> getGraphicsObjects()
Deprecated.
-
getPassword
public static @Nullable java.lang.String getPassword()
Returns the player's password- Returns:
- password
-
getMyPlayerIndex
public static int getMyPlayerIndex()
Gets your local player's index- Returns:
- local player's index
-
getCanvas
public static @NonNull java.awt.Canvas getCanvas()
Gets the RS canvas- Returns:
- canvas
-
getCollisionMaps
public static @NonNull CollisionMap[] getCollisionMaps()
Gets all collision maps- Returns:
- collision maps
-
getSocialHandler
@Deprecated public static @NonNull SocialHandler getSocialHandler()
Deprecated.
-
getFriendHandler
@Deprecated public static @NonNull FriendHandler getFriendHandler()
Deprecated.seeFriends
instead
-
getUsername
public static @Nullable java.lang.String getUsername()
Gets the username or email that was entered at the login screen- Returns:
- username or email
-
getEntities
public static @NonNull java.util.List<Entity> getEntities()
- Returns:
- list of the listed entities
-
getInstance
public static @NonNull Instance getInstance()
Gets the bot instance- Returns:
- instance
-
getViewport
public static @NonNull Viewport getViewport()
Returns the current viewport- Returns:
- viewport
-
setViewport
public static void setViewport(@NonNull Viewport viewport)
Sets the viewport- Parameters:
viewport
- Viewport
-
getViewportWidth
public static int getViewportWidth()
-
getViewportHeight
public static int getViewportHeight()
-
getViewportTools
public static @NonNull ViewportTools getViewportTools()
Returns viewport tool.- Returns:
- viewport tools
-
getDestX
public static int getDestX()
Gets the destination X- Returns:
- destination X
-
getDestY
public static int getDestY()
Gets the destination Y- Returns:
- destination Y
-
getDestination
public static @Nullable Tile getDestination()
Gets the tile of your destination- Returns:
- Your player's destination, null if not moving
-
isCameraInMotion
public static boolean isCameraInMotion()
Checks if the camera is in motion- Returns:
- true if it's moving
-
setCameraInMotion
public static void setCameraInMotion(boolean cameraInMotion)
Sets the camera in motion- Parameters:
cameraInMotion
- Camera in motion
-
seededRandom
public static double seededRandom()
Returns a random number seeded by account name between .9 and 1.1- Returns:
- Double between .9 and 1.1
-
getMessage0
public static @Nullable java.lang.String getMessage0()
-
getMessage1
public static @Nullable java.lang.String getMessage1()
-
getMessage2
public static @Nullable java.lang.String getMessage2()
-
getLoginResponse
public static @NonNull RSLoginResponse getLoginResponse()
-
getMembershipLeft
public static int getMembershipLeft()
-
isMembers
public static boolean isMembers()
-
isIronman
public static boolean isIronman()
Checks if the current character is any non-group ironman- Returns:
- true if it's any non-group ironman, false otherwise
-
isGroupIronman
public static boolean isGroupIronman()
Checks if the current character is a group ironman- Returns:
- true if it's a group ironman, false otherwise
-
isUltimateIronman
public static boolean isUltimateIronman()
Checks if the current character is an ultimate ironman- Returns:
- true if it's an ultimate ironman
-
hasMembersAccess
public static boolean hasMembersAccess()
Checks if you currently have access to members features in OSRS- Returns:
- True if members and on a members world, False if world is f2p, not logged in, or do not have membership
-
isDynamicRegion
public static boolean isDynamicRegion()
Shows if you are in a dynamic/instanced region- Returns:
- true if dynamic region, else false
-
fireScriptEvent
public static boolean fireScriptEvent(@NonNull RuneScriptEvent event)
-
ignoreScriptId
public static void ignoreScriptId(int id)
-
removeIgnoreScriptId
public static void removeIgnoreScriptId(int id)
-
getRunescapeFps
public static int getRunescapeFps()
-
hasFocus
public static boolean hasFocus()
Returns if the RS client currently has focus- Returns:
- True if focused, else false
-
gainFocus
public static void gainFocus()
Calls a focus gained event if the client does not currently have focus This behaves as if you were to click the icon in your task bar, no separate events needed. For mouse to gain focus you need mouse events For keyboard to gain focus (alt+tab) sends a tab released event after gaining focus
-
loseFocus
public static void loseFocus()
Sends a focus lost event if the client currently has focus This sends no other events, losing focus by mouse would suggest moving mouse off canvas and then losing focus Losing focus by keyboard would expect the alt key to be pressed at least (for alt+tab)
-
getGameTick
public static int getGameTick()
Gets the current game tick, which increases roughly every 600ms
-
getForcedFPS
public static int getForcedFPS()
-
-