1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tutorial How to update your script without having to restart the client

Discussion in 'Tutorials & Resources' started by Jdelacrix, Jun 8, 2017.

  1. Jdelacrix

    Joined:
    Jun 4, 2017
    Messages:
    15
    Likes Received:
    5
    So I'm getting into writing scripts bots for RuneMate, and one thing I've noticed is that after every script bot change, you have to restart your entire client to test it out. This got very annoying, very quick. So I came up with a solution. Here's how to do it:

    1) Assuming you're using Intellij, go to File -> Settings -> Plugins -> Search for "JRebel" and install it
    2) Go here: JRebel Trial and sign up. It'll give you an authentication code. Do not lose this.
    3) Once JRebel is done installing, restart Intellij.
    4) In Intellij, go to Help -> JRebel -> Activation -> "I already have a license" tab
    5) Choose the "Activation code" option and paste the code you got from step 2 here.
    6) Agree to the terms and conditions and hit Activate JRebel.
    That's it for installing JRebel. Now, all you have to do is when you startup your client, rather than simply running it, go to the "Run" menu option, and hit "Run with Jrebel"
    [​IMG]
    Now you can literally make updates on the fly without having to restart your client. For example, if you are running a local woodcutting script bot cutting "Yew" trees, you can literally change "Yew" to "Maple" in your script bot while the script bot is running, and it'll change on the fly.
     
    sheepsname likes this.
  2. red

    red

    Joined:
    Nov 17, 2013
    Messages:
    259
    Likes Received:
    111
    Orrrrr, you can click the reload button above the script bot list :)
    EDIT: just read last part, seems pretty cool to be honest.
     
  3. Jdelacrix

    Joined:
    Jun 4, 2017
    Messages:
    15
    Likes Received:
    5
    That never actually updated it for me, which is what led me to this tutorial.
     
  4. Dark sage

    Dark sage Misfits

    Joined:
    Nov 21, 2016
    Messages:
    1,333
    Likes Received:
    373
    when you load client without being in intellij there is a developer option so you can refresh list without restarting client, does require having a published bot on market though
     
  5. SkyGuy

    Joined:
    Dec 23, 2016
    Messages:
    221
    Likes Received:
    94
    oh neat i saw that option, i didnt know it would do it on the fly tho.
     
    Dark sage likes this.
  6. Patriq

    Joined:
    Nov 22, 2013
    Messages:
    30
    Likes Received:
    4
    What do you do when the trial ends?
     
  7. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    Just use IntelliJ debugging and use Hotswap?
    As long as you don't change class structures you can compile during runtime of the bot and it will affect the active session.
    Also @Party does the refresh button over the bot list actually do anything else than refresh the manifests? I doubt the client loads every class file upon start, only when you stsrt the respective bot.
     
  8. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    It's different for local and bot store bots (naturally).
     
  9. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    Thats not what i asked :p
     
  10. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    I didn't give you a full answer because I'm not sure what I can and can't say with regards to the class-loading.
     
  11. Qosmiof2

    Qosmiof2 I've been called a god before.

    Joined:
    Aug 5, 2014
    Messages:
    3,212
    Likes Received:
    924
    .bat ftw
     
    qverkk and Wet Rag like this.
  12. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    Guess we settled it over pm :p
     
  13. Patriq

    Joined:
    Nov 22, 2013
    Messages:
    30
    Likes Received:
    4
    Share please :)
     
  14. qverkk

    Joined:
    Sep 22, 2015
    Messages:
    1,603
    Likes Received:
    381
    "C:\Program Files (x86)\RuneMate\jre\bin\java.exe" -jar "C:\Program Files (x86)\RuneMate\RuneMate.jar" -sdk
     
    Qosmiof2 likes this.
  15. Patriq

    Joined:
    Nov 22, 2013
    Messages:
    30
    Likes Received:
    4
    Well I did that before posting in here and it still didn't worked... Will give it another shot later.
     
  16. Qosmiof2

    Qosmiof2 I've been called a god before.

    Joined:
    Aug 5, 2014
    Messages:
    3,212
    Likes Received:
    924
    You still have to refresh bots.
     
    qverkk likes this.
  17. Jux7apose

    Joined:
    Mar 28, 2017
    Messages:
    286
    Likes Received:
    58
    You can't do this without JRebel? Works fine for me w/o it. Although maybe because I always run it on debug mode...
     
  18. Fontkodo

    Joined:
    Jun 21, 2014
    Messages:
    350
    Likes Received:
    111
    In IntelliJ: Settings -> Build, Execution, Deployment -> Debugger -> Hotswap, set reload classes to Always

    And run RM in IntelliJ in debugger mode
     
  19. LucasSousa

    Joined:
    Jan 25, 2015
    Messages:
    121
    Likes Received:
    19
    After changes need I "make" project and after refresh bot list at client? I tried apply your suggestion and after reloading everything bots stills not refreshed.
     
  20. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,606
    Likes Received:
    990
    Why do you guys always have this issue, i've literally not had it once and i've done numerous reinstalls of my entire system during my time here.
    You don't need any hotswapping or Jrebel. You literally just press the rebuild project button and then refresh your bot list in the client. That's it. upload_2018-1-4_10-17-22.png

    If it's not updating your bot you've either pressed the wrong button and it hasn't recompiled the files you want it to, or you've done something seriously dodgy with your project.
    Either way, it's not a RuneMate issue, it's a you issue.
     
    LucasSousa and Jux7apose like this.

Share This Page

Loading...