Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Testing a Bot Without the UI

Kell edited this page Jan 18, 2023 · 4 revisions

Instructions

  1. If you are testing a RuneLite bot, make sure RuneLite has been launched via OSBC.
  2. Make sure your bot's options have been initialized with values in its __init__() function.
  3. Open src/OSBC.py and scroll to the bottom of the file.
  4. You'll see some code saying if __name__ == "__main__":. This is the entry point for the program. By modifying a few lines here, we can force OSBC.py to run our bot immediately.
  5. Read & address each comment carefully, they tell you exactly what you need to do.
  6. Running the OSBC.py will run the bot immediately.

Example

Here is an example of OSBC.py configured to automatically play the OSRSWoodcutter bot when the file is run:

if __name__ == "__main__":
    from model.osrs.woodcutter import OSRSWoodcutter
    app = App(test=True)
    app.test(OSRSWoodcutter())

    # IMPORTANT
    # - Make sure your bot's options are pre-defined in its __init__ method.
    # - You can stop the bot by pressing `Left Ctrl`