Class RuneLite

java.lang.Object
net.runelite.client.RuneLite
rsb.botLauncher.RuneLite

@Singleton public class RuneLite extends net.runelite.client.RuneLite
  • Field Details

    • RUNELITE_DIR

      public static final File RUNELITE_DIR
    • CACHE_DIR

      public static final File CACHE_DIR
    • PLUGINS_DIR

      public static final File PLUGINS_DIR
    • PROFILES_DIR

      public static final File PROFILES_DIR
    • SCREENSHOT_DIR

      public static final File SCREENSHOT_DIR
    • LOGS_DIR

      public static final File LOGS_DIR
    • DEFAULT_SESSION_FILE

      public static final File DEFAULT_SESSION_FILE
    • DEFAULT_CONFIG_FILE

      public static final File DEFAULT_CONFIG_FILE
    • USER_AGENT

      public static String USER_AGENT
    • clientUI

      @Inject public net.runelite.client.ui.ClientUI clientUI
    • inputFlags

      public volatile int inputFlags
      Defines what types of input are enabled when overrideInput is false. Defaults to 'keyboard only' whenever a script is started.
    • overrideInput

      public volatile boolean overrideInput
      whether user input is allowed despite a script's preference.
    • disableRandoms

      public volatile boolean disableRandoms
      whether all anti-randoms are enabled.
    • disableAutoLogin

      public volatile boolean disableAutoLogin
      whether the login screen anti-random is enabled.
    • disableRendering

      public volatile boolean disableRendering
      whether rendering is enabled.
    • disableCanvas

      public volatile boolean disableCanvas
      whether the canvas is enabled.
  • Constructor Details

    • RuneLite

      public RuneLite()
  • Method Details

    • changeCanvasState

      public void changeCanvasState()
      Set the canvas to the opposite state
    • getAccountName

      public String getAccountName()
    • getClient

      public net.runelite.api.Client getClient()
    • getItemManager

      public net.runelite.client.game.ItemManager getItemManager()
    • getMethodContext

      public MethodContext getMethodContext()
    • getEventManager

      public EventManager getEventManager()
    • getInputManager

      public InputManager getInputManager()
    • getBreakHandler

      public BreakHandler getBreakHandler()
    • getScriptHandler

      public ScriptHandler getScriptHandler()
    • getPassiveScriptHandler

      public PassiveScriptHandler getPassiveScriptHandler()
    • addListener

      public void addListener(Class<?> clazz)
    • removeListener

      public void removeListener(Class<?> clazz)
    • hasListener

      public boolean hasListener(Class<?> clazz)
    • getImage

      public BufferedImage getImage()
    • getPanel

      public Component getPanel()
    • setPanel

      public void setPanel(Component c)
    • setAccount

      public boolean setAccount(String name)
      Sets an account for the RuneLite (Bot) instance
      Parameters:
      name - The name of the account
      Returns:
      If the account existed already
    • getCanvas

      public Canvas getCanvas()
      Gets the canvas object while checking to make sure we don't do this before it has actually loaded
      Returns:
      The Canvas if the client is loaded otherwise null
    • getBufferGraphics

      public Graphics getBufferGraphics(net.runelite.api.MainBufferProvider mainBufferProvider)
      Grabs the graphics visible on the canvas from the main buffer using the associated provider
      Parameters:
      mainBufferProvider - An object that provides the main buffer (canvas info) for this client instance
      Returns:
      The graphics of the Canvas
    • getLoader

      public Applet getLoader()
    • launch

      public static void launch(joptsimple.OptionParser parser, joptsimple.ArgumentAcceptingOptionSpec<?>[] optionSpecs, joptsimple.OptionSet options) throws Exception
      Launches a single instance of RuneLite
      Parameters:
      parser - The command-line parser for the program
      optionSpecs - The option specs for the program
      options - The option set for the program
      Throws:
      Exception - Any exception the client or RuneLite might throw
    • handleParsing

      public static joptsimple.ArgumentAcceptingOptionSpec<?>[] handleParsing(joptsimple.OptionParser parser)
      Handles the command-line arguments using the OptionParser passed through and assigns our option specs accordingly and then returns them for use
      Parameters:
      parser - The parser to use for handling the command-line arguments
      Returns:
      The ArgumentAcceptingOptionSpec array (the fields for our options)
    • handleOptions

      public static void handleOptions(joptsimple.OptionParser parser, joptsimple.ArgumentAcceptingOptionSpec<?>[] optionSpecs, joptsimple.OptionSet options) throws IOException
      Parameters:
      parser - The parser responsible for reading the command-line arguments
      optionSpecs - The associated fields to the corresponding options
      options - The actual set of options required for initialization
      Throws:
      IOException - Any input/output exception
    • setDefaultUncaughtExceptionHandler

      public static void setDefaultUncaughtExceptionHandler()
      Creates a thread to handle uncaught exceptions created by RuneLite
    • initializeClient

      public static void initializeClient(joptsimple.ArgumentAcceptingOptionSpec<?>[] optionSpecs, joptsimple.OptionSet options)
      Initializes the RuneLite processes after having parsed and handled the command line arguments
      Parameters:
      optionSpecs - The associated fields to the corresponding options
      options - The actual set of options required for initialization
    • getPanelSize

      public Dimension getPanelSize()
      Returns the size of the panel that clients should be drawn into. For internal use.
      Returns:
      The client panel size.
    • init

      public void init() throws Exception
      The actual method associated with initializing the client-related data. Such as creating the client sizing and binding the plethora of handlers, listeners, and managers to this particular RuneLite instance (outside the injector binding)
      Throws:
      Exception - Any exception the client, bot, or RuneLite might throw.
    • setMethodContext

      public void setMethodContext()
      Assigns this instance of the RuneLite (Bot) a method context for calling bot api methods as well as assigns bank constants here.
    • shutdown

      public void shutdown()
      Stops and shuts down the current bot instance
    • setInjector

      public static void setInjector()