Jump to content

Debugging?


MasterOfData

Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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