Jump to content

Debugging your script


Unseasoned

Recommended Posts

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

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.

Exactly this, log every action your script does so you know what it doesnt do / where it fucks up smile.png

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

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