Jump to content

Debugging your script


Recommended Posts

Posted (edited)

Hi all, 

 

So I am new to creating osbot scripts and I have coded together something quite simple, but once it completes one state it will does not seem to run the next appropriate state. Is there any way at all that you can debug the script and see if it will hit breakpoints that are set? For example, attach to osbot and see where the code is going? Note, I am using IntelliJ.

 

Hope this makes sense and somebody can help me!

Thanks,

Unseasoned

Edited by Unseasoned
Posted

Or you can use the log function and just log what its doing. For example, log your conditional statement results to see where its getting hung up. Also a good idea is to have it log the state its currently on.

 

Very useful tip both of you, thanks:) I'll look to do that. I'm logging quite a lot at the moment, but just not the conditional statements. Just curious though, is there any way of attaching a debugger?

Posted

Very useful tip both of you, thanks:) I'll look to do that. I'm logging quite a lot at the moment, but just not the conditional statements. Just curious though, is there any way of attaching a debugger?

 

I'm sure there is but it's most likely not very simple to make it run real-time and it's very unnecessary. The nature of OSBot scripts mean it's often very predictable where abouts an error is and what's causing it. You can always use log statements to narrow it down and tell you variable information before the bug. This makes an official debugger redundant I spose.

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...