Class Client


  • public class Client
    extends java.lang.Object
    • 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 (Uses getBaseX() and getBaseY()) 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
      • getMessageContainers

        public static @NonNull java.util.List<org.dreambot.api.wrappers.cache.MessageContainer> getMessageContainers()
        Returns all message containers
        Returns:
        message containers
      • 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.
        See respective actual handler instead Friends or ClanChat
      • getFriendHandler

        @Deprecated
        public static @NonNull FriendHandler getFriendHandler()
        Deprecated.
        see Friends 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()
        Gets all NPCs, Players, and GameObject
        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()