Skip to content

Script Reloading and API Reloading

Jaggar edited this page Jul 30, 2022 · 1 revision

So script reloading is extremely easy with IntelliJ. After you launch the script (the Gradle task configuration botRunGUI here) image

If this isn't present then it can be found in the Gradle sidebar here:

image

from the Gradle sidebar under execution, click run on it. It’ll then be added to the drop-down menu above.

For script reloading in this order:

  1. Make your script changes
  2. Hit the Build button next to the configuration dropdown

image

(the hammer)

  1. Hit the Reload button in the script panel

image

  1. Select your script and hit start again
  2. Done!

Now for advanced users, you can actually modify the API in the same manner from script-template. It involves cloning the OSRSBot API (and optionally the DaxWalkerRSB) and then setting up the Gradle files accordingly. In the settings.gradle you’ll want to uncomment these lines. Adjust the paths if needed too. (Leave DaxWalkerRSB commented out if you aren’t using it)

include ":OSRSBot"
include ":DaxWalkerRSB"
project(":OSRSBot").projectDir = file("../OSRSBot")
project(":DaxWalkerRSB").projectDir = file("../DaxWalkerRSB")

This adds the project to the IntelliJ environment for script-template. So now you can work on the API and script-template all in one! Now you need to add that to the actual build dependencies of Gradle Head to the build.gradle and under dependencies remove or comment out

implementation group: 'com.github.OSRSB', name: 'OsrsBot', version: osrsbotVersion

and remove the comments

//implementation project(":OSRSBot")

(Similarly, do this for DaxWalkerRSB should you want that)

Now you’ve got the API set up for easy changes and you can redeploy your script without relaunching the client! Enjoy! 🎉 🎉 🎉

Clone this wiki locally