Jump to content

I need a debugger for AutoIt v3.3.15.3 Beta

Recommended Posts


I'm using Maps (and I love 'em!), so I have to use the latest AutoIt Beta. I've switched to Beta mode, and the graphical debugger doesn't even show up in the Explorer context menu (not surprising). So I'd like to use _Dbug (rather than a large number of MsgBox statements), but it fails when it encounters a Map function (such as MapExists). I've made a request for a version that will work with the Beta, but going on past history, I don't expect an answer anytime soon.

I'm not necessarily asking for someone else to modify _Dbug, because I can probably do it myself, as long as I know how to adapt it to use the Beta. Can someone please enlighten me as to how to adapt a UDF or other function to use AutoIt Beta?


Link to post
Share on other sites
  • 4 months later...


I'm relatively new to AutoIt3 and have an app where I'm using Map, therefore I run it in Beta. I need to debug my script. When I use the graphical debugger Version (which is working perfectly with other scripts of mine), the Beta option is grayed-out despite "Check for Updates" showing I have Beta version installed along with production version

Failing that, for the first time I tried _Debug. When I do a Beta Run, the SendMessage.au3 file opens up in the SciTE editor with a "missing EndIf" message on line 20. What the heck is going on? Is SendMessage.au3 used by Debug.au3 and why am I getting an error message in something that is not my script?

If someone has a suggestion for either of these issues, I would really appreciate it.

Link to post
Share on other sites
1 hour ago, MP1454 said:

What the heck is going on?

hmm, welcome to the forum ?.

1 hour ago, MP1454 said:

If someone has a suggestion for either of these issues, I would really appreciate it.

Share a sample script that produces the error.

@Heron "Last visited: November 27, 2011".
I run the sample provided and it just works in beta with maps.
So, yes, share a sample script that produces the error.

Note: I never used a debugger, but I'll help.

Link to post
Share on other sites
;~  $AutoItDir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir") ; bad idea
    $AutoItDir = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)-1) ;        better idea
    $run = StringFormat('%s\\AutoIt3.exe DbugScript.au3 "%s" "%s" "%s" "%s"', $AutoItDir, @ScriptName, @ScriptDir, $DBGnotifyFun, $DBGcommandFun)

Do that above and post if that solved the issues. 


#include <dbug.au3>
;~ #include <OnDebugMsgBox.au3>
#include <MsgBoxConstants.au3>


Func Example()
    ; Declare a map and assign with various keys value pairs.
    Local $mMap[]
    $mMap[1] = "Integer One" ; Integer value as a key.
    $mMap["2"] = "String Two" ; String value representing an integer as a key. This is a string not an integer.
    MapAppend($mMap, "Integer Two") ; Append a value using the next available integer, which is 2 in this case.

    ; Retrieve the keys contained in the map. A zero-based one-dimensional array is returned.
    Local $aMapKeys = MapKeys($mMap)
    For $i = 0 To UBound($aMapKeys) - 1
        MsgBox($MB_SYSTEMMODAL, "", "Key: " & $aMapKeys[$i] & @CRLF & _ ; The key.
                "Value: " & $mMap[$aMapKeys[$i]] & @CRLF & _ ; Use the array value of MapKeys() to display the value of the key.
                "Variable Type: " & VarGetType($aMapKeys[$i]) & @CRLF) ; Display the variable type of the key i.e. integer or string.
    While 1
EndFunc   ;==>Example

I've tested with the above without a problem.

Edited by argumentum
Link to post
Share on other sites

Sorry, been under a crunch to get the application working and haven't had a chance to follow up on this. I added some FileWrite lines and figured out what was going on with my script, so I didn't need to get the debugger working for AutoIT3 Beta. Next time I will take the time to strip down the code to submit, but I'm guessing the stripped down version won't have the problem.

Thanks for the response.

Link to post
Share on other sites
On 4/14/2021 at 5:43 PM, MP1454 said:

Thank you argumentum for you reply. When I run your script the DBUG window opens up, but I have no idea what to do next. I need to do a lot of reading on this debugger to learn how to use it.

Thanks for getting me started with it though. In the meantime, I need to sort out different issues with the GUI functions.

For the record, I've had great success with the graphical debugger in Beta mode, and in my case the Beta icon at the top is highlighted. I assume you've tried ensuring you've run the Beta-included script to switch to Beta mode and then just clicking the Beta icon?

Of course, the graphical debugger and Event Mode don't play so well together if you're not careful to avoid trying to debug event functions. As for Dbug, that works better if you're using Event Mode, but I haven't tried it with the Beta, but it appears that argumentum has done so successfully, My advice is that if you're not using Event Mode, you should try to figure out why the graphical debugger won't enter Beta mode, since the GD is far easier to use.

Link to post
Share on other sites
  • 1 month later...

Hi Mbee

I see you have posted many things around Dbug in the past

I'm late, but I hope ut could be useful

I use _Dbug.au3 from valdemar1977 :

Old, but nice !

Just use that code fragment :

; Debug
#include "..\..\Dbug\_Dbug.au3"
; À commenter si usage de _Dbug.au3...
;#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

../.. is my own path config...

Use F5 for debug and comment it to build a usable .EXE¬†¬† ūüėȬ†¬†


Edited by LaurentC
Link to post
Share on other sites

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.

  • Similar Content

    • By mLipok
      Here is just some usefull script analyzer:
      #include <ColorConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> #include <File.au3> #include <Array.au3> ; just put a FileFullPath to one of your project _UsedInclude_API() _GetAllDependencies("c:\Program Files (x86)\AutoIt3\SciTE\SciTE Jump\SciTE Jump.au3") _UsedInclude_API() _GetAllDependencies("c:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3") _UsedInclude_API() _GetAllDependencies("c:\Program Files (x86)\AutoIt3\SciTE\SciTEConfig\SciteConfig.au3" ) _UsedInclude_API() _GetAllDependencies(@ScriptFullPath) Func _GetAllDependencies($sFileToCheck) GUICreate("My GUI with treeview", 500, @DesktopHeight - 40) Local $idTreeview = GUICtrlCreateTreeView(6, 6, 488, @DesktopHeight - 40 - 12, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) Local $idDisplayitem = GUICtrlCreateTreeViewItem($sFileToCheck, $idTreeview) GUICtrlSetColor(-1, $COLOR_GREEN) __UsedIncludeToTreeView($sFileToCheck, $idDisplayitem) Local $hItem = GUICtrlGetHandle($idDisplayitem) GUICtrlSendMsg($idTreeview, $TVM_EXPAND, $TVE_TOGGLE, $hItem) GUISetState(@SW_SHOW) Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() Select Case $idMsg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd EndFunc ;==>_GetAllDependencies Func _GetUsedIncludeToArray($sAU3Content) Local $aIncludes = StringRegExp($sAU3Content, '(?im)^\s*#include\s?[''""<](.*)\.au3[''"">]', 3) If @error Then Return SetError(@error, @extended, '') Else Return SetError(0, 0, $aIncludes) EndIf EndFunc ;==>_GetUsedIncludeToArray Func __UsedIncludeToTreeView($sFileToCheck, $idTreeview_ref) $hFile = FileOpen($sFileToCheck, $FO_READ) $sAU3Content = FileRead($hFile) FileClose($hFile) Local $aIncludes = _GetUsedIncludeToArray($sAU3Content) If @error Then Return SetError(@error, @extended, '') Else Local $idDisplayitem, $iNumberOfOccurrences = 0 For $iInclude_Idx = 0 To UBound($aIncludes) - 1 $iNumberOfOccurrences = _UsedInclude_API($aIncludes[$iInclude_Idx]) If $iNumberOfOccurrences = 0 Then $idDisplayitem = GUICtrlCreateTreeViewItem($aIncludes[$iInclude_Idx], $idTreeview_ref) __UsedIncludeToTreeView(_GetDir($sFileToCheck) & $aIncludes[$iInclude_Idx] & '.au3', $idDisplayitem) ElseIf $iNumberOfOccurrences = 1 Then $idDisplayitem = GUICtrlCreateTreeViewItem($aIncludes[$iInclude_Idx] & ' (Was used before: once)', $idTreeview_ref) GUICtrlSetColor(-1, $COLOR_RED) ElseIf $iNumberOfOccurrences = 2 Then $idDisplayitem = GUICtrlCreateTreeViewItem($aIncludes[$iInclude_Idx] & ' (Was used before: twice)', $idTreeview_ref) GUICtrlSetColor(-1, $COLOR_PURPLE) ElseIf $iNumberOfOccurrences > 2 Then $idDisplayitem = GUICtrlCreateTreeViewItem($aIncludes[$iInclude_Idx] & ' (Was used before more then twice)', $idTreeview_ref) GUICtrlSetColor(-1, $COLOR_BLUE) EndIf Next EndIf EndFunc ;==>__UsedIncludeToTreeView Func _UsedInclude_API($sIncludeFileName = Default) Local Static $sIncludeAPI_Static = '|' ; reset If $sIncludeFileName = Default Then $sIncludeAPI_Static = '|' Return EndIf StringReplace($sIncludeAPI_Static, '|' & $sIncludeFileName & '|', '|' & $sIncludeFileName & '|') Local $iNumberOfReplacements = @extended $sIncludeAPI_Static &= $sIncludeFileName & '|' Return SetError(0, 0, $iNumberOfReplacements) EndFunc ;==>_UsedInclude_API Func _GetDir($sFileFullPath) Local $sDrive = "", $sDir = "", $sFileName = "", $sExtension = "" Local $aPathSplit = _PathSplit($sFileFullPath, $sDrive, $sDir, $sFileName, $sExtension) Return $sDrive & $sDir EndFunc ;==>_GetDir  
      Have fun.
    • By Kidney
      Hey guys,

      So we recently moved our company Knowledge Base to an in-house solution rather than paying a monthly subscription for someone else to host it and use their features. Either way, we have moved from one KB (Knowledge Base) site to another but there is an issue. No one restricted access to the original KB site which meant anyone was able to edit the site as they pleased. This means that some of the old KB's  features (picture/video/internal links) are still be utilized and I need to find out which pages have links that inevitably go dead once we stop sending them money. 

      So, I feel like in 90% of the way to getting this working correctly. Steps are fairly simple:
      Log into the KB Load a list of URL's Pull the HTML and search for "helpjuice" Log the URL has been checked Check for links on this page and check it against the list of URL's Log any new URL's that are missing from the list Now, I have no idea if this is the best way of doing this process but, again, I've made it 90% of the way so far and I would like to figure this specific problem out and if anyone has a better/more effective method of doing this, please point me in the right direction!

      Here is the Code i have so far.
      #include <File.au3> #include <FileConstants.au3> #include <WinAPIFiles.au3> #include <IE.au3> #include <MsgBoxConstants.au3> #include <Array.au3> Global $aGlobalLinks[1][3] = [["Link", "Checked", "Hit"]] ;Create Array with Headers ;//Load KB and login by submit the login form. Local $oIE = _IECreate ("https://website.com/kb/") Local $oForm = _IEFormGetObjByName($oIE, "login-form") Local $oEmail = _IEFormElementGetObjByName($oForm, "email") Local $oPassword = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oEmail, "email@email.com") _IEFormElementSetValue($oPassword, "password") Sleep(500) _IEFormSubmit($oForm) ;_IEQuit($oIE) ;//Load a second window to confirm it shows we are logged in. Grab a list of links as a jumping off point if the KB_URL.txt is empty ;//Mainly used for Debugging Local $oIE = _IECreate ("https://website.com/kb/") $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks _ArraySearch($aGlobalLinks, $oLink.href) If @error = 6 Then Local $aFill[1][3] = [[$oLink.href, "No", "No"]] _ArrayAdd($aGlobalLinks, $aFill) EndIf Next ;//Close second window of IE _IEQuit($oIE) ;//Attempt to load the KB_URL.txt LoadFile() ;//Setting $r to 1 since the txt file and the $aGlobalLinks will have a header in index 0 Global $r = 1 Do If $aGlobalLinks[$r][1] = "No" Then ;Skip Entries that have already been checked Local $oIE = _IECreate($aGlobalLinks[$r][0], 0, 1, 0) ;Create new window with the first 'unchecked' link entry _IELoadWait($oIE, 100, 2500) ;Wait 2.5 seconds for page to load If @error = 6 Then ;@error = 6 means the Timeout was met..Send {ESC} to stop the loading ConsoleWrite("Webpage timed out...Sending ESC..." & @CRLF) Send("{ESC}") Sleep(500) EndIf Local $sHTML = _IEDocReadHTML($oIE) ;Read the HTML and look for any trace of 'helpjuice' Local $result = StringRegExp($sHTML, ".*?helpjuice.*?", 0) ConsoleWrite("RegExt result: " & $result & @CRLF) If $result = 1 Then ;A result of 1 means there is a match $aGlobalLinks[$r][1] = "Yes" ;Set 'Checked' to 'Yes' $aGlobalLinks[$r][2] = "Yes" ;Set 'Hit' to 'Yes' ConsoleWrite("~~~~~~~~~~~~~ H I T ~~~~~~~~~~~~~ " & $aGlobalLinks[$r][0] & @CRLF) Else $aGlobalLinks[$r][1] = "Yes" ;Set 'Checked' to 'Yes' EndIf $oLinks = _IELinkGetCollection($oIE) ;Grab a list of links from the existing site ;_ArrayDisplay($oLinks) For $oLink In $oLinks ;Loop through all the links found and add any new links to the end of $aGlobalLinks ConsoleWrite("String: " & String($oLink) & @CRLF) ConsoleWrite("Looking for: " & $oLink.href & @CRLF) _ArraySearch($aGlobalLinks, $oLink.href) If @error = 6 Then Local $aFill[1][3] = [[$oLink.href, "No", "No"]] ;Set 'Checked' and 'Hit' to 'No' because this link has not been checked yet _ArrayAdd($aGlobalLinks, $aFill) EndIf Next _IEQuit($oIE) ;This next part is to reduce the amount times we write to the file ;Changing the '10' to '100' means the script will save the changes every 100 entries If IsInt($r/10) = 1 Then SaveFile() ConsoleWrite("File Saved: " & $r & "/" & UBound($aGlobalLinks) & @CRLF) EndIf ConsoleWrite("Completed " & $r & "/" & UBound($aGlobalLinks) & @CRLF) EndIf $r += 1 Until $r > UBound($aGlobalLinks) ;_ArrayDisplay($aGlobalLinks) Func SaveFile() $oFile = FileOpen(@ScriptDir & "\KB_URLs.txt", 2) FileClose($oFile) _FileWriteFromArray(@ScriptDir & "\KB_URLs.txt", $aGlobalLinks, 0, UBound($aGlobalLinks), ",") EndFunc Func LoadFile() _FileReadToArray(@ScriptDir & "\KB_URLs.txt", $aGlobalLinks, $FRTA_NOCOUNT, ",") _ArrayDisplay($aGlobalLinks) EndFunc  
      The error I'm getting has to do with the function _IELinkGetCollection. I used the examples in the AutoIT Help section and there is multiple uses of $oLink.href. I haven't been able to find much on when/how to use the .href.
      Here is the Console Output of the error:
      RegExt result: 0 Looking for: https://website.com/kb/ Looking for: https://website.com/kb/207557-abc-bank-homepage# Looking for: https://website.com/kb/ Looking for: https://website.com/kb/19011-partners-and-isos Looking for: https://website.com/kb/46470-onsite-install-partners Looking for: https://website.com/en/small-business/payments-and-processing/abc-merchant-services.html Looking for: https://website.com/Clover Looking for: https://website.com/screens/signup/?integrations_id=12345 Looking for: https://website.com/instruction/import-an-inventory-menu-spreadsheet/?userDevice=web Looking for: https://website.com/instruction/import-an-inventory-menu-spreadsheet/?userDevice=web Looking for: https://website.com/instruction/import-an-inventory-menu-spreadsheet/?userDevice=web Looking for: https://website.com/appmarket/apps/Z6GMBJ5HCBEQA?clientCountry=US Looking for: https://website.com/kb/207557-abc-bank-homepage#panel3a Looking for: https://website.com/kb/207557-abc-bank-homepage#panel4a Looking for: https://website.com/kb/207557-abc-bank-homepage#panel5a "C:\Users\Jon\Desktop\KB Scrub\HTMLDOC_Test.au3" (65) : ==> The requested action with this object has failed.: ConsoleWrite("Looking for: " & $oLink.href & @CRLF) ConsoleWrite("Looking for: " & $oLink^ ERROR Any insight is appreciated!
    • By qsek
      Im not sure if this is intended but normally Autoit variables are always passed as copies (except objects i think).
      But below i observed an unconsistency when copying maps with nested maps inside.
      If you create a nested map1 and copy it to a new map2, changing a nested value in map2 will also change the nested value in map1
      Dim $player[] Dim $sub[] $player.test1 = 1 $player.test2 = $sub $player.test2.child1 = "org" $player.test2.childext = $sub $player.test2.childext.child1 = "org2" $playerold = $player ; make a copy of the whole map ConsoleWrite("player.test2.child1 : "& $player.test2.child1 & @CRLF); original nested value in $player $playerold.test2.child1 = "changed" ; edit a nested value in $playerold ConsoleWrite("player.test2.child1 : "& $player.test2.child1 & @CRLF) ; original nested value in $player changed ConsoleWrite("---------------------" & @CRLF) ConsoleWrite("player.test2.childext.child1 : "& $player.test2.childext.child1 & @CRLF); original level2 nested value in $player $playerold.test2.childext.child1 = "changed2" ; edit a level2 nested value in $playerold ConsoleWrite("player.test2.child1 : "& $player.test2.child1 & @CRLF); original level1 nested value in $player stayed the same ConsoleWrite("player.test2.childext.child1 : "& $player.test2.childext.child1 & @CRLF); original level2 nested value in $player changed  
    • By kara2004
      Hi there,
      I have a problem using the latest two betas of au3stripper.exe.
      Compiling my script using V17.224.935.6 works fine, the next two releases (18.624.1847.0 and 18.624.1847.1) show an error:
      !==> *** ERROR: stopping process because include file not found :#include <INCLUDE_FILE.au3> !==> *** Checked these directories : !==> C:\Program Files (x86)\AutoIt3\include\INCLUDE_FILE.au3 !==> SCRIPT_DIR\INCLUDE_FILE.au3 !==> SCRIPT_DIR\INCLUDE_FILE.au3 !>18:42:00 --------------------------------------------------------------- !>18:42:00 Au3Stripper ended with errors, using original scriptfile.rc:999 !>18:42:00 --------------------------------------------------------------- Changing the include line according to the helpfile (using "..." for includes in script dir and <..> for includes in the au3-include-dir won't help!?
    • By qsek
      Can somebody try to reproduce this bug?
      It would be helpful to know if this issue appeares on other environments too.
      Sometimes values of certain keys will return empty even if expicitly assigned a value before.
      Map is bigger than ~50 key/values pairs value is being worked with in a Function where a loop is iterating through the Map before retrieving the value there is a isMap/MapKeys/MapAppend/MapRemove check on the Map value. Dim $mMap[] ; Generate random key strings For $i = 0 To 100 $RndKey = "" For $i2 = 0 To 4 $RndKey &= Chr(Random(65,90,1)) Next $mMap[$RndKey] = 999 next ConsoleWrite("-----------1-------------" & @CRLF); Unpredictable blank values MapDisplay1($mMap) ConsoleWrite("-----------2-------------" & @CRLF); ByRef always works MapDisplay2($mMap) ConsoleWrite("-----------3-------------" & @CRLF); not in a function always works For $i In MapKeys($mMap) isMap($mMap[$i]) ConsoleWrite($i&": "&$mMap[$i]&@CRLF) Next Func MapDisplay1( $m_Map ) For $i In MapKeys($m_Map) isMap($m_Map[$i]) ;same problem with isMap($m_Map[$i]), MapKeys($m_Map[$i]), MapAppend/MapRemove but NOT with MapExists($m_Map,$i) ConsoleWrite($i&": "&$m_Map[$i]&@CRLF) Next EndFunc Func MapDisplay2( ByRef $m_Map ) For $i In MapKeys($m_Map) isMap($m_Map[$i]) ConsoleWrite($i&": "&$m_Map[$i]&@CRLF) Next EndFunc  
      The value is not lost or overwritten on the global map, only on the local map inside the function.
  • Create New...