-
Notifications
You must be signed in to change notification settings - Fork 144
Launching a Bot With Custom Settings
This tutorial assumes you already have a bot class to work from. This tutorial is relevant for any bot for any RuneLite-based game.
I was refer to your bot class as <bot>, and the game it's for as <game>.
In some cases, your bot may benefit from a further-customized RuneLite plugin configuration. For instance, if you bot requires numerous objects on screen to be highlighted various colors, it is not ideal to force the user to do that manually each time they use the bot. This tutorial will show you how to add a launch game button to your bot's control panel.
- Launch OSBC.
- Navigate to your game's Home View via the sidebar.
- Launch RuneLite via the
Launch <game>button. - Manually configure the RuneLite plugins to your liking via the RuneLite interface.
- Sometimes you need to stay logged in for a few minutes for the changes to take effect.
- Log out, and close RuneLite. Your settings have been saved to
src/runelite_settings/temp.properties.
- In
src/model/<game>/create a new folder where your bot file & settings file will live.- Give it a name relevant to
<bot>.
- Give it a name relevant to
- Move your bot file into the new folder.
- In
src/model/<game>/__init__.py, adjust the reference to your bot such that it points to the new location. - Copy
src/runelite_settings/temp.propertiesinto the new folder. Call itcustom_settings.properties. - Edit this file, removing any lines that contain
rsprofile. These lines may expose your account name, so it is best to remove them.
- In
src/view/<game>/<bot>.py, import thegame_launcherutility, andpathlib.
import utilities.game_launcher as launcher
import pathlib- Make your bot inherit from
launcher.Launchable.
# your bot will likely inherit a game-specific baseclass instead of RuneLiteBot
class BotName(RuneLiteBot, launcher.Launchable):- Add a
launch_gamemethod to your bot. I like to put it above themain_loop()method.
def launch_game(self):
pass- In the
launch_gamemethod, identify the path to your custom settings file, and pass it to thelaunch_runelite_with_settingsmethod.
def launch_game(self):
settings = pathlib.Path(__file__).parent.joinpath("custom_settings.properties")
launcher.launch_runelite_with_settings(self, settings)- Close RuneLite if it's running.
- Launch OSBC.
- Navigate to your game's Home View via the sidebar.
- Select
skipto unlock the scripts in the sidebar.
- Select
- Select your bot from the sidebar.
- The bot should now have a
Launchbutton in its control panel. It is disabled until you've configured your bot's options. - Launch RuneLite via the
Launchbutton.
Since the Launch button waits for your bot to be configured, you have an opportunity to further modify your custom settings file before launching RuneLite. For instance, the OSRSCombat bot's option menu allows users to identify what items should be looted, and then the settings file is modified automatically to highlight those items.