Unseasoned Posted June 8, 2016 Share Posted June 8, 2016 (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 June 8, 2016 by Unseasoned Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted June 8, 2016 Share Posted June 8, 2016 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. Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted June 8, 2016 Share Posted June 8, 2016 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 Quote Link to comment Share on other sites More sharing options...
Unseasoned Posted June 8, 2016 Author Share Posted June 8, 2016 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? Quote Link to comment Share on other sites More sharing options...
Apaec Posted June 8, 2016 Share Posted June 8, 2016 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. Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted June 8, 2016 Share Posted June 8, 2016 (edited) There's a server debug mode with command line arguments in the latest dev version Im sure you run in debug mode with IntelliJ but I dont imagine its the simplest of tasks and I use Eclipse so I couldnt help you. Edited June 8, 2016 by LoudPacks Quote Link to comment Share on other sites More sharing options...