Jump to content

Debugging?


Recommended Posts

Posted

Hi folks, I pulled down an open source AIO script and am looking to make modifications and additions as a learning process...

With that said, how are folks debugging their scripts? JUnit testing or just loading them up in the client and trying to pick apart the logs?

 

Also if I have a rather complicated script, should I be exporting it as a JAR and importing that JAR as a script, or is the a more streamlined build process?

Posted

I personally try and make functions as independent as possible so that I can create mini utilities in my script to test out individual methods, like this

image.png.ffc7f9f692f8c36e333169df86622da7.png

Short of that, the logger is your friend, and you should use it frequently to pick apart the brain of your script.

I use the actual debugger as a last resort. You can connect it by starting the client with -debug 5005 arguments, and attaching your IDE to the remote process. I use it as a last resort because it tends to error out on me after a few reloads of the script, and I have to restart the client again.

I export JARs straight to my OSBot scripts directory. My IDE complains about overwriting files, but it works anyways.

  • Like 1
Posted

Ah..  Attaching the debugger to the client would actually save me a lot of time.

I'm debugging this OSS project and it's pretty brittle. There are many uncaught errors that crash the entire client (even the debugger console) so I can't read the whole stack trace after it crashes..

To be clear, how does the IDE attach to the client in such a way that my script will show up as an option? I'm not familiar with how I would inject the debugger into the execution of the JAR. Would attaching the IDE directly to the client allow the client to read and recognize the script over the stream?

Posted (edited)
2 hours ago, Master Of Hash said:

To be clear, how does the IDE attach to the client in such a way that my script will show up as an option? I'm not familiar with how I would inject the debugger into the execution of the JAR. Would attaching the IDE directly to the client allow the client to read and recognize the script over the stream? 

Correct.

atkvEgw.pngatkvEgw.pnghttps://i.imgur.com/atkvEgw.png

atkvEgw.png

Edited by NoxMerc

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...