belami07 Posted September 22, 2015 Share Posted September 22, 2015 Hey,hope u guys can help me. i am looking for a tool/possibility/etc to watch what my script is doing at the moment. For example i run a script and i know now its doing line 3 now 4 now 6 now again 3. sorry for my english hope you understand what my problem is. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 22, 2015 Moderators Share Posted September 22, 2015 (edited) belami07,There is an AutoIt3Wrapper directive to turn on debugging line by line (which you can limit to only certain sections of the script) or there is a graphical debugger UDF somewhere in the Examples section. I do not use either so I cannot comment on their relative utility.M23P.S. Welcome to the AutoIt forums. Edited September 22, 2015 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
belami07 Posted September 22, 2015 Author Share Posted September 22, 2015 Thanksbut i think this isnt solving my problem. I dont have any syntax errors or other errors in my script. it is just that my script is running but it does not do exactly what i want. so iwanna know what the script is doing at the moment where nothing happens. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 22, 2015 Moderators Share Posted September 22, 2015 belami07,Then I suggest you add the following Opt at the top of your script:Opt("TrayIconDebug", 1)Now the running line number is displayed as a tooltip from the tray icon when you move the mouse over it. So if the script is hanging (which is what I understand by "iwanna know what the script is doing at the moment where nothing happens") you can see where it has reachedM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
belami07 Posted September 22, 2015 Author Share Posted September 22, 2015 Yeah thanks this is exactly what i wanted xD. hope i can fix my problem my problem now. Link to comment Share on other sites More sharing options...
belami07 Posted September 22, 2015 Author Share Posted September 22, 2015 ok thought this would solve my problem but it isnt -.-is it possible to save the whole history of what the script did since i started it. Because i have similar Functions and they all use one function and now i know it stops in the one all use but i dont know which of the otherones used it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 22, 2015 Moderators Share Posted September 22, 2015 (edited) belami07,As I mentioned in the OP, there is an AutoIt3Wrapper Debug directive which will write the entire script line by line to the console - but that might be a bit of an overkill. Why not add some debugging code (a MsgBox or ConsoleWrite) just before each call to this misfiring function? That way you could tell exactly which call causes the problem and work from there.M23 Edited September 22, 2015 by Melba23 Typo Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
belami07 Posted September 22, 2015 Author Share Posted September 22, 2015 Thanks alot.I just put ConsoleWrite("func1-...) infront of every function. So i knew at what point it was hanging. but it was still alot of text (10func per sec). Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 22, 2015 Moderators Share Posted September 22, 2015 belami07,Delighted I could help.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
TrickyDeath Posted September 24, 2015 Share Posted September 24, 2015 You still can copy and paste the consol messages into notepad and read or search. If it is too many rows, then it can be realy messy i know. What i do if i am in same shoes then you are, i just rem all the unnessesery actions and insert a tooltip or msgbox to print out what is hapening right now. Example: Msgbox(0, $function_name, "succes file found redy to open etc...")If you have any idea where can be the problem, you can insert that stuff there and call only that function. For me up till now, it helped me always to identify if my logic was wrong and somehow my script stuck with strange reason, or my calculation was wrong and the program got different value then it should. If this doesent work for me, then i run the whole code part by part to what it does and where it is stucked. Usualy the prob is just logical problem what i made.I hope it help at least a bit. Tricky Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :) [u]Tricky[/u] You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei) Link to comment Share on other sites More sharing options...
TheSaint Posted September 24, 2015 Share Posted September 24, 2015 Another way to error check, instead of using a MsgBox, which becomes an active window, etc, is to write values to a log file, using _FileWriteLog or the INI functions (IniWrite, etc). That makes it easier to do comparisons, and with the Log method you get timestamps. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
TrickyDeath Posted September 24, 2015 Share Posted September 24, 2015 Another way to error check, instead of using a MsgBox, which becomes an active window, etc, is to write values to a log file, using _FileWriteLog or the INI functions (IniWrite, etc). That makes it easier to do comparisons, and with the Log method you get timestamps.My prob with log file, it is too long and u get the info after everything done. With Msgbox u get it in real time, and if your script calling 10 function / sec u can not be enough fast. Msgbox is stoping your script till u click on OK button, then it repeating.Log file is equal with consol write. Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :) [u]Tricky[/u] You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei) Link to comment Share on other sites More sharing options...
TheSaint Posted September 24, 2015 Share Posted September 24, 2015 (edited) No it's not the same, as you can tailor it to just what you want, like a MsgBox, but unlike a MsgBox, it doesn't take focus away from another window that might need to be active. You can use it more cleverly, if you have the code also wait for specific key press, so you can have a form of almost real time.Really, you should be trying to narrow down where the problem is, and then focus on that section of code only.Each method has its pros and cons.It's all in how you utilize them ... best use their abilities.If as you say, you are getting lots of returns, then that is an awful lot of MsgBox clicks, and even a MsgBox is after the fact. You should be limiting your returns.During the crafting of my reply, a germ of an idea formed, which I have been cogitating over ever since, which is a proof of concept simple debugger, based on a logfile, adjustable GUI with a List and setup window, plus a function with various types of calls, and the use of _IsPressed, where you have a _ReadFileToArray occurring every second or so (adjustable on setup window), and populating the list in seemingly real-time ... with a slight lag of course. You could in effect, simulate F8 as used by VB. The function would get passed 3 parameters, one of which is the value to write to the log file, another is whether to activate _IsPressed in a loop (pausing your script in effect). The third would be empty, except at start and end of monitoring, where for start you would get a paused script and the setup window appearing, where you make any adjustments you require (GUI size and window position, array read timing, etc), then telling it to stop reading the array when after that section of the script. So you call the debugger with something like Debug("start/end", $val, $key). The GUI is a stand-alone executable.It is just a simple concept at this point, and I have other things that need doing today and probably tomorrow, but I am intrigued now to how well it might work, especially if tweaked by others with greater skill than mine.P.S. Anyway, my help is not necessarily to provide a complete solution, but get the OP to think outside the box. I just use a MsgBox myself when troubleshooting, probably 95% of the time, the console about 4%. Edited September 24, 2015 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
TrickyDeath Posted September 25, 2015 Share Posted September 25, 2015 I prefared tooltip or msgbox, since i always know wich function is not accured, cause when i am done with 1 function, i start testing itself to make it work 100% before i start new one. I give the right and also give wrong values what it can pull out from the methode, to test both side, what my code does with correct and uncorrect values / data. Was thinking on log, but not about checking where did i made bug in codeing part. For me log is more useful, if i give away the finished program to someone, and if bugs accured, it saveing in log file. Anyway, you are right, about log file can be more useful in one hand, when you have long function, what will require a lots of msgbox clicking. Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :) [u]Tricky[/u] You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now