Interface Client

  • All Superinterfaces:
    GameEngine

    public interface Client
    extends GameEngine
    Represents the RuneScape client.
    • Method Detail

      • getCallbacks

        Callbacks getCallbacks()
        The injected client invokes these callbacks to send events to us
      • getDrawCallbacks

        DrawCallbacks getDrawCallbacks()
        The injected client invokes these callbacks for scene drawing, which is used by the gpu plugin to override the client's normal scene drawing code
      • setDrawCallbacks

        void setDrawCallbacks​(DrawCallbacks drawCallbacks)
      • getBuildID

        String getBuildID()
      • getPlayers

        List<Player> getPlayers()
        Gets a list of all valid players from the player cache.
        Returns:
        a list of all players
      • getNpcs

        List<NPC> getNpcs()
        Gets a list of all valid NPCs from the NPC cache.
        Returns:
        a list of all NPCs
      • getCachedNPCs

        NPC[] getCachedNPCs()
        Gets an array of all cached NPCs.
        Returns:
        cached NPCs
      • getCachedPlayers

        Player[] getCachedPlayers()
        Gets an array of all cached players.
        Returns:
        cached players
      • getBoostedSkillLevel

        int getBoostedSkillLevel​(Skill skill)
        Gets the current modified level of a skill.
        Parameters:
        skill - the skill
        Returns:
        the modified skill level
      • getRealSkillLevel

        int getRealSkillLevel​(Skill skill)
        Gets the real level of a skill.
        Parameters:
        skill - the skill
        Returns:
        the skill level
      • getTotalLevel

        int getTotalLevel()
        Calculates the total level from real skill levels.
        Returns:
        the total level
      • addChatMessage

        void addChatMessage​(ChatMessageType type,
                            String name,
                            String message,
                            String sender)
        Adds a new chat message to the chatbox.
        Parameters:
        type - the type of message
        name - the name of the player that sent the message
        message - the message contents
        sender - the sender/channel name
      • getGameState

        GameState getGameState()
        Gets the current game state.
        Returns:
        the game state
      • setGameState

        void setGameState​(GameState gameState)
        Sets the current game state
        Parameters:
        gameState -
      • stopNow

        void stopNow()
        Causes the client to shutdown. It is faster than Applet.stop() because it doesn't wait for 4000ms. This will call System.exit(int) when it is done
      • getUsername

        String getUsername()
        Gets the current logged in username.
        Returns:
        the logged in username
      • setUsername

        void setUsername​(String name)
        Sets the current logged in username.
        Parameters:
        name - the logged in username
      • setPassword

        void setPassword​(String password)
        Sets the password on login screen.
        Parameters:
        password - the login screen password
      • setOtp

        void setOtp​(String otp)
        Sets the 6 digit pin used for authenticator on login screen.
        Parameters:
        otp - one time password
      • getCurrentLoginField

        int getCurrentLoginField()
        Gets currently selected login field. 0 is username, and 1 is password.
        Returns:
        currently selected login field
      • getLoginIndex

        int getLoginIndex()
        Gets index of current login state. 2 is username/password form, 4 is authenticator form
        Returns:
        current login state index
      • getAccountType

        AccountType getAccountType()
        Gets the account type of the logged in player.
        Returns:
        the account type
      • getCanvas

        Canvas getCanvas()
        Description copied from interface: GameEngine
        Gets the canvas that contains everything.
        Specified by:
        getCanvas in interface GameEngine
        Returns:
        the game canvas
      • getFPS

        int getFPS()
        Gets the current FPS (frames per second).
        Returns:
        the FPS
      • getCameraX

        int getCameraX()
        Gets the x-axis coordinate of the camera.

        This value is a local coordinate value similar to getLocalDestinationLocation().

        Returns:
        the camera x coordinate
      • getCameraY

        int getCameraY()
        Gets the y-axis coordinate of the camera.

        This value is a local coordinate value similar to getLocalDestinationLocation().

        Returns:
        the camera y coordinate
      • getCameraZ

        int getCameraZ()
        Gets the z-axis coordinate of the camera.

        This value is a local coordinate value similar to getLocalDestinationLocation().

        Returns:
        the camera z coordinate
      • getCameraPitch

        int getCameraPitch()
        Gets the actual pitch of the camera.

        The value returned by this method is measured in JAU, or Jagex Angle Unit, which is 1/1024 of a revolution.

        Returns:
        the camera pitch
      • getCameraYaw

        int getCameraYaw()
        Gets the yaw of the camera.
        Returns:
        the camera yaw
      • getWorld

        int getWorld()
        Gets the current world number of the logged in player.
        Returns:
        the logged in world number
      • getCanvasHeight

        int getCanvasHeight()
        Gets the canvas height
        Returns:
      • getCanvasWidth

        int getCanvasWidth()
        Gets the canvas width
        Returns:
      • getViewportHeight

        int getViewportHeight()
        Gets the height of the viewport.
        Returns:
        the viewport height
      • getViewportWidth

        int getViewportWidth()
        Gets the width of the viewport.
        Returns:
        the viewport width
      • getViewportXOffset

        int getViewportXOffset()
        Gets the x-axis offset of the viewport.
        Returns:
        the x-axis offset
      • getViewportYOffset

        int getViewportYOffset()
        Gets the y-axis offset of the viewport.
        Returns:
        the y-axis offset
      • getScale

        int getScale()
        Gets the scale of the world (zoom value).
        Returns:
        the world scale
      • getMouseCanvasPosition

        Point getMouseCanvasPosition()
        Gets the current position of the mouse on the canvas.
        Returns:
        the mouse canvas position
      • getTileHeights

        int[][][] getTileHeights()
        Gets a 3D array containing the heights of tiles in the current scene.
        Returns:
        the tile heights
      • getTileSettings

        byte[][][] getTileSettings()
        Gets a 3D array containing the settings of tiles in the current scene.
        Returns:
        the tile settings
      • getPlane

        int getPlane()
        Gets the current plane the player is on.

        This value indicates the current map level above ground level, where ground level is 0. For example, going up a ladder in Lumbridge castle will put the player on plane 1.

        Note: This value will never be below 0. Basements and caves below ground level use a tile offset and are still considered plane 0 by the game.

        Returns:
        the plane
      • getScene

        Scene getScene()
        Gets the current scene
      • getLocalPlayer

        @Nullable
        Player getLocalPlayer()
        Gets the logged in player instance.
        Returns:
        the logged in player
      • getItemDefinition

        @Nonnull
        ItemComposition getItemDefinition​(int id)
        Gets the item composition corresponding to an items ID.
        Parameters:
        id - the item ID
        Returns:
        the corresponding item composition
        See Also:
        ItemID
      • createItemSprite

        @Nullable
        SpritePixels createItemSprite​(int itemId,
                                      int quantity,
                                      int border,
                                      int shadowColor,
                                      int stackable,
                                      boolean noted,
                                      int scale)
        Creates an item icon sprite with passed variables.
        Parameters:
        itemId - the item ID
        quantity - the item quantity
        border - whether to draw a border
        shadowColor - the shadow color
        stackable - whether the item is stackable
        noted - whether the item is noted
        scale - the scale of the sprite
        Returns:
        the created sprite
      • getSprites

        @Nullable
        SpritePixels[] getSprites​(IndexDataBase source,
                                  int archiveId,
                                  int fileId)
        Loads and creates the sprite images of the passed archive and file IDs.
        Parameters:
        source - the sprite index
        archiveId - the sprites archive ID
        fileId - the sprites file ID
        Returns:
        the sprite image of the file
      • getIndexSprites

        IndexDataBase getIndexSprites()
        Gets the sprite index.
      • getIndexScripts

        IndexDataBase getIndexScripts()
        Gets the script index.
      • getIndexConfig

        IndexDataBase getIndexConfig()
        Gets the config index.
      • getBaseX

        int getBaseX()
        Returns the x-axis base coordinate.

        This value is the x-axis world coordinate of tile (0, 0) in the current scene (ie. the bottom-left most coordinates in the scene).

        Returns:
        the base x-axis coordinate
      • getBaseY

        int getBaseY()
        Returns the y-axis base coordinate.

        This value is the y-axis world coordinate of tile (0, 0) in the current scene (ie. the bottom-left most coordinates in the scene).

        Returns:
        the base y-axis coordinate
      • getMouseCurrentButton

        int getMouseCurrentButton()
        Gets the current mouse button that is pressed.
        Returns:
        the pressed mouse button
      • getSelectedSceneTile

        @Nullable
        Tile getSelectedSceneTile()
        Gets the currently selected tile (ie. last right clicked tile).
        Returns:
        the selected tile
      • isDraggingWidget

        boolean isDraggingWidget()
        Checks whether a widget is currently being dragged.
        Returns:
        true if dragging a widget, false otherwise
      • getDraggedWidget

        @Nullable
        Widget getDraggedWidget()
        Gets the widget currently being dragged.
        Returns:
        the dragged widget, null if not dragging any widget
      • getDraggedOnWidget

        @Nullable
        Widget getDraggedOnWidget()
        Gets the widget that is being dragged on.

        The widget being dragged has the WidgetConfig.DRAG_ON flag set, and is the widget currently under the dragged widget.

        Returns:
        the dragged on widget, null if not dragging any widget
      • setDraggedOnWidget

        void setDraggedOnWidget​(Widget widget)
        Sets the widget that is being dragged on.
        Parameters:
        widget - the new dragged on widget
      • getWidgetRoots

        Widget[] getWidgetRoots()
        Gets the root widgets.
        Returns:
        the root widgets
      • getWidget

        @Nullable
        Widget getWidget​(WidgetInfo widget)
        Gets a widget corresponding to the passed widget info.
        Parameters:
        widget - the widget info
        Returns:
        the widget
      • getWidget

        @Nullable
        Widget getWidget​(int groupId,
                         int childId)
        Gets a widget by its raw group ID and child ID.

        Note: Use getWidget(WidgetInfo) for a more human-readable version of this method.

        Parameters:
        groupId - the group ID
        childId - the child widget ID
        Returns:
        the widget corresponding to the group and child pair
      • getWidgetPositionsX

        int[] getWidgetPositionsX()
        Gets an array containing the x-axis canvas positions of all widgets.
        Returns:
        array of x-axis widget coordinates
      • getWidgetPositionsY

        int[] getWidgetPositionsY()
        Gets an array containing the y-axis canvas positions of all widgets.
        Returns:
        array of y-axis widget coordinates
      • getEnergy

        int getEnergy()
        Gets the current run energy of the logged in player.
        Returns:
        the run energy
      • getWeight

        int getWeight()
        Gets the current weight of the logged in player.
        Returns:
        the weight
      • getPlayerOptions

        String[] getPlayerOptions()
        Gets an array of options that can currently be used on other players.

        For example, if the player is in a PVP area the "Attack" option will become available in the array. Otherwise, it won't be there.

        Returns:
        an array of options
      • getPlayerOptionsPriorities

        boolean[] getPlayerOptionsPriorities()
        Gets an array of whether an option is enabled or not.
        Returns:
        the option priorities
      • getPlayerMenuTypes

        int[] getPlayerMenuTypes()
        Gets an array of player menu types.
        Returns:
        the player menu types
      • getWorldList

        World[] getWorldList()
        Gets a list of all RuneScape worlds.
        Returns:
        world list
      • getMenuEntries

        MenuEntry[] getMenuEntries()
        Gets an array of currently open right-click menu entries that can be clicked and activated.
        Returns:
        array of open menu entries
      • setMenuEntries

        void setMenuEntries​(MenuEntry[] entries)
        Sets the array of open menu entries.

        This method should typically be used in the context of the MenuOpened event, since setting the menu entries will be overwritten the next frame

        Parameters:
        entries - new array of open menu entries
      • isMenuOpen

        boolean isMenuOpen()
        Checks whether a right-click menu is currently open.
        Returns:
        true if a menu is open, false otherwise
      • getMapAngle

        int getMapAngle()
        Gets the angle of the map, or camera yaw.
        Returns:
        the map angle
      • isResized

        boolean isResized()
        Checks whether the client window is currently resized.
        Returns:
        true if resized, false otherwise
      • getRevision

        int getRevision()
        Gets the client revision number.
        Returns:
        the revision
      • getMapRegions

        int[] getMapRegions()
        Gets an array of map region IDs that are currently loaded.
        Returns:
        the map regions
      • getInstanceTemplateChunks

        int[][][] getInstanceTemplateChunks()
        Contains a 3D array of template chunks for instanced areas.

        The array returned is of format [z][x][y], where z is the plane, x and y the x-axis and y-axis coordinates of a tile divided by the size of a chunk.

        The bits of the int value held by the coordinates are -1 if there is no data, structured in the following format:

        
          0                   1                   2                   3
          0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         | |rot|     y chunk coord     |    x chunk coord    |pln|       |
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         
        Returns:
        the array of instance template chunks
        See Also:
        Constants.CHUNK_SIZE, InstanceTemplates
      • getXteaKeys

        int[][] getXteaKeys()
        Returns a 2D array containing XTEA encryption keys used to decrypt map region files.

        The array maps the region keys at index n to the region ID held in getMapRegions() at n.

        The array of keys for the region make up a 128-bit encryption key spread across 4 integers.

        Returns:
        the XTEA encryption keys
      • getVarps

        @VisibleForDevtools
        int[] getVarps()
        Gets an array of all client variables.
        Returns:
        local player variables
      • getVar

        int getVar​(VarPlayer varPlayer)
        Gets the value corresponding to the passed player variable.
        Parameters:
        varPlayer - the player variable
        Returns:
        the value
      • getVar

        int getVar​(Varbits varbit)
        Gets a value corresponding to the passed variable.
        Parameters:
        varbit - the variable
        Returns:
        the value
      • getVar

        int getVar​(VarClientInt varClientInt)
        Gets an int value corresponding to the passed variable.
        Parameters:
        varClientInt - the variable
        Returns:
        the value
      • getVar

        String getVar​(VarClientStr varClientStr)
        Gets a String value corresponding to the passed variable.
        Parameters:
        varClientStr - the variable
        Returns:
        the value
      • getVarpValue

        @VisibleForExternalPlugins
        int getVarpValue​(int varpId)
        Gets the value of a given VarPlayer.
        Parameters:
        varpId - the VarPlayer id
        Returns:
        the value
      • getVarbitValue

        @VisibleForExternalPlugins
        int getVarbitValue​(int varbitId)
        Gets the value of a given Varbit.
        Parameters:
        varbitId - the varbit id
        Returns:
        the value
      • getVarcIntValue

        @VisibleForExternalPlugins
        int getVarcIntValue​(int varcIntId)
        Gets the value of a given VarClientInt
        Parameters:
        varcIntId - the VarClientInt id
        Returns:
        the value
      • getVarcStrValue

        @VisibleForExternalPlugins
        String getVarcStrValue​(int varcStrId)
        Gets the value of a given VarClientStr
        Parameters:
        varcStrId - the VarClientStr id
        Returns:
        the value
      • setVar

        void setVar​(VarClientStr varClientStr,
                    String value)
        Sets a VarClientString to the passed value
      • setVar

        void setVar​(VarClientInt varClientStr,
                    int value)
        Sets a VarClientInt to the passed value
      • setVarbit

        void setVarbit​(Varbits varbit,
                       int value)
        Sets the value of a given variable.
        Parameters:
        varbit - the variable
        value - the new value
      • getVarbitValue

        @VisibleForDevtools
        int getVarbitValue​(int[] varps,
                           int varbitId)
        Gets the value of a given variable.
        Parameters:
        varps - passed varbits
        varbitId - the variable ID
        Returns:
        the value
        See Also:
        Varbits.id
      • getVarpValue

        @VisibleForDevtools
        int getVarpValue​(int[] varps,
                         int varpId)
        Gets the value of a given VarPlayer.
        Parameters:
        varps - passed varps
        varpId - the VarpPlayer id
        Returns:
        the value
        See Also:
        VarPlayer.id
      • setVarpValue

        @VisibleForDevtools
        void setVarpValue​(int[] varps,
                          int varpId,
                          int value)
        Sets the value of a given VarPlayer.
        Parameters:
        varps - passed varps
        varpId - the VarpPlayer id
        value - the value
        See Also:
        VarPlayer.id
      • setVarbitValue

        @VisibleForDevtools
        void setVarbitValue​(int[] varps,
                            int varbit,
                            int value)
        Sets the value of a given variable.
        Parameters:
        varps - passed varbits
        varbit - the variable
        value - the value
        See Also:
        Varbits.id
      • getWidgetFlags

        HashTable getWidgetFlags()
        Gets the widget flags table.
        Returns:
        the widget flags table
      • getComponentTable

        HashTable<WidgetNode> getComponentTable()
        Gets the widget node component table.
        Returns:
        the widget node component table
        See Also:
        WidgetNode
      • getGrandExchangeOffers

        GrandExchangeOffer[] getGrandExchangeOffers()
        Gets an array of current grand exchange offers.
        Returns:
        all grand exchange offers
      • isPrayerActive

        boolean isPrayerActive​(Prayer prayer)
        Checks whether or not a prayer is currently active.
        Parameters:
        prayer - the prayer
        Returns:
        true if the prayer is active, false otherwise
      • getSkillExperience

        int getSkillExperience​(Skill skill)
        Gets the current experience towards a skill.
        Parameters:
        skill - the skill
        Returns:
        the experience
      • getOverallExperience

        long getOverallExperience()
        Get the total experience of the player
        Returns:
      • getGameDrawingMode

        int getGameDrawingMode()
        Gets the game drawing mode.
        Returns:
        the game drawing mode
      • setGameDrawingMode

        void setGameDrawingMode​(int gameDrawingMode)
        Sets the games drawing mode.
        Parameters:
        gameDrawingMode - the new drawing mode
      • refreshChat

        void refreshChat()
        Refreshes the chat.
      • getChatLineMap

        Map<Integer,​ChatLineBuffer> getChatLineMap()
        Gets the map of chat buffers.
        Returns:
        the chat buffers
      • getViewportWidget

        Widget getViewportWidget()
        Gets the viewport widget.

        The viewport is the area of the game above the chatbox and to the left of the mini-map.

        Returns:
        the viewport widget
      • getObjectDefinition

        ObjectComposition getObjectDefinition​(int objectId)
        Gets the object composition corresponding to an objects ID.
        Parameters:
        objectId - the object ID
        Returns:
        the corresponding object composition
        See Also:
        ObjectID
      • getNpcDefinition

        NPCComposition getNpcDefinition​(int npcId)
        Gets the NPC composition corresponding to an NPCs ID.
        Parameters:
        npcId - the npc ID
        Returns:
        the corresponding NPC composition
        See Also:
        NpcID
      • getMapElementConfigs

        MapElementConfig[] getMapElementConfigs()
        Gets an array of all world areas
        Returns:
        the world areas
      • getMapScene

        IndexedSprite[] getMapScene()
        Gets a sprite of the map scene
        Returns:
        the sprite
      • getMapDots

        SpritePixels[] getMapDots()
        Gets an array of currently drawn mini-map dots.
        Returns:
        all mini-map dots
      • getGameCycle

        int getGameCycle()
        Gets the local clients game cycle.

        Note: This value is incremented every 20ms.

        Returns:
        the game cycle
      • getMapIcons

        SpritePixels[] getMapIcons()
        Gets an array of current map icon sprites.
        Returns:
        the map icons
      • getModIcons

        IndexedSprite[] getModIcons()
        Gets an array of mod icon sprites.
        Returns:
        the mod icons
      • setModIcons

        void setModIcons​(IndexedSprite[] modIcons)
        Replaces the current mod icons with a new array.
        Parameters:
        modIcons - the new mod icons
      • createIndexedSprite

        IndexedSprite createIndexedSprite()
        Creates an empty indexed sprite.
        Returns:
        the sprite
      • createSpritePixels

        SpritePixels createSpritePixels​(int[] pixels,
                                        int width,
                                        int height)
        Creates a sprite image with given width and height containing the pixels.
        Parameters:
        pixels - the pixels
        width - the width
        height - the height
        Returns:
        the sprite image
      • getLocalDestinationLocation

        @Nullable
        LocalPoint getLocalDestinationLocation()
        Gets the location of the local player.
        Returns:
        the local player location
      • getProjectiles

        List<Projectile> getProjectiles()
        Gets a list of all projectiles currently spawned.
        Returns:
        all projectiles
      • getGraphicsObjects

        List<GraphicsObject> getGraphicsObjects()
        Gets a list of all graphics objects currently drawn.
        Returns:
        all graphics objects
      • getMusicVolume

        int getMusicVolume()
        Gets the music volume
        Returns:
        volume 0-255 inclusive
      • setMusicVolume

        void setMusicVolume​(int volume)
        Sets the music volume
        Parameters:
        volume - 0-255 inclusive
      • getSoundEffectVolume

        int getSoundEffectVolume()
        Gets the sound effect volume
        Returns:
        volume 0-127 inclusive
      • setSoundEffectVolume

        void setSoundEffectVolume​(int volume)
        Sets the sound effect volume
        Parameters:
        volume - 0-127 inclusive
      • getAreaSoundEffectVolume

        int getAreaSoundEffectVolume()
        Gets the area sound effect volume
        Returns:
        volume 0-127 inclusive
      • setAreaSoundEffectVolume

        void setAreaSoundEffectVolume​(int volume)
        Sets the area sound effect volume
        Parameters:
        volume - 0-127 inclusive
      • playSoundEffect

        void playSoundEffect​(int id)
        Play a sound effect at the player's current location. This is how UI, and player-generated (e.g. mining, woodcutting) sound effects are normally played.
        Parameters:
        id - the ID of the sound to play. Any int is allowed, but see SoundEffectID for some common ones
      • playSoundEffect

        void playSoundEffect​(int id,
                             int x,
                             int y,
                             int range)
        Play a sound effect from some point in the world.
        Parameters:
        id - the ID of the sound to play. Any int is allowed, but see SoundEffectID for some common ones
        x - the ground coordinate on the x axis
        y - the ground coordinate on the y axis
        range - the number of tiles away that the sound can be heard from
      • playSoundEffect

        void playSoundEffect​(int id,
                             int x,
                             int y,
                             int range,
                             int delay)
        Play a sound effect from some point in the world.
        Parameters:
        id - the ID of the sound to play. Any int is allowed, but see SoundEffectID for some common ones
        x - the ground coordinate on the x axis
        y - the ground coordinate on the y axis
        range - the number of tiles away that the sound can be heard from
        delay - the amount of frames before the sound starts playing
      • playSoundEffect

        void playSoundEffect​(int id,
                             int volume)
        Plays a sound effect, even if the player's sound effect volume is muted.
        Parameters:
        id - the ID of the sound effect - SoundEffectID
        volume - the volume to play the sound effect at, see SoundEffectVolume for values used in the settings interface. if the sound effect volume is not muted, uses the set volume
      • getBufferProvider

        BufferProvider getBufferProvider()
        Gets the clients graphic buffer provider.
        Returns:
        the buffer provider
      • getMouseIdleTicks

        int getMouseIdleTicks()
        Gets the amount of client ticks since the last mouse movement occurred.
        Returns:
        amount of idle mouse ticks
        See Also:
        Constants.CLIENT_TICK_LENGTH
      • getMouseLastPressedMillis

        long getMouseLastPressedMillis()
        Gets the time at which the last mouse press occurred in milliseconds since the UNIX epoch.
      • getKeyboardIdleTicks

        int getKeyboardIdleTicks()
        Gets the amount of client ticks since the last keyboard press occurred.
        Returns:
        amount of idle keyboard ticks
        See Also:
        Constants.CLIENT_TICK_LENGTH
      • changeMemoryMode

        void changeMemoryMode​(boolean lowMemory)
        Changes how game behaves based on memory mode. Low memory mode skips drawing of all floors and renders ground textures in low quality.
        Parameters:
        lowMemory - if we are running in low memory mode or not
      • getItemContainer

        @Nullable
        ItemContainer getItemContainer​(InventoryID inventory)
        Get the item container for an inventory.
        Parameters:
        inventory - the inventory type
        Returns:
        the item container
      • getIntStackSize

        int getIntStackSize()
        Gets the length of the cs2 vm's int stack
      • setIntStackSize

        void setIntStackSize​(int stackSize)
        Sets the length of the cs2 vm's int stack
      • getIntStack

        int[] getIntStack()
        Gets the cs2 vm's int stack
      • getStringStackSize

        int getStringStackSize()
        Gets the length of the cs2 vm's string stack
      • setStringStackSize

        void setStringStackSize​(int stackSize)
        Sets the length of the cs2 vm's string stack
      • getStringStack

        String[] getStringStack()
        Gets the cs2 vm's string stack
      • isFriended

        boolean isFriended​(String name,
                           boolean mustBeLoggedIn)
        Checks whether a player is on the friends list.
        Parameters:
        name - the name of the player
        mustBeLoggedIn - if they player is online
        Returns:
        true if the player is friends
      • getFriendContainer

        NameableContainer<Friend> getFriendContainer()
        Retrieve the nameable container containing friends
        Returns:
      • getIgnoreContainer

        NameableContainer<Ignore> getIgnoreContainer()
        Retrieve the nameable container containing ignores
        Returns:
      • getPreferences

        Preferences getPreferences()
        Gets the clients saved preferences.
        Returns:
        the client preferences
      • setCameraPitchRelaxerEnabled

        void setCameraPitchRelaxerEnabled​(boolean enabled)
        Sets whether the camera pitch can exceed the normal limits set by the RuneScape client.
        Parameters:
        enabled - new camera pitch relaxer value
      • setInvertYaw

        void setInvertYaw​(boolean invertYaw)
        Sets if the moving the camera horizontally should be backwards
      • setInvertPitch

        void setInvertPitch​(boolean invertPitch)
        Sets if the moving the camera vertically should be backwards
      • getRenderOverview

        RenderOverview getRenderOverview()
        Gets the world map overview.
        Returns:
        the world map overview
      • isStretchedEnabled

        boolean isStretchedEnabled()
        Checks whether the client is in stretched mode.
        Returns:
        true if the client is in stretched mode, false otherwise
      • setStretchedEnabled

        void setStretchedEnabled​(boolean state)
        Sets the client stretched mode state.
        Parameters:
        state - new stretched mode state
      • isStretchedFast

        boolean isStretchedFast()
        Checks whether the client is using fast rendering techniques when stretching the canvas.
        Returns:
        true if stretching is fast rendering, false otherwise
      • setStretchedFast

        void setStretchedFast​(boolean state)
        Sets whether to use fast rendering techniques when stretching the canvas.
        Parameters:
        state - new fast rendering state
      • setStretchedIntegerScaling

        void setStretchedIntegerScaling​(boolean state)
        Sets whether to force integer scale factor by rounding scale factors towards zero when stretching.
        Parameters:
        state - new integer scaling state
      • setStretchedKeepAspectRatio

        void setStretchedKeepAspectRatio​(boolean state)
        Sets whether to keep aspect ratio when stretching.
        Parameters:
        state - new keep aspect ratio state
      • setScalingFactor

        void setScalingFactor​(int factor)
        Sets the scaling factor when scaling resizable mode.
        Parameters:
        factor - new scaling factor
      • invalidateStretching

        void invalidateStretching​(boolean resize)
        Invalidates cached dimensions that are used for stretching and scaling.
        Parameters:
        resize - true to tell the game to resize the canvas on the next frame, false otherwise.
      • getStretchedDimensions

        Dimension getStretchedDimensions()
        Gets the current stretched dimensions of the client.
        Returns:
        the stretched dimensions
      • getRealDimensions

        Dimension getRealDimensions()
        Gets the real dimensions of the client before being stretched.
        Returns:
        the real dimensions
      • changeWorld

        void changeWorld​(World world)
        Changes the selected world to log in to.

        Note: this method will have no effect unless GameState is GameState.LOGIN_SCREEN.

        Parameters:
        world - the world to switch to
      • createWorld

        World createWorld()
        Creates a new instance of a world.
      • drawInstanceMap

        SpritePixels drawInstanceMap​(int z)
        Draws an instance map for the current viewed plane.
        Parameters:
        z - the plane
        Returns:
        the map sprite
      • runScript

        void runScript​(Object... args)
        Executes a client script from the cache This method must be ran on the client thread and is not reentrant
        Parameters:
        args - the script id, then any additional arguments to execute the script with
        See Also:
        ScriptID
      • hasHintArrow

        boolean hasHintArrow()
        Checks whether or not there is any active hint arrow.
        Returns:
        true if there is a hint arrow, false otherwise
      • getHintArrowType

        HintArrowType getHintArrowType()
        Gets the type of hint arrow currently displayed.
        Returns:
        the hint arrow type
      • clearHintArrow

        void clearHintArrow()
        Clears the current hint arrow.
      • setHintArrow

        void setHintArrow​(WorldPoint point)
        Sets a hint arrow to point to the passed location.
        Parameters:
        point - the location
      • setHintArrow

        void setHintArrow​(Player player)
        Sets a hint arrow to point to the passed player.
        Parameters:
        player - the player
      • setHintArrow

        void setHintArrow​(NPC npc)
        Sets a hint arrow to point to the passed NPC.
        Parameters:
        npc - the NPC
      • getHintArrowPoint

        WorldPoint getHintArrowPoint()
        Gets the world point that the hint arrow is directed at.
        Returns:
        hint arrow target
      • getHintArrowPlayer

        Player getHintArrowPlayer()
        Gets the player that the hint arrow is directed at.
        Returns:
        hint arrow target
      • getHintArrowNpc

        NPC getHintArrowNpc()
        Gets the NPC that the hint arrow is directed at.
        Returns:
        hint arrow target
      • isInterpolatePlayerAnimations

        boolean isInterpolatePlayerAnimations()
        Checks whether animation smoothing is enabled for players.
        Returns:
        true if player animation smoothing is enabled, false otherwise
      • setInterpolatePlayerAnimations

        void setInterpolatePlayerAnimations​(boolean interpolate)
        Sets the animation smoothing state for players.
        Parameters:
        interpolate - the new smoothing state
      • isInterpolateNpcAnimations

        boolean isInterpolateNpcAnimations()
        Checks whether animation smoothing is enabled for NPC.
        Returns:
        true if NPC animation smoothing is enabled, false otherwise
      • setInterpolateNpcAnimations

        void setInterpolateNpcAnimations​(boolean interpolate)
        Sets the animation smoothing state for NPCs.
        Parameters:
        interpolate - the new smoothing state
      • isInterpolateObjectAnimations

        boolean isInterpolateObjectAnimations()
        Checks whether animation smoothing is enabled for objects.
        Returns:
        true if object animation smoothing is enabled, false otherwise
      • setInterpolateObjectAnimations

        void setInterpolateObjectAnimations​(boolean interpolate)
        Sets the animation smoothing state for objects.
        Parameters:
        interpolate - the new smoothing state
      • isInInstancedRegion

        boolean isInInstancedRegion()
        Checks whether the logged in player is in an instanced region.
        Returns:
        true if the player is in instanced region, false otherwise
      • getItemPressedDuration

        int getItemPressedDuration()
        Get the number of client ticks an item has been pressed
        Returns:
        the number of client ticks an item has been pressed
      • setIsHidingEntities

        void setIsHidingEntities​(boolean state)
        Sets whether the client is hiding entities.

        This method does not itself hide any entities. It behaves as a master switch for whether or not any of the related entities are hidden or shown. If this method is set to false, changing the configurations for specific entities will have no effect.

        Parameters:
        state - new entity hiding state
      • setPlayersHidden

        void setPlayersHidden​(boolean state)
        Sets whether or not other players are hidden.
        Parameters:
        state - the new player hidden state
      • setPlayersHidden2D

        void setPlayersHidden2D​(boolean state)
        Sets whether 2D sprites (ie. overhead prayers, PK skull) related to the other players are hidden.
        Parameters:
        state - the new player 2D hidden state
      • setFriendsHidden

        void setFriendsHidden​(boolean state)
        Sets whether or not friends are hidden.
        Parameters:
        state - the new friends hidden state
      • setFriendsChatMembersHidden

        void setFriendsChatMembersHidden​(boolean state)
        Sets whether or not friends chat members are hidden.
        Parameters:
        state - the new friends chat member hidden state
      • setLocalPlayerHidden

        void setLocalPlayerHidden​(boolean state)
        Sets whether the local player is hidden.
        Parameters:
        state - new local player hidden state
      • setLocalPlayerHidden2D

        void setLocalPlayerHidden2D​(boolean state)
        Sets whether 2D sprites (ie. overhead prayers, PK skull) related to the local player are hidden.
        Parameters:
        state - new local player 2D hidden state
      • setNPCsHidden

        void setNPCsHidden​(boolean state)
        Sets whether NPCs are hidden.
        Parameters:
        state - new NPC hidden state
      • setNPCsHidden2D

        void setNPCsHidden2D​(boolean state)
        Sets whether 2D sprites (ie. overhead prayers) related to the NPCs are hidden.
        Parameters:
        state - new NPC 2D hidden state
      • setPetsHidden

        void setPetsHidden​(boolean state)
        Sets whether Pets from other players are hidden.
        Parameters:
        state - new pet hidden state
      • setAttackersHidden

        void setAttackersHidden​(boolean state)
        Sets whether attacking players or NPCs are hidden.
        Parameters:
        state - new attacker hidden state
      • setProjectilesHidden

        void setProjectilesHidden​(boolean state)
        Sets whether projectiles are hidden.
        Parameters:
        state - new projectile hidden state
      • getCollisionMaps

        @Nullable
        CollisionData[] getCollisionMaps()
        Gets an array of tile collision data.

        The index into the array is the plane/z-axis coordinate.

        Returns:
        the collision data
      • queueChangedSkill

        void queueChangedSkill​(Skill skill)
      • getSpriteOverrides

        Map<Integer,​SpritePixels> getSpriteOverrides()
        Gets a mapping of sprites to override.

        The key value in the map corresponds to the ID of the sprite, and the value the sprite to replace it with.

      • getWidgetSpriteOverrides

        Map<Integer,​SpritePixels> getWidgetSpriteOverrides()
        Gets a mapping of widget sprites to override.

        The key value in the map corresponds to the packed widget ID, and the value the sprite to replace the widgets sprite with.

      • setCompass

        void setCompass​(SpritePixels spritePixels)
        Sets the compass sprite.
        Parameters:
        spritePixels - the new sprite
      • getTickCount

        int getTickCount()
        Gets the current server tick count.
        Returns:
        the tick count
      • setTickCount

        void setTickCount​(int tickCount)
        Sets the current server tick count.
        Parameters:
        tickCount - the new tick count
      • setInventoryDragDelay

        void setInventoryDragDelay​(int delay)
        Sets the inventory drag delay in client game cycles (20ms).
        Parameters:
        delay - the number of game cycles to delay dragging
      • getWorldType

        EnumSet<WorldType> getWorldType()
        Gets a set of current world types that apply to the logged in world.
        Returns:
        the types for current world
      • getOculusOrbState

        int getOculusOrbState()
        Gets the enabled state for the Oculus orb mode
      • setOculusOrbState

        void setOculusOrbState​(int state)
        Sets the enabled state for the Oculus orb state
        Parameters:
        state - boolean enabled value
      • setOculusOrbNormalSpeed

        void setOculusOrbNormalSpeed​(int speed)
        Sets the normal moving speed when using oculus orb (default value is 12)
      • getOculusOrbFocalPointX

        int getOculusOrbFocalPointX()
        Gets local X coord where the camera is pointing when the Oculus orb is active
      • getOculusOrbFocalPointY

        int getOculusOrbFocalPointY()
        Gets local Y coord where the camera is pointing when the Oculus orb is active
      • openWorldHopper

        void openWorldHopper()
        Opens in-game world hopper interface
      • hopToWorld

        void hopToWorld​(World world)
        Hops using in-game world hopper widget to another world
        Parameters:
        world - target world to hop to
      • setSkyboxColor

        void setSkyboxColor​(int skyboxColor)
        Sets the RGB color of the skybox
      • getSkyboxColor

        int getSkyboxColor()
        Gets the RGB color of the skybox
      • isGpu

        boolean isGpu()
      • setGpu

        void setGpu​(boolean gpu)
      • get3dZoom

        int get3dZoom()
      • getCenterX

        int getCenterX()
      • getCenterY

        int getCenterY()
      • getCameraX2

        int getCameraX2()
      • getCameraY2

        int getCameraY2()
      • getCameraZ2

        int getCameraZ2()
      • getCachedModels2

        NodeCache getCachedModels2()
      • setRenderArea

        void setRenderArea​(boolean[][] renderArea)
      • getRasterizer3D_clipMidX2

        int getRasterizer3D_clipMidX2()
      • getRasterizer3D_clipNegativeMidX

        int getRasterizer3D_clipNegativeMidX()
      • getRasterizer3D_clipNegativeMidY

        int getRasterizer3D_clipNegativeMidY()
      • getRasterizer3D_clipMidY2

        int getRasterizer3D_clipMidY2()
      • checkClickbox

        void checkClickbox​(Model model,
                           int orientation,
                           int pitchSin,
                           int pitchCos,
                           int yawSin,
                           int yawCos,
                           int x,
                           int y,
                           int z,
                           long hash)
      • getIf1DraggedWidget

        Widget getIf1DraggedWidget()
        Get the if1 widget whose item is being dragged
        Returns:
      • getIf1DraggedItemIndex

        int getIf1DraggedItemIndex()
        Get the item index of the item being dragged on an if1 widget
        Returns:
      • getSpellSelected

        boolean getSpellSelected()
        Is a widget is in target mode?
      • setSpellSelected

        void setSpellSelected​(boolean selected)
        Sets if a widget is in target mode
      • getItemCompositionCache

        NodeCache getItemCompositionCache()
        Returns client item composition cache
      • getCrossSprites

        SpritePixels[] getCrossSprites()
        Returns the array of cross sprites that appear and animate when left-clicking
      • draw2010Menu

        void draw2010Menu​(int alpha)
        Draws a menu in the 2010 interface style.
        Parameters:
        alpha - background transparency of the menu
      • drawOriginalMenu

        void drawOriginalMenu​(int alpha)
        Draws a menu in the OSRS interface style.
        Parameters:
        alpha - background transparency of the menu
      • resetHealthBarCaches

        void resetHealthBarCaches()
      • getItemCount

        int getItemCount()
        Returns the max item index + 1 from cache
      • setAllWidgetsAreOpTargetable

        void setAllWidgetsAreOpTargetable​(boolean value)
        Makes all widgets behave as if they are WidgetConfig.WIDGET_USE_TARGET
      • setGeSearchResultCount

        void setGeSearchResultCount​(int count)
        Sets the result count for GE search
      • setGeSearchResultIds

        void setGeSearchResultIds​(short[] ids)
        Sets the array of item ids for GE search
      • setGeSearchResultIndex

        void setGeSearchResultIndex​(int index)
        Sets the starting index in the item id array for GE search
      • setLoginScreen

        void setLoginScreen​(SpritePixels pixels)
        Sets the image to be used for the login screen, provided as SpritePixels If the image is larger than half the width of fixed mode, it won't get mirrored to the other side of the screen
      • setShouldRenderLoginScreenFire

        void setShouldRenderLoginScreenFire​(boolean val)
        Sets whether the flames on the login screen should be rendered
      • isKeyPressed

        boolean isKeyPressed​(int keycode)
        Test if a key is pressed
        Parameters:
        keycode - the keycode
        Returns:
        See Also:
        KeyCode