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(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 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 java.awt.Canvas
getCanvas()
Gets the RS canvasstatic java.awt.image.BufferedImage
getCanvasImage()
static CollisionMap[]
getCollisionMaps()
Gets all collision mapsstatic int
getCurrentWorld()
Deprecated.static Tile
getDestination()
Gets the tile of your destinationstatic int
getDestX()
Gets the destination Xstatic int
getDestY()
Gets the destination Ystatic java.util.List<Entity>
getEntities()
Gets all entitiesstatic int
getForcedFPS()
static ForumUser
getForumUser()
static int
getFPS()
Gets the FPS limit set by the client, or 50 FPS if it's not activestatic FriendHandler
getFriendHandler()
Deprecated.seeFriends
insteadstatic int
getGameCycle()
Gets the game cyclestatic java.net.Socket
getGameSocket()
static 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 java.util.List<GraphicsObject>
getGraphicsObjects()
static java.lang.String
getHost()
static int
getIdleTime()
Gets idle timestatic Instance
getInstance()
Gets the bot instancestatic int
getLoginIndex()
Gets the login indexstatic RSLoginResponse
getLoginResponse()
static int
getMapAngle()
Gets map rotationstatic int
getMembershipLeft()
static java.lang.String
getMessage0()
static java.lang.String
getMessage1()
static java.lang.String
getMessage2()
static java.util.List<org.dreambot.api.wrappers.cache.MessageContainer>
getMessageContainers()
Returns all message containersstatic int
getMyPlayerIndex()
Gets your local player's indexstatic java.lang.String
getPassword()
Returns the player's passwordstatic int
getPlane()
Gets your current planestatic java.util.List<Projectile>
getProjectiles()
static int
getRunescapeFps()
static SocialHandler
getSocialHandler()
Deprecated.static int[][][]
getTileHeights()
Gets tile heightsstatic byte[][][]
getTileSettings()
Gets tile settingsstatic java.lang.String
getUsername()
Gets the login usernamestatic Viewport
getViewport()
Returns the current viewportstatic int
getViewportHeight()
static 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
setForumUser(java.lang.String username, int memberId, ForumRank[] ranks)
static void
setIdleTime(int idleTime)
static void
setMapAngleDirect(int angle)
static void
setRenderingDisabled(boolean disabled)
static void
setViewport(Viewport viewport)
Sets the viewport
-
-
-
Method Detail
-
setForumUser
public static void setForumUser(java.lang.String username, int memberId, ForumRank[] ranks)
-
getForcedFPS
public static int getForcedFPS()
-
setForcedFPS
public static void setForcedFPS(int fps)
-
isRenderingDisabled
public static boolean isRenderingDisabled()
-
setRenderingDisabled
public static void setRenderingDisabled(boolean disabled)
-
getForumUser
public static ForumUser getForumUser()
-
getHost
public static java.lang.String getHost()
-
getAccountStatus
public static int getAccountStatus()
-
getGameSocket
public static java.net.Socket getGameSocket()
-
getCanvasImage
public static 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 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 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 java.util.List<org.dreambot.api.wrappers.cache.MessageContainer> getMessageContainers()
Returns all message containers- Returns:
- message containers
-
getProjectiles
public static java.util.List<Projectile> getProjectiles()
-
getGraphicsObjects
public static java.util.List<GraphicsObject> getGraphicsObjects()
-
getPassword
public static 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 java.awt.Canvas getCanvas()
Gets the RS canvas- Returns:
- canvas
-
getCollisionMaps
public static CollisionMap[] getCollisionMaps()
Gets all collision maps- Returns:
- collision maps
-
getSocialHandler
@Deprecated public static SocialHandler getSocialHandler()
Deprecated.
-
getFriendHandler
@Deprecated public static FriendHandler getFriendHandler()
Deprecated.seeFriends
instead
-
getUsername
public static java.lang.String getUsername()
Gets the login username- Returns:
- username
-
getEntities
public static java.util.List<Entity> getEntities()
Gets all entities- Returns:
- list of all entities
-
getInstance
public static Instance getInstance()
Gets the bot instance- Returns:
- instance
-
getViewport
public static Viewport getViewport()
Returns the current viewport- Returns:
- viewport
-
setViewport
public static void setViewport(Viewport viewport)
Sets the viewport- Parameters:
viewport
- Viewport
-
getViewportWidth
public static int getViewportWidth()
-
getViewportHeight
public static int getViewportHeight()
-
getViewportTools
public static 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 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 java.lang.String getMessage0()
-
getMessage1
public static java.lang.String getMessage1()
-
getMessage2
public static java.lang.String getMessage2()
-
getLoginResponse
public static 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(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
-
-