Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • A proper debugger for Scripts


    KakiDev

    Recommended Posts

    Having a proper debugger would be great, I spent a few hours the other day printf-debugging my implementation of behaviour trees, and being able to step through the code step by step would have made this a lot easier and saved me a lot of time.

    Link to comment
    Share on other sites

    Idk what your code looks like but I'd advise avoiding lots of little tree-leaf-node files for every step, no matter how leet some people say it feels to have such "organised" code, imo it often results in a time consuming mess.

    Link to comment
    Share on other sites

    2 hours ago, Aeglen said:

    Idk what your code looks like but I'd advise avoiding lots of little tree-leaf-node files for every step, no matter how leet some people say it feels to have such "organised" code, imo it often results in a time consuming mess.

    Yeah, I think they can help a lot, but if you overuse them it quickly becomes worse than if you didn't use them at all.

    3 hours ago, Neffarion said:

     

    Thanks a lot, I feel like that should be turned into an official guide, I can't emphasize enough how helpful a debugger can be, it can really make your life a lot easier.

    Coming from C++ and Rust, so I had no idea that something like

    -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12345

    even exists.

    Link to comment
    Share on other sites

     Tried it out, works fine, doesn't break on exceptions though, I assume thats because they are caught by DreamBot.

    Piece of advise for Linux Users:
    You can set "Before Launch" tasks in IntelliJ, tell it to build the artifact and run a .sh (Run External Tool) with the following content:

    cmd="java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12345 -jar ~DreamBot/BotData/client.jar"
    eval "${cmd}" &>/dev/null & disown;

    This will start DreamBot as a background process, so you don't have to manually start it. You can also use this to build a Run config that will build the jar and start DreamBot.

    Link to comment
    Share on other sites

    15 hours ago, Aeglen said:

    Idk what your code looks like but I'd advise avoiding lots of little tree-leaf-node files for every step, no matter how leet some people say it feels to have such "organised" code, imo it often results in a time consuming mess.

    Wouldn't the ideal strategy vary with each situation? Have you read "The Art of Unix Programming"? It promotes the idea of writing code that's straightforward, clean, and modular, making it easier to upkeep and comprehend. While it's true that the initial setup can take time, the advantages, such as reduced likelihood of bugs due to less code duplication and enhanced readability, often outweigh the drawbacks

    Link to comment
    Share on other sites

    45 minutes ago, xyz111 said:

    Wouldn't the ideal strategy vary with each situation? Have you read "The Art of Unix Programming"? It promotes the idea of writing code that's straightforward, clean, and modular, making it easier to upkeep and comprehend. While it's true that the initial setup can take time, the advantages, such as reduced likelihood of bugs due to less code duplication and enhanced readability, often outweigh the drawbacks

    you sound like a dork but yeah aeglens out of his mind like always.

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.